From be417d12951c920de75285ffc75d099ed7153e31 Mon Sep 17 00:00:00 2001 From: Santoshkumar Nateekar Date: Wed, 17 Apr 2024 15:12:30 -0700 Subject: [PATCH] MWPW-146763 : Enable @nopr tag to skip running selected tests on PR branch (#326) enable @nopr tag Co-authored-by: nateekar --- features/milo/georouting.spec.js | 4 ++-- run.sh | 21 +++++++++++---------- tests/milo/marquee.block.test.js | 1 + 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/features/milo/georouting.spec.js b/features/milo/georouting.spec.js index a98353ff..6235b4e1 100644 --- a/features/milo/georouting.spec.js +++ b/features/milo/georouting.spec.js @@ -15,7 +15,7 @@ module.exports = { cookieName: 'international', cookieValue: 'de', }, - tags: '@georouting @smoke @regression @milo ', + tags: '@georouting @smoke @regression @milo @nopr', }, { tcid: '1', @@ -98,7 +98,7 @@ module.exports = { cookieName: 'international', cookieValue: 'de', }, - tags: '@georouting @georouting-close @regression @milo ', + tags: '@georouting @georouting-close @regression @milo @nopr', }, ], }; diff --git a/run.sh b/run.sh index 07037bcd..6ca884a4 100755 --- a/run.sh +++ b/run.sh @@ -3,6 +3,7 @@ TAGS="" REPORTER="" APPS="" +EXCLUDE_TAGS="--grep-invert '@nopr'" PR_NUMBER=$(echo "$GITHUB_REF" | awk -F'/' '{print $3}') echo "PR Number: $PR_NUMBER" @@ -50,7 +51,7 @@ REPORTER=$reporter echo "*** Running Nala on $FEATURE_BRANCH ***" echo "Tags : $TAGS" echo "APPS : $APPS" -echo "npx playwright test ${TAGS} ${REPORTER}" +echo "npx playwright test ${TAGS} ${EXCLUDE_TAGS} ${REPORTER}" cd "$GITHUB_ACTION_PATH" || exit npm ci @@ -73,8 +74,8 @@ if [[ -n "$APPS" ]];then if [[ "$conf_name" == "nala" && -z "$project_name" ]]; then # Run default run-nala execution echo "*** Default nala-run config ***" - echo "npx playwright test ${TAGS} ${REPORTER}" - npx playwright test ${TAGS} ${REPORTER} + echo "npx playwright test ${TAGS} ${EXCLUDE_TAGS} ${REPORTER}" + npx playwright test ${TAGS} ${EXCLUDE_TAGS} ${REPORTER} elif [ ! -f "$config_file" ]; then echo "Config file : $config_file is not found" @@ -82,17 +83,17 @@ if [[ -n "$APPS" ]];then else if [[ -n "$project_name" ]];then # Run on all three browsers, configured as projects in corresponding .config.js file - echo "*** npx playwright test --config=./configs/${conf_name}.config.js ${TAGS} --project=${app_name} ***" - npx playwright test --config=./configs/${conf_name}.config.js ${TAGS} --project=${app_name}-chrome ${REPORTER} - npx playwright test --config=./configs/${conf_name}.config.js ${TAGS} --project=${app_name}-firefox ${REPORTER} - # npx playwright test --config=./configs/${conf_name}.config.js ${TAGS} --project=${app_name}-webkit ${REPORTER} + echo "*** npx playwright test --config=./configs/${conf_name}.config.js ${TAGS} ${EXCLUDE_TAGS} --project=${app_name} ***" + npx playwright test --config=./configs/${conf_name}.config.js ${TAGS} ${EXCLUDE_TAGS} --project=${app_name}-chrome ${REPORTER} + npx playwright test --config=./configs/${conf_name}.config.js ${TAGS} ${EXCLUDE_TAGS} --project=${app_name}-firefox ${REPORTER} + # npx playwright test --config=./configs/${conf_name}.config.js ${TAGS} ${EXCLUDE_TAGS} --project=${app_name}-webkit ${REPORTER} else # Run all the projects from config file for all projects - echo "*** npx playwright test --config="$config_file" ${TAGS} ${REPORTER} ***" - npx playwright test --config="$config_file" ${TAGS} ${REPORTER} + echo "*** npx playwright test --config="$config_file" ${TAGS} ${EXCLUDE_TAGS} ${REPORTER} ***" + npx playwright test --config="$config_file" ${TAGS} ${EXCLUDE_TAGS} ${REPORTER} fi fi done else - npx playwright test ${TAGS} ${REPORTER} + npx playwright test ${TAGS} ${EXCLUDE_TAGS} ${REPORTER} fi \ No newline at end of file diff --git a/tests/milo/marquee.block.test.js b/tests/milo/marquee.block.test.js index 5afa8a5a..5d1e5932 100644 --- a/tests/milo/marquee.block.test.js +++ b/tests/milo/marquee.block.test.js @@ -13,6 +13,7 @@ const knownConsoleErrors = [ 'Failed to load resource: net::ERR_FAILED', 'adobeid-na1-stg1.services', 'Attestation check for Topics', + 'Access to fetch at', ]; test.describe('Milo Marquee Block test suite', () => {