fix: testing to find the issue #3099
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
name: Performance tests | |
concurrency: | |
group: ${{ github.head_ref }}${{ github.ref }}-performance-tests | |
cancel-in-progress: true | |
on: | |
pull_request: | |
push: | |
branches: | |
- "main" | |
workflow_dispatch: | |
env: | |
BENCHMARKING_DIR: "tests/performance-tests/agent-performance-tests-k6" | |
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GITHUB_ACTOR: ${{ github.actor }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
jobs: | |
run-e2e-tests: | |
name: "Run performance tests" | |
runs-on: ubuntu-latest | |
if: ${{ !contains(github.event.pull_request.title, '[skip ci]') }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Java and Scala | |
uses: olafurpg/setup-scala@v14 | |
with: | |
java-version: [email protected] | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v3 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ env.GITHUB_ACTOR }} | |
password: ${{ env.GITHUB_TOKEN }} | |
- uses: KengoTODA/actions-setup-docker-compose@v1 | |
name: Install `docker-compose` | |
with: | |
version: "2.14.2" | |
- name: Build local version of Cloud Agent | |
env: | |
ENV_FILE: "infrastructure/local/.env" | |
run: | | |
sbt docker:publishLocal | |
AGENT_VERSION=$(cut version.sbt -d '=' -f2 | tr -d '" ') | |
sed -i.bak "s/AGENT_VERSION=.*/AGENT_VERSION=${AGENT_VERSION}/" "${ENV_FILE}" && rm -f "${ENV_FILE}.bak" | |
cat "${ENV_FILE}" | |
- name: Create Docker Network | |
run: | | |
docker network create agent-network || echo "Network already exists" | |
- name: Start services for prism node & postgres | |
env: | |
PG_PORT: 5432 | |
NODE_REFRESH_AND_SUBMIT_PERIOD: 1s | |
NODE_MOVE_SCHEDULED_TO_PENDING_PERIOD: 1s | |
NODE_WALLET_MAX_TPS: 1000 | |
uses: hoverkraft-tech/[email protected] | |
with: | |
compose-file: "./infrastructure/shared/docker-compose-node.yml" | |
compose-flags: "--env-file ./infrastructure/local/.env -p prism-node" | |
up-flags: "--wait" | |
down-flags: "--volumes" | |
- name: Start services for issuer | |
env: | |
PORT: 8080 | |
ADMIN_TOKEN: admin | |
DEFAULT_WALLET_ENABLED: true | |
DEFAULT_WALLET_AUTH_API_KEY: default | |
API_KEY_AUTO_PROVISIONING: false | |
API_KEY_ENABLED: true | |
DOCKERHOST: "cloud-agent" | |
PG_PORT: 5432 | |
NODE_REFRESH_AND_SUBMIT_PERIOD: 1s | |
NODE_MOVE_SCHEDULED_TO_PENDING_PERIOD: 1s | |
NODE_WALLET_MAX_TPS: 1000 | |
uses: hoverkraft-tech/[email protected] | |
with: | |
compose-file: "./infrastructure/shared/docker-compose-agent.yml" | |
compose-flags: "--env-file ./infrastructure/local/.env -p issuer" | |
up-flags: "--wait" | |
down-flags: "--volumes" | |
- name: Start services for holder | |
env: | |
PORT: 8090 | |
ADMIN_TOKEN: admin | |
DEFAULT_WALLET_ENABLED: true | |
DEFAULT_WALLET_AUTH_API_KEY: default | |
API_KEY_AUTO_PROVISIONING: false | |
API_KEY_ENABLED: true | |
DOCKERHOST: "cloud-agent" | |
PG_PORT: 5433 | |
uses: isbang/[email protected] | |
with: | |
compose-file: "./infrastructure/shared/docker-compose-agent.yml" | |
compose-flags: "--env-file ./infrastructure/local/.env -p holder" | |
up-flags: "--wait" | |
down-flags: "--volumes" | |
- name: Start services for verifier | |
env: | |
PORT: 8100 | |
ADMIN_TOKEN: admin | |
DEFAULT_WALLET_ENABLED: true | |
DEFAULT_WALLET_AUTH_API_KEY: default | |
API_KEY_AUTO_PROVISIONING: false | |
API_KEY_ENABLED: true | |
DOCKERHOST: "cloud-agent" | |
PG_PORT: 5434 | |
uses: isbang/[email protected] | |
with: | |
compose-file: "./infrastructure/shared/docker-compose-agent.yml" | |
compose-flags: "--env-file ./infrastructure/local/.env -p verifier" | |
up-flags: "--wait" | |
down-flags: "--volumes" | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 16.x | |
registry-url: "https://npm.pkg.github.com" | |
scope: "input-output-hk" | |
- name: Install dependencies | |
uses: borales/actions-yarn@v5 | |
with: | |
cmd: install | |
dir: ${{ env.BENCHMARKING_DIR }} | |
- name: Compile tests to JS | |
uses: borales/actions-yarn@v5 | |
with: | |
cmd: webpack | |
dir: ${{ env.BENCHMARKING_DIR }} | |
- name: All Smoke Tests | |
env: | |
ISSUER_AGENT_API_KEY: default | |
HOLDER_AGENT_API_KEY: default | |
VERIFIER_AGENT_API_KEY: default | |
run: | | |
# Have to use manual download because GitHub action doesnt support localhost execution | |
curl https://github.com/grafana/k6/releases/download/v0.45.0/k6-v0.45.0-linux-amd64.tar.gz -L | tar xvz --strip-components 1 | |
ls -la | |
./k6 run -e SCENARIO_LABEL=create-prism-did-smoke ${{ env.BENCHMARKING_DIR }}/dist/create-prism-did-test.js | |
./k6 run -e SCENARIO_LABEL=credential-offer-smoke ${{ env.BENCHMARKING_DIR }}/dist/credential-offer-test.js | |
./k6 run -e SCENARIO_LABEL=credential-definition-smoke ${{ env.BENCHMARKING_DIR }}/dist/credential-definition-test.js | |
./k6 run -e SCENARIO_LABEL=credential-schema-smoke ${{ env.BENCHMARKING_DIR }}/dist/credential-schema-test.js | |
./k6 run -e SCENARIO_LABEL=did-publishing-smoke ${{ env.BENCHMARKING_DIR }}/dist/did-publishing-test.js | |
./k6 run -e SCENARIO_LABEL=connection-flow-smoke ${{ env.BENCHMARKING_DIR }}/dist/connection-flow-test.js | |
./k6 run -e SCENARIO_LABEL=issuance-flow-smoke ${{ env.BENCHMARKING_DIR }}/dist/issuance-flow-test.js | |
./k6 run -e SCENARIO_LABEL=present-proof-flow-smoke ${{ env.BENCHMARKING_DIR }}/dist/present-proof-flow-test.js | |
- name: Remove Docker Network | |
if: always() | |
run: | | |
echo "Forcefully stopping all containers on agent-network" | |
docker ps -q --filter network=agent-network | xargs -r docker stop || echo "No containers to stop" | |
docker ps -a -q --filter network=agent-network | xargs -r docker rm || echo "No containers to remove" | |
docker network rm agent-network || echo "Network not found" |