Skip to content

Commit

Permalink
cicd: fix authenticate tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dkropachev committed Jan 23, 2025
1 parent 918e522 commit 886e526
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 11 deletions.
38 changes: 28 additions & 10 deletions .github/workflows/authenticate_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,40 @@ 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: Pull docker-compose from cache
uses: actions/cache@v4
id: docker-compose
with:
path: /usr/local/bin/docker-compose
key: docker-compose-${{ env.DOCKER_COMPOSE_VERSION }}

- name: Install Docker compose
if: steps.docker-compose.outputs.cache-hit != 'true'
run: sudo curl -L "https://github.com/docker/compose/releases/download/v2.32.4/docker-compose-linux-x86_64" -o /usr/local/bin/docker-compose && sudo chmod +x /usr/local/bin/docker-compose

- name: Start the cluster
run: docker-compose -f test/cluster/docker-compose-passauth.yml start

- name: Run tests
run: 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
2 changes: 1 addition & 1 deletion scylla/tests/integration/authenticate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ impl AuthenticatorProvider for CustomAuthenticatorProvider {
#[ignore]
async fn custom_authentication() {
setup_tracing();
let uri = std::env::var("SCYLLA_URI").unwrap_or_else(|_| "127.0.0.1:9042".to_string());
let uri = std::env::var("SCYLLA_URI").unwrap_or_else(|_| "172.43.0.2:9042".to_string());

println!("Connecting to {} with cassandra superuser ...", uri);

Expand Down
28 changes: 28 additions & 0 deletions test/cluster/docker-compose-passauth.yml
Original file line number Diff line number Diff line change
@@ -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", "scylla1", "-e", "select * from system.local" ]
interval: 5s
timeout: 5s
retries: 60

0 comments on commit 886e526

Please sign in to comment.