-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: configurable integration tests support (#772)
Signed-off-by: Anton Baliasnikov <anton.baliasnikov@iohk.io> Signed-off-by: Shota Jolbordi <shota.jolbordi@iohk.io>
- Loading branch information
Anton Baliasnikov
authored and
Shota Jolbordi
committed
Mar 6, 2024
1 parent
37714ea
commit 20540b7
Showing
23 changed files
with
681 additions
and
236 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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,69 @@ | ||
name: Unit tests | ||
|
||
# Cancel previously running workflows if new commit pushed to the branch | ||
# this will help to push fixes earlier and stop previous workflows | ||
concurrency: | ||
group: ${{ github.head_ref }}${{ github.ref }}-unit-tests | ||
cancel-in-progress: true | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
pull_request: | ||
|
||
jobs: | ||
build-and-unit-tests: | ||
name: "Build and unit tests" | ||
runs-on: self-hosted | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
container: | ||
image: ghcr.io/hyperledger-labs/ci-debian-jdk-22:0.1.0 | ||
volumes: | ||
- /nix:/nix | ||
env: | ||
TESTCONTAINERS_RYUK_DISABLED: true | ||
steps: | ||
- name: Git checkout (merge) | ||
uses: actions/checkout@v3 | ||
if: github.event_name != 'pull_request' | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Git checkout (PR) | ||
uses: actions/checkout@v3 | ||
if: github.event_name == 'pull_request' | ||
with: | ||
fetch-depth: 0 | ||
# see: https://frontside.com/blog/2020-05-26-github-actions-pull_request/#how-does-pull_request-affect-actionscheckout | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
|
||
- name: Download dependencies | ||
run: sbt +update | ||
|
||
- name: Check formatting | ||
run: sbt scalafmtCheckAll | ||
|
||
- name: Run unit tests | ||
env: | ||
HOME: /root | ||
run: | | ||
sbt -v coverage test coverageAggregate | ||
- name: Upload coverage to Coveralls | ||
env: | ||
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} | ||
run: sbt coveralls | ||
|
||
- name: Aggregate test reports | ||
if: always() | ||
uses: ./.github/actions/aggregate-test-reports | ||
|
||
- name: Publish test results | ||
if: always() | ||
uses: EnricoMi/publish-unit-test-result-action@v2 | ||
with: | ||
junit_files: "./target/test-reports/**/TEST-*.xml" | ||
comment_title: "Unit Test Results" | ||
check_name: "Unit Test Results" |
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
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
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
12 changes: 12 additions & 0 deletions
12
tests/integration-tests/src/test/kotlin/config/AgentInitConf.kt
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,12 @@ | ||
package config | ||
|
||
import com.sksamuel.hoplite.ConfigAlias | ||
|
||
data class AgentInitConf( | ||
val version: String, | ||
@ConfigAlias("http_port") val httpPort: Int, | ||
@ConfigAlias("didcomm_port") val didcommPort: Int, | ||
@ConfigAlias("secret_storage_backend") val secretStorageBackend: String, | ||
@ConfigAlias("auth_enabled") val authEnabled: Boolean, | ||
@ConfigAlias("keycloak_enabled") val keycloakEnabled: Boolean, | ||
) |
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
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
31 changes: 31 additions & 0 deletions
31
tests/integration-tests/src/test/kotlin/config/ServicesConf.kt
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,31 @@ | ||
package config | ||
|
||
import com.sksamuel.hoplite.ConfigAlias | ||
|
||
data class ServicesConf( | ||
@ConfigAlias("prism_node") val prismNode: PrismNodeConf?, | ||
val keycloak: KeycloakConf?, | ||
val vault: VaultConf?, | ||
) | ||
|
||
data class PrismNodeConf( | ||
@ConfigAlias("http_port") val httpPort: Int, | ||
val version: String, | ||
) | ||
|
||
data class KeycloakConf( | ||
@ConfigAlias("http_port") val httpPort: Int, | ||
val realm: String, | ||
@ConfigAlias("client_id") val clientId: String, | ||
@ConfigAlias("client_secret") val clientSecret: String, | ||
val users: List<KeycloakUser> | ||
) | ||
|
||
data class KeycloakUser( | ||
val username: String, | ||
val password: String | ||
) | ||
|
||
data class VaultConf( | ||
@ConfigAlias("http_port") val httpPort: Int, | ||
) |
Oops, something went wrong.