fix(ui-test): Run UI tests only on merge-queue (#1709)

This commit is contained in:
Jagan
2023-07-14 16:58:40 +05:30
committed by GitHub
parent 82fd844620
commit cb0ca0cc2f
2 changed files with 25 additions and 10 deletions

View File

@ -2,10 +2,8 @@ name: Connector UI Sanity Tests
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
merge_group:
types:
- checks_requested
@ -39,7 +37,7 @@ env:
jobs:
test_connectors:
name: Run tests on stable toolchain for connectors
name: Run connector UI tests
runs-on: ubuntu-latest
services:
@ -70,35 +68,46 @@ jobs:
fail-fast: false
matrix:
connector:
# do not use more than 8 runners, try to group less time taking connectors together
- stripe
- adyen_uk,shift4,worldline,multisafepay
- airwallex,bluesnap,checkout
- paypal,mollie,payu,trustpay_3ds
# do not use more than 2 runners, try to group less time taking connectors together
- stripe,airwallex,bluesnap,checkout,trustpay_3ds,payu
- adyen_uk,shift4,worldline,multisafepay,paypal,mollie
steps:
- name: Ignore Tests incase of pull request
if: github.event_name == 'pull_request'
shell: bash
run: |
echo "Skipped tests as the event is pull request"
exit 0
- name: Checkout repository
if: github.event_name != 'pull_request'
uses: actions/checkout@v3
- name: Decrypt connector auth file
if: github.event_name != 'pull_request'
env:
CONNECTOR_AUTH_PASSPHRASE: ${{ secrets.CONNECTOR_AUTH_PASSPHRASE }}
shell: bash
run: ./scripts/decrypt_connector_auth.sh
- name: Set connector auth file path in env
if: github.event_name != 'pull_request'
shell: bash
run: echo "CONNECTOR_AUTH_FILE_PATH=$HOME/target/test/connector_auth.toml" >> $GITHUB_ENV
- name: Set connector tests file path in env
if: github.event_name != 'pull_request'
shell: bash
run: echo "CONNECTOR_TESTS_FILE_PATH=$HOME/target/test/connector_tests.json" >> $GITHUB_ENV
- name: Set ignore_browser_profile usage in env
if: github.event_name != 'pull_request'
shell: bash
run: echo "IGNORE_BROWSER_PROFILE=true" >> $GITHUB_ENV
- name: Install latest compiler
if: github.event_name != 'pull_request'
uses: actions-rs/toolchain@v1
with:
toolchain: stable
@ -106,18 +115,21 @@ jobs:
- uses: Swatinem/rust-cache@v2.4.0
- uses: baptiste0928/cargo-install@v2.1.0
if: github.event_name != 'pull_request'
with:
crate: diesel_cli
features: postgres
args: "--no-default-features"
- name: Diesel migration run
if: github.event_name != 'pull_request'
shell: bash
env:
DATABASE_URL: postgres://db_user:db_pass@localhost:5432/hyperswitch_db
run: diesel migration run
- name: Start server and run tests
if: github.event_name != 'pull_request'
env:
UI_TESTCASES_PATH: ${{ secrets.UI_TESTCASES_PATH }}
INPUT: ${{ matrix.connector }}
@ -125,10 +137,12 @@ jobs:
run: sh .github/scripts/run_ui_tests.sh
- name: View test results
if: github.event_name != 'pull_request'
shell: bash
run: cat tests/test_results.log
- name: Check test results
if: github.event_name != 'pull_request'
shell: bash
run: |
if test "$( grep 'test result: FAILED' -r tests/test_results.log | wc -l )" -gt "0"; then

View File

@ -35,6 +35,7 @@ async fn should_make_trustpay_3ds_payment(web_driver: WebDriver) -> Result<(), W
#[test]
#[serial]
#[ignore]
fn should_make_trustpay_3ds_payment_test() {
tester!(should_make_trustpay_3ds_payment);
}