mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
CI - Ability to run only e2e cloud in case is the only affected folder (#4783)
* Remove skiplint option in favour of lint Refactor protractor config * Move rebase check * Remove the skiplint and run only e2e cloud * Remove the skip lint * Change e2e cloud and check the CI runs only that one * Enable the smart e2e on content * Delegate the e2e run on the specific project * Fix typo on specs option * Add basic readme and fix process service name problem * Fix bash else if
This commit is contained in:
committed by
Eugenio Romano
parent
6897f20954
commit
f6d8bd4130
@@ -13,7 +13,6 @@ show_help() {
|
||||
}
|
||||
|
||||
gnu_mode() {
|
||||
echo "====== GNU MODE ====="
|
||||
GNU=true
|
||||
}
|
||||
|
||||
@@ -42,9 +41,6 @@ then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
#check if branch needs to be updated
|
||||
./scripts/check-branch-updated.sh -b $BRANCH_NAME || exit 1;
|
||||
|
||||
# tmp folder doesn't exist.
|
||||
if [ ! -d "$DIRECTORY" ]; then
|
||||
#find affected libs
|
||||
@@ -58,7 +54,7 @@ if [ ! -f $DIRECTORY/deps.txt ]; then
|
||||
npm run affected:libs -- $HEAD_SHA_BRANCH "HEAD" > $DIRECTORY/deps.txt
|
||||
fi
|
||||
|
||||
cat $DIRECTORY/deps.txt
|
||||
#cat $DIRECTORY/deps.txt
|
||||
#echo "extensions" > deps.txt
|
||||
|
||||
#clean file
|
||||
@@ -135,4 +131,4 @@ do
|
||||
fi
|
||||
done
|
||||
|
||||
echo "AFFECTED LIBS => ${AFFECTED_LIBS}"
|
||||
echo "${AFFECTED_LIBS}"
|
||||
|
@@ -4,7 +4,7 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
cd "$DIR/../"
|
||||
BROWSER_RUN=false
|
||||
DEVELOPMENT=false
|
||||
EXECLINT=true
|
||||
EXECLINT=false
|
||||
LITESERVER=false
|
||||
EXEC_VERSION_JSAPI=false
|
||||
TIMEOUT=15000
|
||||
@@ -29,7 +29,7 @@ show_help() {
|
||||
echo "-host_sso the entire path including the name of the realm"
|
||||
echo "-save save the error screenshot in the remote env"
|
||||
echo "-timeout or --timeout override the timeout foe the wait utils"
|
||||
echo "-sl --skip-lint skip lint"
|
||||
echo "-l --lint enable lint"
|
||||
echo "-m --maxInstances max instances parallel for tests"
|
||||
echo "-disable-control-flow disable control flow"
|
||||
echo "-db or --debug run the debugger"
|
||||
@@ -69,9 +69,9 @@ set_host_identity(){
|
||||
export URL_HOST_IDENTITY=$HOST_IDENTITY
|
||||
}
|
||||
|
||||
set_test(){
|
||||
SINGLE_TEST=true
|
||||
NAME_TEST=$1
|
||||
set_specs(){
|
||||
LIST_SPECS=$1
|
||||
export LIST_SPECS=$LIST_SPECS
|
||||
}
|
||||
|
||||
set_browser(){
|
||||
@@ -99,14 +99,15 @@ set_development(){
|
||||
|
||||
set_test_folder(){
|
||||
FOLDER=$1
|
||||
export FOLDER=$FOLDER
|
||||
}
|
||||
|
||||
set_selenium(){
|
||||
SELENIUM_SERVER=$1
|
||||
}
|
||||
|
||||
skip_lint(){
|
||||
EXECLINT=false
|
||||
lint(){
|
||||
EXECLINT=true
|
||||
}
|
||||
|
||||
debug(){
|
||||
@@ -148,7 +149,7 @@ while [[ $1 == -* ]]; do
|
||||
-timeout|--timeout) set_timeout $2; shift 2;;
|
||||
-b|--browser) set_browser; shift;;
|
||||
-dev|--dev) set_development; shift;;
|
||||
-s|--spec) set_test $2; shift 2;;
|
||||
-s|--specs) set_specs $2; shift 2;;
|
||||
-db|--debug) debug; shift;;
|
||||
-ud|--use-dist) lite_server; shift;;
|
||||
-save) set_save_screenshot; shift;;
|
||||
@@ -158,7 +159,7 @@ while [[ $1 == -* ]]; do
|
||||
-host_bpm|--host_bpm) set_host_bpm $2; shift 2;;
|
||||
-host_sso|--host_sso) set_host_sso $2; shift 2;;
|
||||
-host_identity|--host_identity) set_host_identity $2; shift 2;;
|
||||
-sl|--skip-lint) skip_lint; shift;;
|
||||
-l|--lint) lint; shift;;
|
||||
-m|--maxInstances) max_instances $2; shift 2;;
|
||||
-vjsapi) version_js_api $2; shift 2;;
|
||||
-disable-control-flow|--disable-control-flow) disable_control_flow; shift;;
|
||||
@@ -171,9 +172,9 @@ rm -rf ./e2e-output/screenshots/
|
||||
|
||||
export SAVE_SCREENSHOT=$SAVE_SCREENSHOT
|
||||
export TIMEOUT=$TIMEOUT
|
||||
export FOLDER=$FOLDER'/'
|
||||
|
||||
export SELENIUM_SERVER=$SELENIUM_SERVER
|
||||
export NAME_TEST=$NAME_TEST
|
||||
|
||||
export MAXINSTANCES=$MAXINSTANCES
|
||||
export SELENIUM_PROMISE_MANAGER=$SELENIUM_PROMISE_MANAGER
|
||||
|
||||
|
@@ -4,10 +4,26 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
cd $DIR/../../../
|
||||
|
||||
AFFECTED_E2E="$(./scripts/affected-folder.sh -b $TRAVIS_BRANCH -f "e2e")";
|
||||
CONTEXT_ENV="content-services"
|
||||
./scripts/check-branch-updated.sh -b $TRAVIS_BRANCH || exit 1;
|
||||
AFFECTED_LIBS="$(./scripts/affected-libs.sh -gnu -b $TRAVIS_BRANCH)";
|
||||
if [[ $AFFECTED_LIBS =~ "content-services$" || $AFFECTED_E2E = "e2e" || $TRAVIS_PULL_REQUEST == "false" ]];
|
||||
AFFECTED_E2E="$(./scripts/affected-folder.sh -b $TRAVIS_BRANCH -f "e2e/$CONTEXT_ENV")";
|
||||
|
||||
RUN_CHECK=$(echo node ./scripts/check-env/check-cs-env.js --host "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" || exit 1)
|
||||
RUN_E2E=$(echo ./scripts/test-e2e-lib.sh -host http://localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e "$E2E_EMAIL" --use-dist -b || exit 1)
|
||||
if [[ $AFFECTED_LIBS =~ "$CONTEXT_ENV$" || $TRAVIS_PULL_REQUEST == "false" ]];
|
||||
then
|
||||
node ./scripts/check-env/check-cs-env.js --host "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" || exit 1;
|
||||
./scripts/test-e2e-lib.sh -host http://localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e "$E2E_EMAIL" --folder content-services --skip-lint --use-dist -b || exit 1;
|
||||
$RUN_CHECK
|
||||
$RUN_E2E --folder $CONTEXT_ENV
|
||||
else if [[ $AFFECTED_E2E = "e2e/$CONTEXT_ENV" ]];
|
||||
then
|
||||
HEAD_SHA_BRANCH="$(git merge-base origin/$TRAVIS_BRANCH HEAD)"
|
||||
LIST_SPECS="$(git diff --name-only $HEAD_SHA_BRANCH HEAD | grep "^e2e/$CONTEXT_ENV" | paste -sd , -)"
|
||||
if [[ $LIST_SPECS != "" ]];
|
||||
then
|
||||
echo "Run $CONTEXT_ENV e2e based on the sha $HEAD_SHA_BRANCH with the specs: "$LIST_SPECS
|
||||
$RUN_CHECK
|
||||
$RUN_E2E --specs "$LIST_SPECS"
|
||||
fi
|
||||
fi
|
||||
fi;
|
||||
|
@@ -4,11 +4,30 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
cd $DIR/../../../
|
||||
|
||||
AFFECTED_E2E="$(./scripts/affected-folder.sh -b $TRAVIS_BRANCH -f "e2e")";
|
||||
CONTEXT_ENV="core"
|
||||
./scripts/check-branch-updated.sh -b $TRAVIS_BRANCH || exit 1;
|
||||
AFFECTED_LIBS="$(./scripts/affected-libs.sh -gnu -b $TRAVIS_BRANCH)";
|
||||
if [[ $AFFECTED_LIBS =~ "core$" || $AFFECTED_E2E = "e2e" || $TRAVIS_PULL_REQUEST == "false" ]];
|
||||
AFFECTED_E2E="$(./scripts/affected-folder.sh -b $TRAVIS_BRANCH -f "e2e/$CONTEXT_ENV")";
|
||||
|
||||
RUN_CHECK_PS=$(echo node ./scripts/check-env/check-ps-env.js --host "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" || exit 1 )
|
||||
RUN_CHECK_CS=$(echo node ./scripts/check-env/check-cs-env.js --host "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" || exit 1 )
|
||||
RUN_E2E=$(echo ./scripts/test-e2e-lib.sh -host http://localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e "$E2E_EMAIL" -save --use-dist -b )
|
||||
|
||||
|
||||
if [[ $AFFECTED_LIBS =~ "$CONTEXT_ENV$" || $TRAVIS_PULL_REQUEST == "false" ]];
|
||||
then
|
||||
node ./scripts/check-env/check-ps-env.js --host "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" || exit 1;
|
||||
node ./scripts/check-env/check-cs-env.js --host "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" || exit 1;
|
||||
./scripts/test-e2e-lib.sh -host http://localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e "$E2E_EMAIL" --folder core --skip-lint -save --use-dist -b || exit 1;
|
||||
$RUN_CHECK_PS
|
||||
$RUN_CHECK_CS
|
||||
$RUN_E2E --folder $CONTEXT_ENV
|
||||
else if [[ $AFFECTED_E2E = "e2e/$CONTEXT_ENV" ]];
|
||||
then
|
||||
HEAD_SHA_BRANCH="$(git merge-base origin/$TRAVIS_BRANCH HEAD)"
|
||||
LIST_SPECS="$(git diff --name-only $HEAD_SHA_BRANCH HEAD | grep "^e2e/$CONTEXT_ENV" | paste -sd , -)"
|
||||
if [[ $LIST_SPECS != "" ]];
|
||||
then
|
||||
echo "Run $CONTEXT_ENV e2e based on the sha $HEAD_SHA_BRANCH with the specs: "$LIST_SPECS
|
||||
$RUN_CHECK
|
||||
$RUN_E2E --specs "$LIST_SPECS"
|
||||
fi
|
||||
fi
|
||||
fi;
|
||||
|
@@ -4,10 +4,10 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
cd $DIR/../../../
|
||||
|
||||
AFFECTED_E2E="$(./scripts/affected-folder.sh -b $TRAVIS_BRANCH -f "e2e")";
|
||||
./scripts/check-branch-updated.sh -b $TRAVIS_BRANCH || exit 1;
|
||||
AFFECTED_LIBS="$(./scripts/affected-libs.sh -gnu -b $TRAVIS_BRANCH)";
|
||||
if [[ $AFFECTED_LIBS =~ "process-services-cloud$" || $AFFECTED_E2E = "e2e" || $TRAVIS_PULL_REQUEST == "false" ]];
|
||||
if [[ $AFFECTED_LIBS =~ "process-services-cloud$" || $TRAVIS_PULL_REQUEST == "false" ]];
|
||||
then
|
||||
node ./scripts/check-env/check-ps-env.js --host "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" || exit 1;
|
||||
./scripts/test-e2e-lib.sh -host http://localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e "$E2E_EMAIL" --folder insights --skip-lint --use-dist || exit 1;
|
||||
./scripts/test-e2e-lib.sh -host http://localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e "$E2E_EMAIL" --folder insights --use-dist || exit 1;
|
||||
fi;
|
||||
|
@@ -4,10 +4,27 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
cd $DIR/../../../
|
||||
|
||||
AFFECTED_E2E="$(./scripts/affected-folder.sh -b $TRAVIS_BRANCH -f "e2e")";
|
||||
CONTEXT_ENV="process-services-cloud"
|
||||
./scripts/check-branch-updated.sh -b $TRAVIS_BRANCH || exit 1;
|
||||
AFFECTED_LIBS="$(./scripts/affected-libs.sh -gnu -b $TRAVIS_BRANCH)";
|
||||
if [[ $AFFECTED_LIBS =~ "process-services-cloud$" || $AFFECTED_E2E = "e2e" || $TRAVIS_PULL_REQUEST == "false" ]];
|
||||
AFFECTED_E2E="$(./scripts/affected-folder.sh -b $TRAVIS_BRANCH -f "e2e/$CONTEXT_ENV")";
|
||||
|
||||
RUN_CHECK=$(echo node ./scripts/check-env/check-activiti-env.js --host "$E2E_HOST_BPM" --oauth "$E2E_HOST_SSO" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" --client 'activiti' || exit 1 )
|
||||
RUN_E2E=$(echo ./scripts/test-e2e-lib.sh -host http://localhost:4200 -proxy "$E2E_HOST_BPM" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e "$E2E_EMAIL" -host_sso "$E2E_HOST_SSO" -host_bpm "$E2E_HOST_BPM" -host_identity "$E2E_HOST_IDENTITY" --use-dist )
|
||||
|
||||
if [[ $AFFECTED_LIBS =~ "$CONTEXT_ENV$" || $TRAVIS_PULL_REQUEST == "false" ]];
|
||||
then
|
||||
node ./scripts/check-env/check-activiti-env.js --host "$E2E_HOST_BPM" --oauth "$E2E_HOST_SSO" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" --client 'activiti' || exit 1;
|
||||
./scripts/test-e2e-lib.sh -host http://localhost:4200 -proxy "$E2E_HOST_BPM" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e "$E2E_EMAIL" -host_sso "$E2E_HOST_SSO" -host_bpm "$E2E_HOST_BPM" -host_identity "$E2E_HOST_IDENTITY" --folder process-services-cloud --skip-lint --use-dist -b -save || exit 1;
|
||||
$RUN_CHECK
|
||||
$RUN_E2E --folder $CONTEXT_ENV
|
||||
else if [[ $AFFECTED_E2E = "e2e/$CONTEXT_ENV" ]];
|
||||
then
|
||||
HEAD_SHA_BRANCH="$(git merge-base origin/$TRAVIS_BRANCH HEAD)"
|
||||
LIST_SPECS="$(git diff --name-only $HEAD_SHA_BRANCH HEAD | grep "^e2e/$CONTEXT_ENV" | paste -sd , -)"
|
||||
if [[ $LIST_SPECS != "" ]];
|
||||
then
|
||||
echo "Run $CONTEXT_ENV e2e based on the sha $HEAD_SHA_BRANCH with the specs: "$LIST_SPECS
|
||||
$RUN_CHECK
|
||||
$RUN_E2E --specs "$LIST_SPECS"
|
||||
fi
|
||||
fi
|
||||
fi;
|
||||
|
@@ -4,10 +4,27 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
cd $DIR/../../../
|
||||
|
||||
AFFECTED_E2E="$(./scripts/affected-folder.sh -b $TRAVIS_BRANCH -f "e2e")";
|
||||
CONTEXT_ENV="process-services"
|
||||
./scripts/check-branch-updated.sh -b $TRAVIS_BRANCH || exit 1;
|
||||
AFFECTED_LIBS="$(./scripts/affected-libs.sh -gnu -b $TRAVIS_BRANCH)";
|
||||
if [[ $AFFECTED_LIBS =~ "process-services$" || $AFFECTED_E2E = "e2e" || $TRAVIS_PULL_REQUEST == "false" ]];
|
||||
AFFECTED_E2E="$(./scripts/affected-folder.sh -b $TRAVIS_BRANCH -f "e2e/$CONTEXT_ENV/")";
|
||||
|
||||
RUN_CHECK=$(echo node ./scripts/check-env/check-ps-env.js --host "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" || exit 1 )
|
||||
RUN_E2E=$(echo ./scripts/test-e2e-lib.sh -host http://localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e "$E2E_EMAIL" --use-dist -b )
|
||||
|
||||
if [[ $AFFECTED_LIBS =~ "$CONTEXT_ENV$" || $TRAVIS_PULL_REQUEST == "false" ]];
|
||||
then
|
||||
node ./scripts/check-env/check-ps-env.js --host "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" || exit 1;
|
||||
./scripts/test-e2e-lib.sh -host http://localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e "$E2E_EMAIL" --folder process-services --skip-lint --use-dist -b || exit 1;
|
||||
$RUN_CHECK
|
||||
$RUN_E2E --folder $CONTEXT_ENV
|
||||
else if [[ $AFFECTED_E2E = "e2e/$CONTEXT_ENV" ]];
|
||||
then
|
||||
HEAD_SHA_BRANCH="$(git merge-base origin/$TRAVIS_BRANCH HEAD)"
|
||||
LIST_SPECS="$(git diff --name-only $HEAD_SHA_BRANCH HEAD | grep "^e2e/$CONTEXT_ENV" | paste -sd , -)"
|
||||
if [[ $LIST_SPECS != "" ]];
|
||||
then
|
||||
echo "Run $CONTEXT_ENV e2e based on the sha $HEAD_SHA_BRANCH with the specs: "$LIST_SPECS
|
||||
$RUN_CHECK
|
||||
$RUN_E2E --specs "$LIST_SPECS"
|
||||
fi
|
||||
fi
|
||||
fi;
|
||||
|
@@ -4,10 +4,27 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
cd $DIR/../../../
|
||||
|
||||
AFFECTED_E2E="$(./scripts/affected-folder.sh -b $TRAVIS_BRANCH -f "e2e")";
|
||||
CONTEXT_ENV="search"
|
||||
./scripts/check-branch-updated.sh -b $TRAVIS_BRANCH || exit 1;
|
||||
AFFECTED_LIBS="$(./scripts/affected-libs.sh -gnu -b $TRAVIS_BRANCH)";
|
||||
if [[ $AFFECTED_LIBS =~ "content-services$" || $AFFECTED_E2E = "e2e" || $TRAVIS_PULL_REQUEST == "false" ]];
|
||||
AFFECTED_E2E="$(./scripts/affected-folder.sh -b $TRAVIS_BRANCH -f "e2e/$CONTEXT_ENV")";
|
||||
|
||||
RUN_CHECK=$(echo node ./scripts/check-env/check-cs-env.js --host "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" || exit 1 )
|
||||
RUN_E2E=$(echo ./scripts/test-e2e-lib.sh -host http://localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e "$E2E_EMAIL" --use-dist -save -b )
|
||||
|
||||
if [[ $AFFECTED_LIBS =~ "content-services$" || $TRAVIS_PULL_REQUEST == "false" ]];
|
||||
then
|
||||
node ./scripts/check-env/check-cs-env.js --host "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" || exit 1;
|
||||
./scripts/test-e2e-lib.sh -host http://localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e "$E2E_EMAIL" --folder search --skip-lint --use-dist -save -b || exit 1;
|
||||
$RUN_CHECK
|
||||
$RUN_E2E --folder $CONTEXT_ENV
|
||||
else if [[ $AFFECTED_E2E = "e2e/$CONTEXT_ENV" ]];
|
||||
then
|
||||
HEAD_SHA_BRANCH="$(git merge-base origin/$TRAVIS_BRANCH HEAD)"
|
||||
LIST_SPECS="$(git diff --name-only $HEAD_SHA_BRANCH HEAD | grep "^e2e/$CONTEXT_ENV" | paste -sd , -)"
|
||||
if [[ $LIST_SPECS != "" ]];
|
||||
then
|
||||
echo "Run $CONTEXT_ENV e2e based on the sha $HEAD_SHA_BRANCH with the specs: "$LIST_SPECS
|
||||
$RUN_CHECK
|
||||
$RUN_E2E --specs "$LIST_SPECS"
|
||||
fi
|
||||
fi
|
||||
fi;
|
||||
|
Reference in New Issue
Block a user