Repository navigation
feat: keploy-junit5, a JUnit 5 extension for keploy mock record/replay #1
This file contains hidden or 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
| name: keploy-junit5 | |
| on: | |
| pull_request: | |
| paths: | |
| - "keploy-junit5/**" | |
| - ".github/workflows/junit5-sdk.yml" | |
| push: | |
| branches: [main] | |
| paths: | |
| - "keploy-junit5/**" | |
| - ".github/workflows/junit5-sdk.yml" | |
| # keploy-junit5-release.yml runs these rows and the e2e lane on a release | |
| # tag before it publishes. | |
| workflow_call: | |
| concurrency: | |
| group: keploy-junit5-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| rows: | |
| name: rows (JDK ${{ matrix.java }}, JUnit ${{ matrix.junit }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| # One leg failing must not cancel the others: each leg's result is its | |
| # own. | |
| fail-fast: false | |
| matrix: | |
| # The oldest JUnit this extension supports (README.md) on the oldest | |
| # JDK it supports, the last JUnit 5, and JUnit 6 (JDK 17 or later). | |
| include: | |
| - { java: "8", junit: "5.10.5" } | |
| - { java: "17", junit: "5.14.4" } | |
| - { java: "21", junit: "6.1.3" } | |
| defaults: | |
| run: | |
| working-directory: keploy-junit5 | |
| steps: | |
| - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 | |
| - uses: actions/setup-java@cf277c60eb25467037889841efdb72551f06f6c3 # v4.9.1 | |
| with: | |
| distribution: temurin | |
| java-version: ${{ matrix.java }} | |
| cache: maven | |
| - run: mvn -B -ntp -Djunit.version=${{ matrix.junit }} verify | |
| e2e: | |
| # e2e/lane.sh: this commit's extension, installed with Maven into the | |
| # lane's own Maven repository and used by a small JUnit 5 suite, run with | |
| # Maven under keploy mock record with its provider up, then keploy mock | |
| # replay with the provider stopped; a test whose call has no recorded | |
| # answer, and one that no longer makes its recorded call, fail with | |
| # keploy's text; a quarantined test is skipped with keploy's reason. | |
| name: e2e (keploy mock record and replay) | |
| runs-on: ubuntu-latest | |
| # The lane takes a few minutes, Maven's downloads included: a run past 15 | |
| # is a hang. | |
| timeout-minutes: 15 | |
| env: | |
| # keploy's enterprise build, which judges each test under | |
| # KEPLOY_PROVEN=1. Pinned, and checked against its digest, so that a | |
| # new keploy release cannot change this job's result unseen. | |
| KEPLOY_VERSION: "3.8.106" | |
| KEPLOY_SHA256: "2c4c9bcf0a703b65827d1cee5ca88fe9d7856844a08cac368b42b83345fef3ce" | |
| steps: | |
| - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 | |
| - uses: actions/setup-java@cf277c60eb25467037889841efdb72551f06f6c3 # v4.9.1 | |
| with: | |
| distribution: temurin | |
| java-version: "17" | |
| - name: install keploy ${{ env.KEPLOY_VERSION }} | |
| run: | | |
| curl -fsSL --retry 5 -o "$RUNNER_TEMP/keploy" "https://keploy.io/ent/dl/$KEPLOY_VERSION/enterprise_linux_amd64" | |
| echo "$KEPLOY_SHA256 $RUNNER_TEMP/keploy" | sha256sum -c - | |
| chmod +x "$RUNNER_TEMP/keploy" | |
| - run: KEPLOY_BIN="$RUNNER_TEMP/keploy" bash keploy-junit5/e2e/lane.sh |