Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,13 @@ The user you use to run Wildfly needs to have an SSH public/private key pair (ss

The unit tests run with `gradlew build`, or alone with `gradlew test`. They need no database, Wildfly, or containers: the SSH tests start their own in-process SSH server.

The integration tests run against the app and its services in containers, built from source, and are not part of `gradlew build`:
```
docker compose -f build.yaml up -d --build
gradlew integrationTest
```
They wait up to 5 minutes for the services to start (set `ADM_READY_TIMEOUT_SECONDS` to change that), then log in with the demo users and the `adm` client's service account, as CI deploys do. They add their own app envs to deploy to, and remove them afterwards. To test an app on other ports, set `ADM_URL` (default `https://localhost:8443/adm`) and `KEYCLOAK_URL` (default `http://localhost:8081/auth`).

## Release
1. Bump the version number in the VERSION file and commit and push to GitHub (using [Semantic Versioning](https://semver.org/)).
2. The [CD](https://github.com/JeffersonLab/adm/blob/main/.github/workflows/cd.yaml) GitHub Action should run automatically invoking:
Expand Down
30 changes: 30 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ tasks.withType(JavaCompile).configureEach {
repositories {
mavenCentral()
}
sourceSets {
integration {
java.srcDir "${projectDir}/src/integration/java"
}
}
configurations {
integrationImplementation.extendsFrom testImplementation
integrationRuntimeOnly.extendsFrom testRuntimeOnly
}
dependencies {
// No matter what smoothness weblib MUST be included in WAR (https://github.com/JeffersonLab/smoothness/issues/4)
implementation "org.jlab:smoothness-weblib:${smoothnessVersion}"
Expand All @@ -35,10 +44,31 @@ dependencies {
testImplementation platform('org.junit:junit-bom:6.1.3')
testImplementation 'org.junit.jupiter:junit-jupiter'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'

integrationImplementation 'org.eclipse.parsson:parsson:1.1.9'
}
tasks.named('test') {
useJUnitPlatform()
}
// Not part of build: needs the app and its services running, see README
tasks.register('integrationTest', Test) {
description = 'Runs integration tests against a running app (docker compose -f build.yaml up).'
group = 'verification'

testClassesDirs = sourceSets.integration.output.classesDirs
classpath = sourceSets.integration.runtimeClasspath

useJUnitPlatform()
shouldRunAfter tasks.named('test')

// The services may still be starting, and they are not up to date with the source files
outputs.upToDateWhen { false }

testLogging {
events "passed", "skipped", "failed"
exceptionFormat = "full"
}
}
tasks.named('jar') {
enabled = false
}
Expand Down
8 changes: 7 additions & 1 deletion container/keycloak/initdb.d/03_customize.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,10 @@ echo "----------------"
echo "| Assign Roles |"
echo "----------------"
KC_USERNAME=jsmith
assign_role
assign_role

echo "------------------------------------"
echo "| Allow Password Grant (Test Only) |"
echo "------------------------------------"
# Integration tests get tokens for test users such as tbrown with their passwords
${KC_HOME}/bin/kcadm.sh update clients/${KC_CLIENT_NAME} -r "${KC_REALM}" -s directAccessGrantsEnabled=true
Loading
Loading