Skip to content

feat: sync with the main branch + CredentialDefinition adoption for MT. Signed-off-by: Yurii Shynbuiev [email protected] #1633

feat: sync with the main branch + CredentialDefinition adoption for MT. Signed-off-by: Yurii Shynbuiev [email protected]

feat: sync with the main branch + CredentialDefinition adoption for MT. Signed-off-by: Yurii Shynbuiev [email protected] #1633

Workflow file for this run

name: End-to-end tests
concurrency:
group: ${{ github.head_ref }}${{ github.ref }}-e2e-tests
cancel-in-progress: true
on:
schedule:
- cron: "0 3 * * *"
pull_request:
push:
branches:
- "main"
workflow_dispatch:
defaults:
run:
shell: bash
working-directory: "tests/e2e-tests"
jobs:
run-e2e-tests:
name: "Run e2e tests"
runs-on: ubuntu-latest
env:
REPORTS_DIR: "tests/e2e-tests/target/site/serenity"
XRAY_EXECUTION_TAG_LOCALHOST: "@ATL-3851"
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Java and Scala
uses: olafurpg/setup-scala@v13
with:
java-version: [email protected]
- name: Setup Gradle
uses: gradle/[email protected]
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ secrets.ATALA_GITHUB_ACTOR }}
password: ${{ secrets.ATALA_GITHUB_TOKEN }}
- name: Install Compose
uses: ndeloof/[email protected]
with:
version: v2.12.2 # defaults to 'latest'
legacy: true # will also install in PATH as `docker-compose`
- name: Build local version of PRISM Agent
env:
ENV_FILE: "infrastructure/local/.env"
PRISM_AGENT_PATH: "../.."
GITHUB_ACTOR: ${{ secrets.ATALA_GITHUB_ACTOR }}
GITHUB_TOKEN: ${{ secrets.ATALA_GITHUB_TOKEN }}
run: |
cd "${PRISM_AGENT_PATH}" || exit 129
sbt docker:publishLocal
PRISM_AGENT_VERSION=$(cut version.sbt -d '=' -f2 | tr -d '" ')
sed -i.bak "s/PRISM_AGENT_VERSION=.*/PRISM_AGENT_VERSION=${PRISM_AGENT_VERSION}/" "${ENV_FILE}" && rm -f "${ENV_FILE}.bak"
cat "${ENV_FILE}"
- name: Start services for issuer
env:
PORT: 8080
WEBHOOK_URL: http://host.docker.internal:9955
uses: isbang/[email protected]
with:
compose-file: "./infrastructure/shared/docker-compose.yml"
compose-flags: "--env-file ./infrastructure/local/.env -p issuer"
up-flags: "--wait"
down-flags: "--volumes"
- name: Start services for holder
env:
PORT: 8090
WEBHOOK_URL: http://host.docker.internal:9956
uses: isbang/[email protected]
with:
compose-file: "./infrastructure/shared/docker-compose.yml"
compose-flags: "--env-file ./infrastructure/local/.env -p holder"
up-flags: "--wait"
down-flags: "--volumes"
- name: Start services for verifier
env:
PORT: 8070
WEBHOOK_URL: http://host.docker.internal:9957
uses: isbang/[email protected]
with:
compose-file: "./infrastructure/shared/docker-compose.yml"
compose-flags: "--env-file ./infrastructure/local/.env -p verifier"
up-flags: "--wait"
down-flags: "--volumes"
- name: Run e2e tests
continue-on-error: true
run: |
./gradlew test --tests "E2eTestsRunner" || true
./gradlew reports
- name: Update X-Ray test execution
uses: ./.github/actions/upload-to-xray
if: github.ref_name == 'main'
with:
username: ${{ secrets.XRAY_CLIENT_ID }}
password: ${{ secrets.XRAY_CLIENT_SECRET }}
json: "tests/e2e-tests/target/serenity-reports/cucumber_report.json"
execution_tag: ${{ env.XRAY_EXECUTION_TAG_LOCALHOST }}
- name: Extract test results
id: analyze_test_results
if: github.ref_name == 'main'
run: |
JSON_RESULTS="target/site/serenity/serenity-summary.json"
CONCLUSION=failure
TOTAL_TESTS=0
FAILED_TESTS=0
SKIPPED_TESTS=0
TESTS_WITH_ERRORS=0
if [ -f "${JSON_RESULTS}" ]; then
TOTAL_TESTS="$(cat ${JSON_RESULTS} | jq '.results.counts.total')"
PENDING_TESTS="$(cat ${JSON_RESULTS} | jq '.results.counts.pending')"
SKIPPED_TESTS="$(cat ${JSON_RESULTS} | jq '.results.counts.skipped')"
IGNORED_TESTS="$(cat ${JSON_RESULTS} | jq '.results.counts.ignored')"
FAILED_TESTS="$(cat ${JSON_RESULTS} | jq '.results.counts.failure')"
TESTS_WITH_ERRORS="$(cat ${JSON_RESULTS} | jq '.results.counts.error')"
if [[ ${FAILED_TESTS} == 0 && ${TESTS_WITH_ERRORS} == 0 ]] ; then
CONCLUSION=success
fi
fi
{
echo "slack_report_failure=${SLACK_REPORT_FAILURE}";
echo "conclusion=${CONCLUSION}";
echo "tests=${TOTAL_TESTS}";
echo "failures=${FAILED_TESTS}";
echo "errors=${TESTS_WITH_ERRORS}";
echo "pending=${PENDING_TESTS}";
echo "skipped=${SKIPPED_TESTS}";
echo "ignored=${IGNORED_TESTS}";
} >> "$GITHUB_OUTPUT"
- name: Publish e2e test Results
id: publish-unit-tests
uses: EnricoMi/publish-unit-test-result-action@v2
with:
junit_files: "${{ env.REPORTS_DIR }}/SERENITY-JUNIT-*.xml"
comment_title: "E2E Test Results"
check_name: "E2E Test Results"
- name: Upload artifacts
if: github.ref_name == 'main' || steps.analyze_test_results.outputs.conclusion == 'failure'
uses: actions/upload-artifact@v2
with:
name: e2e-tests-result
path: ${{ env.REPORTS_DIR }}
- name: Slack Notification
if: github.ref_name == 'main' && steps.analyze_test_results.outputs.conclusion == 'failure'
uses: rtCamp/action-slack-notify@v2
env:
SLACK_COLOR: ${{ steps.analyze_test_results.outputs.conclusion }}
SLACK_MESSAGE: |
Total: ${{ steps.analyze_test_results.outputs.tests }}
Failed: ${{ steps.analyze_test_results.outputs.failures }}
Errors in tests: ${{ steps.analyze_test_results.outputs.errors }}
Skipped (known bugs): ${{ steps.analyze_test_results.outputs.skipped }}
SLACK_TITLE: "Atala PRISM V2 E2E tests: ${{ steps.analyze_test_results.outputs.conclusion }}"
SLACK_USERNAME: circleci
SLACK_WEBHOOK: ${{ secrets.E2E_TESTS_SLACK_WEBHOOK }}