test(e2e): Fix cassandra e2e test (#2548) (#6739)

* chore(e2e): Parallelize installation steps

* chore(e2e): Install missing dependencies

* test(e2e): Improve resiliency of assertions

* CR
This commit is contained in:
Michael Li authored and GitHub committed 2026-05-21 12:58:27 -04:00
1 parent de2647d461
commit e19c5472f9
2 files changed
+23 -11

No files matched your search

+18 -9
View File
@@ -247,18 +247,27 @@ jobs:
- name: Install other test dependencies - name: Install other test dependencies
if: contains(matrix.filter, 'e2e_docker_base_plus') if: contains(matrix.filter, 'e2e_docker_base_plus')
run: | run: |
# mongosh # Download dependencies in parallel
wget -q https://github.com/mongodb-js/mongosh/releases/download/v2.7.0/mongosh-2.7.0-linux-x64.tgz -O /tmp/mongosh.tgz wget -q https://github.com/mongodb-js/mongosh/releases/download/v2.7.0/mongosh-2.7.0-linux-x64.tgz -O /tmp/mongosh.tgz &
wget -q https://archive.apache.org/dist/cassandra/4.1.10/apache-cassandra-4.1.10-bin.tar.gz -O /tmp/cassandra.tar.gz &
wait
# Install redis and mysql
sudo apt update && sudo apt install -y redis-tools mysql-client
# Install mongosh
tar -xzf /tmp/mongosh.tgz -C "$HOME" tar -xzf /tmp/mongosh.tgz -C "$HOME"
echo "$HOME/mongosh-2.7.0-linux-x64/bin" >> "$GITHUB_PATH" echo "$HOME/mongosh-2.7.0-linux-x64/bin" >> "$GITHUB_PATH"
# cqlsh (cassandra CLI) # Install cassandra and update it to use the python virtual
wget -q https://archive.apache.org/dist/cassandra/4.1.10/apache-cassandra-4.1.10-bin.tar.gz -O /tmp/cassandra.tar.gz # environment
tar -xzf /tmp/cassandra.tar.gz -C "$HOME" # A virtual environment was needed because python environments on
echo "$HOME/apache-cassandra-4.1.10/bin" >> "$GITHUB_PATH" # self-hosted runners are externally managed.
sudo apt install -y python3.12-venv
# redis python3 -m venv "$HOME/cqlsh-venv"
sudo apt update && sudo apt install -y redis-tools mysql-client "$HOME/cqlsh-venv/bin/pip" install --upgrade pip
"$HOME/cqlsh-venv/bin/pip" install cqlsh
echo "$HOME/cqlsh-venv/bin" >> "$GITHUB_PATH"
- name: Determine boundary version to test against previous worker version - name: Determine boundary version to test against previous worker version
# Resolve the worker version from the previous release line. # Resolve the worker version from the previous release line.
if: contains(matrix.filter, 'e2e_docker_base_with_worker_version') if: contains(matrix.filter, 'e2e_docker_base_with_worker_version')
@@ -120,8 +120,11 @@ func TestCliTcpTargetConnectCassandra(t *testing.T) {
output := buf.String() output := buf.String()
t.Logf("Cassandra session output: %s", output) t.Logf("Cassandra session output: %s", output)
require.Contains(t, output, "keyspace_name") // Note: Additional assertions can be tricky due to output containing \r\n
require.Contains(t, output, keyspace) // and \b characters. The following assertions should be sufficient to prove
// that commands were executed successfully
require.Contains(t, output, "system_schema") // output of DESCRIBE KEYSPACES
require.Contains(t, output, "(1 rows)") // output of SELECT query
t.Log("Successfully connected to Cassandra target") t.Log("Successfully connected to Cassandra target")
} }