Short circuit e2e in case lib not affected (#7801)

* Short circuit e2e in case lib not affected

* Use base and head

* Remove useless schema

* Run everything on cron
This commit is contained in:
Maurizio Vitale
2022-08-30 16:07:55 +01:00
committed by GitHub
parent b90b129527
commit 109e99786b
4 changed files with 57 additions and 49 deletions

View File

@@ -183,7 +183,7 @@ jobs:
- stage: "e2e Test" - stage: "e2e Test"
name: "Process Cloud: Storybook Playwright" name: "Process Cloud: Storybook Playwright"
before_script: ./scripts/ci/jobs/dbpci-before-playwright before_script: ./scripts/ci/jobs/dbpci-before-playwright
script: ./scripts/travis/affected-contains.sh "process-services-cloud" && ./scripts/travis/storybook-testing/storybook-test.sh script: ./scripts/travis/storybook-testing/storybook-test.sh
workspaces: workspaces:
use: use:
- built_libs_cache - built_libs_cache
@@ -195,7 +195,7 @@ jobs:
- ./scripts/ci/job_hooks/before_e2e.sh - ./scripts/ci/job_hooks/before_e2e.sh
- ./scripts/ci/check-env/check-cs-env.sh || travis_terminate 1 - ./scripts/ci/check-env/check-cs-env.sh || travis_terminate 1
- ./scripts/ci/check-env/check-ps-env.sh || travis_terminate 1 - ./scripts/ci/check-env/check-ps-env.sh || travis_terminate 1
script: ./scripts/travis/affected-contains.sh "core" && ./scripts/travis/e2e/e2e.sh script: ./scripts/travis/e2e/e2e.sh "core"
after_script: ./scripts/ci/job_hooks/after_e2e.sh after_script: ./scripts/ci/job_hooks/after_e2e.sh
workspaces: workspaces:
create: create:
@@ -216,7 +216,7 @@ jobs:
before_script: before_script:
- ./scripts/ci/job_hooks/before_e2e.sh - ./scripts/ci/job_hooks/before_e2e.sh
- ./scripts/ci/check-env/check-cs-env.sh || travis_terminate 1 - ./scripts/ci/check-env/check-cs-env.sh || travis_terminate 1
script: ./scripts/travis/affected-contains.sh "content-services" && ./scripts/travis/e2e/e2e.sh script: ./scripts/travis/e2e/e2e.sh "content-services"
after_script: ./scripts/ci/job_hooks/after_e2e.sh after_script: ./scripts/ci/job_hooks/after_e2e.sh
workspaces: workspaces:
create: create:
@@ -237,7 +237,7 @@ jobs:
before_script: before_script:
- ./scripts/ci/job_hooks/before_e2e.sh - ./scripts/ci/job_hooks/before_e2e.sh
- ./scripts/ci/check-env/check-cs-env.sh || travis_terminate 1 - ./scripts/ci/check-env/check-cs-env.sh || travis_terminate 1
script: ./scripts/travis/affected-contains.sh "content-services" && ./scripts/travis/e2e/e2e.sh script: ./scripts/travis/e2e/e2e.sh "content-services"
after_script: ./scripts/ci/job_hooks/after_e2e.sh after_script: ./scripts/ci/job_hooks/after_e2e.sh
workspaces: workspaces:
create: create:
@@ -258,7 +258,7 @@ jobs:
before_script: before_script:
- ./scripts/ci/job_hooks/before_e2e.sh - ./scripts/ci/job_hooks/before_e2e.sh
- ./scripts/ci/check-env/check-cs-env.sh || travis_terminate 1 - ./scripts/ci/check-env/check-cs-env.sh || travis_terminate 1
script: ./scripts/travis/affected-contains.sh "content-services" && ./scripts/travis/e2e/e2e.sh script: ./scripts/travis/e2e/e2e.sh "content-services"
after_script: ./scripts/ci/job_hooks/after_e2e.sh after_script: ./scripts/ci/job_hooks/after_e2e.sh
workspaces: workspaces:
create: create:
@@ -279,7 +279,7 @@ jobs:
before_script: before_script:
- ./scripts/ci/job_hooks/before_e2e.sh - ./scripts/ci/job_hooks/before_e2e.sh
- ./scripts/ci/check-env/check-cs-env.sh || travis_terminate 1 - ./scripts/ci/check-env/check-cs-env.sh || travis_terminate 1
script: ./scripts/travis/affected-contains.sh "content-services" && ./scripts/travis/e2e/e2e.sh script: ./scripts/travis/e2e/e2e.sh "content-services"
after_script: ./scripts/ci/job_hooks/after_e2e.sh after_script: ./scripts/ci/job_hooks/after_e2e.sh
workspaces: workspaces:
create: create:
@@ -300,7 +300,7 @@ jobs:
before_script: before_script:
- ./scripts/ci/job_hooks/before_e2e.sh - ./scripts/ci/job_hooks/before_e2e.sh
- ./scripts/ci/check-env/check-cs-env.sh || travis_terminate 1 - ./scripts/ci/check-env/check-cs-env.sh || travis_terminate 1
script: ./scripts/travis/affected-contains.sh "content-services" && ./scripts/travis/e2e/e2e.sh script: ./scripts/travis/e2e/e2e.sh "content-services"
after_script: ./scripts/ci/job_hooks/after_e2e.sh after_script: ./scripts/ci/job_hooks/after_e2e.sh
workspaces: workspaces:
create: create:
@@ -321,7 +321,7 @@ jobs:
before_script: before_script:
- ./scripts/ci/job_hooks/before_e2e.sh - ./scripts/ci/job_hooks/before_e2e.sh
- ./scripts/ci/check-env/check-cs-env.sh || travis_terminate 1 - ./scripts/ci/check-env/check-cs-env.sh || travis_terminate 1
script: ./scripts/travis/affected-contains.sh "content-services" && ./scripts/travis/e2e/e2e.sh script: ./scripts/travis/e2e/e2e.sh "content-services"
after_script: ./scripts/ci/job_hooks/after_e2e.sh after_script: ./scripts/ci/job_hooks/after_e2e.sh
workspaces: workspaces:
create: create:
@@ -343,7 +343,7 @@ jobs:
- ./scripts/ci/job_hooks/before_e2e.sh - ./scripts/ci/job_hooks/before_e2e.sh
- ./scripts/ci/check-env/check-ps-env.sh || travis_terminate 1 - ./scripts/ci/check-env/check-ps-env.sh || travis_terminate 1
- ./scripts/ci/check-env/check-external-cs-env.sh || travis_terminate 1 - ./scripts/ci/check-env/check-external-cs-env.sh || travis_terminate 1
script: ./scripts/travis/affected-contains.sh "process-services" && ./scripts/travis/e2e/e2e.sh script: ./scripts/travis/e2e/e2e.sh "process-services"
after_script: ./scripts/ci/job_hooks/after_e2e.sh after_script: ./scripts/ci/job_hooks/after_e2e.sh
workspaces: workspaces:
create: create:
@@ -365,7 +365,7 @@ jobs:
- ./scripts/ci/job_hooks/before_e2e.sh - ./scripts/ci/job_hooks/before_e2e.sh
- ./scripts/ci/check-env/check-ps-env.sh || travis_terminate 1 - ./scripts/ci/check-env/check-ps-env.sh || travis_terminate 1
- ./scripts/ci/check-env/check-external-cs-env.sh || travis_terminate 1 - ./scripts/ci/check-env/check-external-cs-env.sh || travis_terminate 1
script: ./scripts/travis/affected-contains.sh "process-services" && ./scripts/travis/e2e/e2e.sh script: ./scripts/travis/e2e/e2e.sh "process-services"
after_script: ./scripts/ci/job_hooks/after_e2e.sh after_script: ./scripts/ci/job_hooks/after_e2e.sh
workspaces: workspaces:
create: create:
@@ -387,7 +387,7 @@ jobs:
- ./scripts/ci/job_hooks/before_e2e.sh - ./scripts/ci/job_hooks/before_e2e.sh
- ./scripts/ci/check-env/check-ps-env.sh || travis_terminate 1 - ./scripts/ci/check-env/check-ps-env.sh || travis_terminate 1
- ./scripts/ci/check-env/check-external-cs-env.sh || travis_terminate 1 - ./scripts/ci/check-env/check-external-cs-env.sh || travis_terminate 1
script: ./scripts/travis/affected-contains.sh "process-services" && ./scripts/travis/e2e/e2e.sh script: ./scripts/travis/e2e/e2e.sh "process-services"
after_script: ./scripts/ci/job_hooks/after_e2e.sh after_script: ./scripts/ci/job_hooks/after_e2e.sh
workspaces: workspaces:
create: create:
@@ -409,7 +409,7 @@ jobs:
- ./scripts/ci/job_hooks/before_e2e.sh - ./scripts/ci/job_hooks/before_e2e.sh
- ./scripts/ci/check-env/check-ps-env.sh || travis_terminate 1 - ./scripts/ci/check-env/check-ps-env.sh || travis_terminate 1
- ./scripts/ci/check-env/check-external-cs-env.sh || travis_terminate 1 - ./scripts/ci/check-env/check-external-cs-env.sh || travis_terminate 1
script: ./scripts/travis/affected-contains.sh "process-services" && ./scripts/travis/e2e/e2e.sh script: ./scripts/travis/e2e/e2e.sh "process-services"
after_script: ./scripts/ci/job_hooks/after_e2e.sh after_script: ./scripts/ci/job_hooks/after_e2e.sh
workspaces: workspaces:
create: create:
@@ -431,7 +431,7 @@ jobs:
- ./scripts/ci/job_hooks/before_e2e.sh - ./scripts/ci/job_hooks/before_e2e.sh
- ./scripts/ci/check-env/check-cs-env.sh || travis_terminate 1 - ./scripts/ci/check-env/check-cs-env.sh || travis_terminate 1
- ./scripts/ci/check-env/check-ps-cloud-env.sh || travis_terminate 1 - ./scripts/ci/check-env/check-ps-cloud-env.sh || travis_terminate 1
script: ./scripts/travis/affected-contains.sh "process-services-cloud" && ./scripts/travis/e2e/e2e.sh script: ./scripts/travis/e2e/e2e.sh "process-services-cloud"
after_script: ./scripts/ci/job_hooks/after_e2e.sh after_script: ./scripts/ci/job_hooks/after_e2e.sh
workspaces: workspaces:
create: create:
@@ -454,7 +454,7 @@ jobs:
- ./scripts/ci/job_hooks/before_e2e.sh - ./scripts/ci/job_hooks/before_e2e.sh
- ./scripts/ci/check-env/check-cs-env.sh || travis_terminate 1 - ./scripts/ci/check-env/check-cs-env.sh || travis_terminate 1
- ./scripts/ci/check-env/check-ps-cloud-env.sh || travis_terminate 1 - ./scripts/ci/check-env/check-ps-cloud-env.sh || travis_terminate 1
script: ./scripts/travis/affected-contains.sh "process-services-cloud" && ./scripts/travis/e2e/e2e.sh script: ./scripts/travis/e2e/e2e.sh "process-services-cloud"
after_script: ./scripts/ci/job_hooks/after_e2e.sh after_script: ./scripts/ci/job_hooks/after_e2e.sh
workspaces: workspaces:
create: create:
@@ -477,7 +477,7 @@ jobs:
- ./scripts/ci/job_hooks/before_e2e.sh - ./scripts/ci/job_hooks/before_e2e.sh
- ./scripts/ci/check-env/check-cs-env.sh || travis_terminate 1 - ./scripts/ci/check-env/check-cs-env.sh || travis_terminate 1
- ./scripts/ci/check-env/check-ps-cloud-env.sh || travis_terminate 1 - ./scripts/ci/check-env/check-ps-cloud-env.sh || travis_terminate 1
script: ./scripts/travis/affected-contains.sh "process-services-cloud" && ./scripts/travis/e2e/e2e.sh script: ./scripts/travis/e2e/e2e.sh "process-services-cloud"
after_script: ./scripts/ci/job_hooks/after_e2e.sh after_script: ./scripts/ci/job_hooks/after_e2e.sh
workspaces: workspaces:
create: create:
@@ -500,7 +500,7 @@ jobs:
- ./scripts/ci/job_hooks/before_e2e.sh - ./scripts/ci/job_hooks/before_e2e.sh
- ./scripts/ci/check-env/check-cs-env.sh || travis_terminate 1 - ./scripts/ci/check-env/check-cs-env.sh || travis_terminate 1
- ./scripts/ci/check-env/check-ps-cloud-env.sh || travis_terminate 1 - ./scripts/ci/check-env/check-ps-cloud-env.sh || travis_terminate 1
script: ./scripts/travis/affected-contains.sh "process-services-cloud" && ./scripts/travis/e2e/e2e.sh script: ./scripts/travis/e2e/e2e.sh "process-services-cloud"
after_script: ./scripts/ci/job_hooks/after_e2e.sh after_script: ./scripts/ci/job_hooks/after_e2e.sh
workspaces: workspaces:
create: create:
@@ -523,7 +523,7 @@ jobs:
- ./scripts/ci/job_hooks/before_e2e.sh - ./scripts/ci/job_hooks/before_e2e.sh
- ./scripts/ci/check-env/check-cs-env.sh || travis_terminate 1 - ./scripts/ci/check-env/check-cs-env.sh || travis_terminate 1
- ./scripts/ci/check-env/check-ps-cloud-env.sh || travis_terminate 1 - ./scripts/ci/check-env/check-ps-cloud-env.sh || travis_terminate 1
script: ./scripts/travis/affected-contains.sh "process-services-cloud" && ./scripts/travis/e2e/e2e.sh script: ./scripts/travis/e2e/e2e.sh "process-services-cloud"
after_script: ./scripts/ci/job_hooks/after_e2e.sh after_script: ./scripts/ci/job_hooks/after_e2e.sh
workspaces: workspaces:
create: create:

View File

@@ -23,7 +23,4 @@ echo "====== Run testing ====="
echo "====== Run Cli =====" echo "====== Run Cli ====="
./scripts/build/build-cli.sh || exit 1 ./scripts/build/build-cli.sh || exit 1
echo "====== Copy schema ====="
cp lib/core/src/lib/app-config/schema.json dist/libs/core/app.config.schema.json

View File

@@ -5,18 +5,18 @@ verifyLib=$1;
cd $DIR/../../ cd $DIR/../../
if [ "${TRAVIS_EVENT_TYPE}" == "cron" ]; then if [ "${TRAVIS_EVENT_TYPE}" == "cron" ]; then
echo "Affected not check in case of cron" #echo "Affected not check in case of cron"
exit 0 echo true
fi fi
AFFECTED_LIBS="$(nx print-affected --type=lib --select=projects --base=$BASE_HASH --head=$HEAD_HASH --plain || exit 1)" AFFECTED_LIBS="$(nx print-affected --type=lib --select=projects --base=$BASE_HASH --head=$HEAD_HASH --plain)"
echo "Verify if affected build contains $1" #echo "Verify if affected build contains $1"
echo "Affected libs:$AFFECTED_LIBS" #echo "Affected libs:$AFFECTED_LIBS"
if [[ $AFFECTED_LIBS =~ $verifyLib ]]; then if [[ $AFFECTED_LIBS =~ $verifyLib ]]; then
echo "Yep project:$verifyLib is affected carry on" #echo "Yep project:$verifyLib is affected carry on"
exit 0 echo true
else else
echo "Nope project NOT affected save time" #echo "Nope project NOT affected save time"
exit 1 echo false
fi; fi;

View File

@@ -7,6 +7,12 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DIR/../../../ cd $DIR/../../../
BASE_DIRECTORY=$(echo "$FOLDER" | cut -d "/" -f1) BASE_DIRECTORY=$(echo "$FOLDER" | cut -d "/" -f1)
verifyLib=$1;
echo "Step1 - Verify if affected libs contains $verifyLib"
AFFECTED_LIB="$(./scripts/travis/affected-contains.sh $verifyLib )";
if [ ${AFFECTED_LIB} == true ]; then
echo "Step2 - $verifyLib affected... will execute e2e"
if [ "${TRAVIS_EVENT_TYPE}" == "pull_request" ]; then if [ "${TRAVIS_EVENT_TYPE}" == "pull_request" ]; then
echo "Calculate affected e2e $BASE_HASH $HEAD_HASH" echo "Calculate affected e2e $BASE_HASH $HEAD_HASH"
@@ -33,3 +39,8 @@ else if [[ $AFFECTED_E2E == "e2e/$FOLDER" ]]; then
fi fi
fi fi
fi; fi;
else
echo "Step2 - Lib $verifyLib NOT affected. No need to run e2e"
fi
exit 0