Skip to content

Commit

Permalink
extend tests with integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kilork committed Mar 30, 2024
1 parent 5e366b4 commit e1a2ab8
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 24 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Integration Test

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

env:
CARGO_TERM_COLOR: always

jobs:
integration:
services:
keycloak:
image: quay.io/keycloak/keycloak:24.0.2
env:
KEYCLOAK_ADMIN: admin
KEYCLOAK_ADMIN_PASSWORD: password
ports:
- "8080:8080"
options: >-
--entrypoint start-dev
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: dtolnay/[email protected]
- name: Build
run: cargo build --verbose
- name: Run unit tests
run: cargo test --verbose
- name: Run integration tests
run: cargo run --example=adduser
23 changes: 0 additions & 23 deletions .github/workflows/rust.yml

This file was deleted.

2 changes: 1 addition & 1 deletion examples/adduser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use keycloak::{

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let url = std::env::var("KEYCLOAK_ADDR").unwrap_or_else(|_| "http://localhost:9080".into());
let url = std::env::var("KEYCLOAK_ADDR").unwrap_or_else(|_| "http://localhost:8080".into());
let user = std::env::var("KEYCLOAK_USER").unwrap_or_else(|_| "admin".into());
let password = std::env::var("KEYCLOAK_PASSWORD").unwrap_or_else(|_| "password".into());
let client = reqwest::Client::new();
Expand Down

0 comments on commit e1a2ab8

Please sign in to comment.