From d0d535bff1db104e112ad020b998cb07bba12aba Mon Sep 17 00:00:00 2001 From: Dmitry Kropachev Date: Thu, 23 Jan 2025 13:08:30 -0400 Subject: [PATCH] cicd: fix authenticate tests github action services do not provide api to change entrypoint. We need to switch to docker-compose to spin up docker container for auth tests. --- .github/workflows/authenticate_test.yml | 28 +++++++++++++++--------- test/cluster/docker-compose-passauth.yml | 28 ++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 10 deletions(-) create mode 100644 test/cluster/docker-compose-passauth.yml diff --git a/.github/workflows/authenticate_test.yml b/.github/workflows/authenticate_test.yml index 7c9643f66b..bd2859e206 100644 --- a/.github/workflows/authenticate_test.yml +++ b/.github/workflows/authenticate_test.yml @@ -13,22 +13,30 @@ on: env: CARGO_TERM_COLOR: always RUST_BACKTRACE: full + DOCKER_COMPOSE_VERSION: 2.32.4 jobs: - # PasswordAuthenticator build: timeout-minutes: 60 + name: Run Authentication tests runs-on: ubuntu-latest - services: - scylladb: - image: scylladb/scylla - command: --authenticator PasswordAuthenticator - ports: - - 9042:9042 - options: --health-cmd "cqlsh --username cassandra --password cassandra --debug" --health-interval 5s --health-retries 30 steps: - - uses: actions/checkout@v3 + - name: Checkout + uses: actions/checkout@v3 + - name: Update rust toolchain run: rustup update + + - name: Start the cluster + run: docker compose -f test/cluster/docker-compose-passauth.yml up -d + - name: Run tests - run: RUST_LOG=trace cargo test --verbose authenticate_superuser -- custom_authentication --ignored + run: SCYLLA_URI=172.43.0.2 RUST_LOG=trace cargo test --verbose authenticate_superuser -- custom_authentication --ignored + + - name: Stop the cluster + if: ${{ always() }} + run: docker compose -f test/cluster/docker-compose-passauth.yml stop + + - name: Print the cluster logs + if: ${{ always() }} + run: docker compose -f test/cluster/docker-compose-passauth.yml logs diff --git a/test/cluster/docker-compose-passauth.yml b/test/cluster/docker-compose-passauth.yml new file mode 100644 index 0000000000..109e1e1b0d --- /dev/null +++ b/test/cluster/docker-compose-passauth.yml @@ -0,0 +1,28 @@ +networks: + public: + name: scylla_rust_driver_passauth_public + driver: bridge + ipam: + driver: default + config: + - subnet: 172.43.0.0/24 + +services: + scylla: + networks: + public: + ipv4_address: 172.43.0.2 + image: scylladb/scylla + command: | + --skip-wait-for-gossip-to-settle 0 + --ring-delay-ms 0 + --smp 1 + --memory 512M + --authenticator PasswordAuthenticator + ports: + - "9042:9042" + healthcheck: + test: [ "CMD", "cqlsh", "scylla", "-e", "select * from system.local" ] + interval: 5s + timeout: 5s + retries: 60