Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation
Rust adyenbeginner-friendlyfeaturedfinancefintechhacktoberfesthigh-performanceopen-sourceorchestrationpaymentpayment-gatewaypayment-integrationpayment-processingpaymentspayments-platformrestful-apirustsdkstripeworks-with-react
ci(cypress-tests-runner): check for 'S-test-ready' label at runtime (#13313)
Sanchith Hegde5f10a978eb23
diff --git a/.github/workflows/CI-pr.yml b/.github/workflows/CI-pr.ymlindex 2c1033bcaa..4cd72596dd 100644--- a/.github/workflows/CI-pr.yml+++ b/.github/workflows/CI-pr.yml@@ -125,7 +125,7 @@ jobs:repo-token: ${{ secrets.GITHUB_TOKEN }}- name: Install rust cache- uses: Swatinem/[email protected]+ uses: Swatinem/[email protected]with:save-if: false@@ -188,7 +188,7 @@ jobs:repo-token: ${{ secrets.GITHUB_TOKEN }}- name: Install rust cache- uses: Swatinem/[email protected]+ uses: Swatinem/[email protected]with:save-if: false@@ -244,7 +244,7 @@ jobs:uses: actions/checkout@v6- name: Spell check specific directories- uses: crate-ci/[email protected]+ uses: crate-ci/[email protected]with:files: |api-reference/@@ -284,7 +284,7 @@ jobs:repo-token: ${{ secrets.GITHUB_TOKEN }}- name: Install rust cache- uses: Swatinem/[email protected]+ uses: Swatinem/[email protected]with:save-if: falsediff --git a/.github/workflows/CI-push.yml b/.github/workflows/CI-push.ymlindex 44b9ff707f..b53bc9f431 100644--- a/.github/workflows/CI-push.yml+++ b/.github/workflows/CI-push.yml@@ -99,7 +99,7 @@ jobs:# tool: sccache# checksum: true- - uses: Swatinem/[email protected]+ - uses: Swatinem/[email protected]with:save-if: ${{ github.event_name == 'push' }}@@ -194,7 +194,7 @@ jobs:# checksum: true- name: Install cargo-hack- uses: taiki-e/[email protected]+ uses: taiki-e/[email protected]with:tool: cargo-hackchecksum: true@@ -215,7 +215,7 @@ jobs:# tool: cargo-nextest# checksum: true- - uses: Swatinem/[email protected]+ - uses: Swatinem/[email protected]with:save-if: ${{ github.event_name == 'push' }}@@ -255,7 +255,7 @@ jobs:uses: actions/checkout@v6- name: Spell check specific directories- uses: crate-ci/[email protected]+ uses: crate-ci/[email protected]with:files: |api-reference/@@ -294,7 +294,7 @@ jobs:repo-token: ${{ secrets.GITHUB_TOKEN }}- name: Install rust cache- uses: Swatinem/[email protected]+ uses: Swatinem/[email protected]- name: Run cargo check enabling only the release and v2 features (redis-rs backend)shell: bashdiff --git a/.github/workflows/archive/connector-sanity-tests.yml b/.github/workflows/archive/connector-sanity-tests.ymlindex 16b2c14452..e05cee58b7 100644--- a/.github/workflows/archive/connector-sanity-tests.yml+++ b/.github/workflows/archive/connector-sanity-tests.yml@@ -84,7 +84,7 @@ jobs:with:toolchain: stable 2 weeks ago- - uses: Swatinem/[email protected]+ - uses: Swatinem/[email protected]with:save-if: falsediff --git a/.github/workflows/archive/connector-ui-sanity-tests.yml b/.github/workflows/archive/connector-ui-sanity-tests.ymlindex 0917f4bffe..644255a622 100644--- a/.github/workflows/archive/connector-ui-sanity-tests.yml+++ b/.github/workflows/archive/connector-ui-sanity-tests.yml@@ -120,12 +120,12 @@ jobs:toolchain: stable- name: Build and Cache Rust Dependencies- uses: Swatinem/[email protected]+ uses: Swatinem/[email protected]with:save-if: false- name: Install Diesel CLI with Postgres Support- uses: baptiste0928/[email protected]+ uses: baptiste0928/[email protected]if: ${{ (github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name) }}with:crate: diesel_clidiff --git a/.github/workflows/cypress-tests-runner.yml b/.github/workflows/cypress-tests-runner.ymlindex 6c2b5e7f66..d4989a5503 100644--- a/.github/workflows/cypress-tests-runner.yml+++ b/.github/workflows/cypress-tests-runner.yml@@ -97,11 +97,51 @@ jobs:git pushfi+ check-cypress-prerequisites:+ name: Check Cypress prerequisites+ runs-on: ubuntu-latest+ outputs:+ run-checks: ${{ steps.check.outputs.run-checks }}+ steps:+ - name: Check if S-test-ready label is present+ id: check+ env:+ GH_TOKEN: ${{ github.token }}+ shell: bash+ run: |+ # Merge queue, run checks+ if [[ "${{ github.event_name }}" == "merge_group" ]]; then+ echo "run-checks=true" >> "${GITHUB_OUTPUT}"+ exit 0+ fi++ HEAD_REPO="${{ github.event.pull_request.head.repo.full_name }}"+ BASE_REPO="${{ github.event.pull_request.base.repo.full_name }}"+ # Repository is a fork.+ # `RUN_TESTS` based checks successfully skip the checks anyway,+ # no point gating it behind a label in that case.+ if [[ "${HEAD_REPO}" != "${BASE_REPO}" ]]; then+ echo "run-checks=true" >> "${GITHUB_OUTPUT}"+ exit 0+ fi++ LABELS=$(+ gh pr view ${{ github.event.pull_request.number }} \+ --repo ${{ github.repository }} \+ --json labels \+ --jq '.labels[].name'+ )+ if echo "${LABELS}" | grep --quiet "S-test-ready"; then+ echo "run-checks=true" >> "${GITHUB_OUTPUT}"+ else+ echo "run-checks=false" >> "${GITHUB_OUTPUT}"+ exit 1+ fi+build-hyperswitch:name: Build hyperswitch server- if: |- github.event_name == 'merge_group' ||- (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'S-test-ready'))+ needs: [check-cypress-prerequisites]+ if: ${{ needs.check-cypress-prerequisites.outputs.run-checks == 'true' }}# use hyperswitch-runners-merge for merge queue level checksruns-on: ${{ case(github.event_name == 'merge_group', 'hyperswitch-runners-merge', 'hyperswitch-runners') }}env:@@ -158,15 +198,14 @@ jobs:prepare-mandatory-matrix:name: Prepare Mandatory Connectors matrix to run cypress tests- if: |- github.event_name == 'merge_group' ||- (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'S-test-ready'))+ needs: [check-cypress-prerequisites]+ if: ${{ needs.check-cypress-prerequisites.outputs.run-checks == 'true' }}# use hyperswitch-runners-merge for merge queue level checksruns-on: ${{ case(github.event_name == 'merge_group', 'hyperswitch-runners-merge', 'hyperswitch-runners') }}outputs:mandatory-matrix: ${{ steps.set-mandatory-matrix.outputs.matrix }}- steps:- - name : Set matrix for mandatory connectors batches+ steps:+ - name: Set matrix for mandatory connectors batchesid: set-mandatory-matrixshell: bashrun: |@@ -204,9 +243,6 @@ jobs:mandatory-cypress-tests:name: Run mandatory Cypress testsneeds: [build-hyperswitch, prepare-mandatory-matrix]- if: |- github.event_name == 'merge_group' ||- (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'S-test-ready'))permissions:pull-requests: write# use hyperswitch-runners-merge for merge queue level checks@@ -432,10 +468,7 @@ jobs:mandatory-cypress-tests-consolidated-result:name: Mandatory Cypress Tests — Consolidated Resultneeds: [mandatory-cypress-tests]- if: |- (github.event_name == 'merge_group' ||- (github.event_name == 'pull_request' &&- contains(github.event.pull_request.labels.*.name, 'S-test-ready'))) && !cancelled()+ if: ${{ !cancelled() }}runs-on: ubuntu-latestpermissions:pull-requests: write@@ -720,9 +753,8 @@ jobs:prepare-mock-matrix:name: Prepare Mock Connectors matrix- if: |- github.event_name == 'merge_group' ||- (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'S-test-ready'))+ needs: [check-cypress-prerequisites]+ if: ${{ needs.check-cypress-prerequisites.outputs.run-checks == 'true' }}runs-on: ubuntu-latestoutputs:mock-matrix: ${{ steps.set-mock-matrix.outputs.matrix }}@@ -779,10 +811,6 @@ jobs:mitm-cassette-replay-cypress-tests:name: Run MITM mock Cypress tests (${{ matrix.batch.name }})needs: [build-hyperswitch, prepare-mock-matrix]- if: |- (github.event_name == 'merge_group' ||- (github.event_name == 'pull_request' &&- contains(github.event.pull_request.labels.*.name, 'S-test-ready'))) && !cancelled()runs-on: ${{ case(github.event_name == 'merge_group', 'hyperswitch-runners-merge', 'hyperswitch-runners') }}strategy:fail-fast: false@@ -1019,7 +1047,7 @@ jobs:- name: Install uvif: ${{ env.RUN_TESTS == 'true' }}- uses: astral-sh/[email protected]+ uses: astral-sh/[email protected]- name: Install mitmproxy dependenciesif: ${{ env.RUN_TESTS == 'true' }}@@ -1157,10 +1185,7 @@ jobs:mitm-cassette-replay-cypress-tests-consolidated-result:name: MITM Mock Cypress Tests — Consolidated Resultneeds: [mitm-cassette-replay-cypress-tests]- if: |- (github.event_name == 'merge_group' ||- (github.event_name == 'pull_request' &&- contains(github.event.pull_request.labels.*.name, 'S-test-ready'))) && !cancelled()+ if: ${{ !cancelled() }}runs-on: ubuntu-latestpermissions:pull-requests: write@@ -1200,7 +1225,7 @@ jobs:outputs:matrix: ${{ steps.set-matrix.outputs.matrix }}steps:- - name : Set matrix for optional connectors batches+ - name: Set matrix for optional connectors batchesid: set-matrixshell: bashrun: |@@ -1230,7 +1255,7 @@ jobs:runner-optional-connectors:name: Run Optional Connectors Cypress testsif: false- needs: [ build-hyperswitch, prepare-optional-matrix ]+ needs: [build-hyperswitch, prepare-optional-matrix]runs-on: hyperswitch-runnersstrategy:fail-fast: false@@ -1279,7 +1304,7 @@ jobs:with:toolchain: stable 2 weeks agocomponents: rustfmt-+- name: Install sccacheuses: taiki-e/install-action@v2with:@@ -1413,7 +1438,7 @@ jobs:uses: actions/upload-artifact@v7with:name: ${{ matrix.batch.server_logs_artifact }}- path: ${{ env.SERVER_LOG_PATH }}+ path: ${{ env.SERVER_LOG_PATH }}if-no-files-found: ignoreretention-days: 1@@ -1421,7 +1446,7 @@ jobs:if: failure()uses: actions/upload-artifact@v7with:- name: ${{ matrix.batch.report_artifact_name }}+ name: ${{ matrix.batch.report_artifact_name }}path: |cypress-tests/cypress/reports/retention-days: 1@@ -1499,7 +1524,7 @@ jobs:run: |LOCAL_ADMIN_API_KEY=$(yq '.secrets.admin_api_key' ${TOML_PATH})echo "CYPRESS_ADMINAPIKEY=${LOCAL_ADMIN_API_KEY}" >> $GITHUB_ENV-+- name: Install Rustif: ${{ env.RUN_TESTS == 'true' }}uses: dtolnay/rust-toolchain@master@@ -1653,7 +1678,8 @@ jobs:runner_v2:name: Run Cypress tests on v2 and generate coverage report- if: github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'S-test-ready')+ needs: [check-cypress-prerequisites]+ if: ${{ needs.check-cypress-prerequisites.outputs.run-checks == 'true' }}runs-on: hyperswitch-runnerspermissions:pull-requests: writediff --git a/.github/workflows/migration-check.yaml b/.github/workflows/migration-check.yamlindex 5456cf8d39..8371018cc0 100644--- a/.github/workflows/migration-check.yaml+++ b/.github/workflows/migration-check.yaml@@ -53,7 +53,7 @@ jobs:toolchain: stable 2 weeks agocomponents: rustfmt- - uses: baptiste0928/[email protected]+ - uses: baptiste0928/[email protected]with:crate: diesel_clifeatures: postgresdiff --git a/.github/workflows/postman-collection-runner.yml b/.github/workflows/postman-collection-runner.ymlindex ffe16604f8..82ccda8479 100644--- a/.github/workflows/postman-collection-runner.yml+++ b/.github/workflows/postman-collection-runner.yml@@ -91,7 +91,7 @@ jobs:- name: Build and Cache Rust Dependenciesif: ${{ ((github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name)) || (github.event_name == 'merge_group')}}- uses: Swatinem/[email protected]+ uses: Swatinem/[email protected]with:save-if: false@@ -103,7 +103,7 @@ jobs:- name: Install Diesel CLI with Postgres Supportif: ${{ ((github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name)) || (github.event_name == 'merge_group')}}- uses: baptiste0928/[email protected]+ uses: baptiste0928/[email protected]with:crate: diesel_clifeatures: postgresdiff --git a/.typos.toml b/.typos.tomlindex 5198c19a54..8c79340b95 100644--- a/.typos.toml+++ b/.typos.toml@@ -118,6 +118,7 @@ requestor = "requestor" #Used in external 3ds flowssubstituters = "substituters" # Present in `flake.nix`unsuccess = "unsuccess" # Used in cryptopay requestautomatico = "automatico" # Pix Automático (Portuguese for Automatic) - payment method name+iof = "iof" # Financial operations tax in Brazil / Imposto sobre Operações Financeiras[files]extend-exclude = [