-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add authenticate test to github actions
- Loading branch information
Showing
3 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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."); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters