group test (#1890)

This commit is contained in:
Eugenio Romano 2017-05-22 14:02:58 +01:00 committed by Eugenio Romano
parent 59021ae9d2
commit 0e153c47ef
4 changed files with 49 additions and 23 deletions

View File

@ -10,11 +10,12 @@ before_install:
env:
matrix:
- MODULE=ng2-components
- MODULE=ng2-components-alfresco
- MODULE=ng2-components-activiti
- MODULE=ng2-demo-shell
install:
- if ([ "$MODULE" == "ng2-components" ]); then
- if ([ "$MODULE" == "ng2-components-alfresco" -o "$MODULE" == "ng2-components-activiti" ]); then
if ([ "$TRAVIS_BRANCH" = "master" ]); then
(./scripts/npm-build-all.sh || exit 1;);
else
@ -23,8 +24,11 @@ install:
fi
script:
- if ([ "$MODULE" == "ng2-components" ]); then
(./scripts/npm-build-all.sh -si -sb -t || exit 1;);
- if ([ "$MODULE" == "ng2-components-activiti" ]); then
(./scripts/npm-build-all.sh -si -sb -t "ng2-activiti*" || exit 1;);
fi
- if ([ "$MODULE" == "ng2-components-alfresco" ]); then
(./scripts/npm-build-all.sh -si -sb -t "ng2-alfresco*" || exit 1;);
fi
- if ([ "$MODULE" == "ng2-demo-shell" ]); then
if ([ "$TRAVIS_BRANCH" = "master" ]); then

View File

@ -144,7 +144,7 @@ The default behaviour of the ***npm-build-all.sh*** install node_modules and bui
| Option | Description |
| --- | --- |
| -h or --help | show the help |
| -t or --test | If you want run the test: |
| -t or --test | If you want run the test, this parameter accept also a wildecard to execute test for example -t "ng2-alfresco-core" |
| -c or --clean | clean the ng2_components folders before to start from all the temp builds file as node_modules |
| -gitjsapi | if you want start the demo shell using an alfresco-js-api referenced by commit-ish version of the JS-API |
| -si or --skipinstall | skip the install of the node_modules |

View File

@ -6,8 +6,10 @@ eval EXEC_FAST_TEST=false
eval EXEC_CLEAN=false
eval EXEC_BUILD=true
eval EXEC_INSTALL=true
eval EXEC_SINGLE_TEST=false
eval EXEC_GIT_NPM_INSTALL_JSAPI=false
eval GIT_ISH=""
eval SINGLE_TEST=""
eval projects=( "ng2-alfresco-core"
"ng2-alfresco-datatable"
@ -30,7 +32,7 @@ eval projects=( "ng2-alfresco-core"
show_help() {
echo "Usage: npm-build-all.sh"
echo ""
echo "-t or -test build all your local component and run also the test on them"
echo "-t or -test build all your local component and run also the test on them , this parameter accept also a wildecard to execute test for example -t "ng2-alfresco-core" "
echo "-c or -clean the node_modules folder before to start the build"
echo "-si or -skipinstall skip the install node_modules folder before to start the build"
echo "-sb or skip build"
@ -39,6 +41,12 @@ show_help() {
}
enable_test(){
if [[ ! -z $1 ]]; then
if [[ $1 != "-"* ]]; then
EXEC_SINGLE_TEST=true
SINGLE_TEST=$1
fi
fi
RUN_TEST=true
}
@ -71,7 +79,12 @@ exec_install(){
while [[ $1 == -* ]]; do
case "$1" in
-h|--help|-\?) show_help; exit 0;;
-t|--test) enable_test; shift;;
-t|--test) enable_test $2;
shift;
if $EXEC_SINGLE_TEST == true; then
shift;
fi
;;
-ft|--fasttest) enable_fast_test; shift;;
-gitjsapi) enable_js_api_git_link $2; shift 2;;
-c|--clean) clean; shift;;
@ -89,11 +102,10 @@ if $EXEC_CLEAN == true; then
npm run clean
fi
echo "====== Regenerate global ng2-components package.json ====="
npm install package-json-merge
npm run pkg-build
if $EXEC_INSTALL == true; then
echo "====== Regenerate global ng2-components package.json ====="
npm install package-json-merge
npm run pkg-build
echo "====== Install ng2-components dependencies ====="
npm install
fi
@ -116,11 +128,20 @@ if $EXEC_FAST_TEST == true; then
npm run test || exit 1
fi
for PACKAGE in ${projects[@]}
do
if $RUN_TEST == true; then
for PACKAGE in ${projects[@]}
do
DESTDIR="$DIR/../ng2-components/"
cd $DESTDIR
if $RUN_TEST == true; then
if $EXEC_SINGLE_TEST == true; then
if [[ $PACKAGE == $SINGLE_TEST ]]; then
test_project $SINGLE_TEST
fi
else
test_project $PACKAGE
fi
done
done
fi

View File

@ -106,6 +106,11 @@ do
DESTDIR="$DIR/../ng2-components/${PACKAGE}"
echo "====== MOVE DIR: ${DESTDIR} ===== "
cd ${DESTDIR}
if $EXEC_CHANGE_REGISTRY == true; then
change_registry
fi
echo "====== INSTALL AND CLEAN ${PACKAGE} ===== "
npm install rimraf
npm run clean
@ -119,10 +124,6 @@ do
cd ${DESTDIR}
fi
if $EXEC_CHANGE_REGISTRY == true; then
change_registry
fi
echo "====== PUBLISHING: ${DESTDIR} ===== npm publish ${OPTIONS}"
npm publish ${OPTIONS} || exit 1