Skip to content

Commit

Permalink
Add authenticate test to CI.
Browse files Browse the repository at this point in the history
Add authenticate test to github actions
  • Loading branch information
asledz committed Apr 7, 2021
1 parent 007540e commit 3464041
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/authenticate_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Authenticate

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

env:
CARGO_TERM_COLOR: always

jobs:
# PasswordAuthenticator
build:
runs-on: ubuntu-latest
services:
scylladb:
image: cvybhu/scylla-passauth
ports:
- 9042:9042
options: --health-cmd "cqlsh --username cassandra --password cassandra --debug" --health-interval 5s --health-retries 30
volumes:
- ${{ github.workspace }}:/workspace
steps:
- uses: actions/checkout@v2
- name: Run tests
run: cargo test --verbose -- --ignored
22 changes: 22 additions & 0 deletions scylla/src/transport/authenticate_test.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#[tokio::test]
#[ignore]
async fn authenticate_superuser() {
let uri = std::env::var("SCYLLA_URI").unwrap_or_else(|_| "127.0.0.1:9042".to_string());

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

let session = crate::SessionBuilder::new()
.known_node(uri)
.user("cassandra", "cassandra")
.build()
.await
.unwrap();

session.query("CREATE KEYSPACE IF NOT EXISTS ks WITH REPLICATION = {'class' : 'SimpleStrategy', 'replication_factor' : 1}", &[]).await.unwrap();
session
.query("DROP TABLE IF EXISTS ks.t;", &[])
.await
.unwrap();

println!("Ok.");
}
1 change: 1 addition & 0 deletions scylla/src/transport/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ pub mod errors;
pub mod iterator;
mod metrics;

mod authenticate_test;
#[cfg(test)]
mod session_test;

Expand Down

0 comments on commit 3464041

Please sign in to comment.