Commit 8e4940bf authored by eric pellegrini's avatar eric pellegrini
Browse files

Merge branch 'feature-functional_tests_enhancing' into 'develop'

Feature functional tests enhancing

See merge request !8
parents 850a86b0 74c401fa
Pipeline #3435 failed with stages
in 17 minutes and 49 seconds
stages: stages:
- build - ci
- test
- deploy - deploy
# trusty pipeline # trusty pipeline
build:trusty: ci:trusty:
stage: build stage: ci
script: script:
- ./BuildServer/Debian/run_build.sh - ./BuildServer/Debian/run_build.sh
- ./BuildServer/Debian/run_tests.sh
allow_failure: false allow_failure: false
only: only:
- triggers - triggers
...@@ -24,24 +24,6 @@ build:trusty: ...@@ -24,24 +24,6 @@ build:trusty:
tags: tags:
- ubuntu14.04 - ubuntu14.04
test:trusty:
stage: test
script:
- ./BuildServer/Debian/run_tests.sh
allow_failure: false
only:
- triggers
- tags
- /^feature-.*$/
- /^release-.*$/
- /^hotfix-.*$/
- /^bugfix-.*$/
- develop
dependencies:
- build:trusty
tags:
- ubuntu14.04
deploy:trusty: deploy:trusty:
stage: deploy stage: deploy
script: script:
...@@ -50,6 +32,8 @@ deploy:trusty: ...@@ -50,6 +32,8 @@ deploy:trusty:
- triggers - triggers
- tags - tags
- develop - develop
dependencies:
- ci:trusty
when: on_success when: on_success
artifacts: artifacts:
paths: paths:
...@@ -59,10 +43,11 @@ deploy:trusty: ...@@ -59,10 +43,11 @@ deploy:trusty:
# osx pipeline # osx pipeline
build:osx: ci:osx:
stage: build stage: ci
script: script:
- ./BuildServer/Darwin/Scripts/run_build.sh - ./BuildServer/Darwin/Scripts/run_build.sh
- ./BuildServer/Darwin/Scripts/run_tests.sh
allow_failure: false allow_failure: false
only: only:
- triggers - triggers
...@@ -79,24 +64,6 @@ build:osx: ...@@ -79,24 +64,6 @@ build:osx:
tags: tags:
- macmini2 - macmini2
test:osx:
stage: test
script:
- ./BuildServer/Darwin/Scripts/run_tests.sh
allow_failure: false
only:
- triggers
- tags
- /^feature-.*$/
- /^release-.*$/
- /^hotfix-.*$/
- /^bugfix-.*$/
- develop
dependencies:
- build:osx
tags:
- macmini2
deploy:osx: deploy:osx:
stage: deploy stage: deploy
script: script:
...@@ -105,6 +72,8 @@ deploy:osx: ...@@ -105,6 +72,8 @@ deploy:osx:
- triggers - triggers
- tags - tags
- develop - develop
dependencies:
- ci:osx
when: on_success when: on_success
artifacts: artifacts:
paths: paths:
...@@ -112,14 +81,17 @@ deploy:osx: ...@@ -112,14 +81,17 @@ deploy:osx:
tags: tags:
- macmini2 - macmini2
# # windows 7 pipeline # windows 7 pipeline
build:windows: ci:windows:
stage: build stage: ci
script: script:
- c:\cygwin64\bin\bash -c "dos2unix.exe ./BuildServer/Windows/run_build.sh" - c:\cygwin64\bin\bash -c "dos2unix.exe ./BuildServer/Windows/run_build.sh"
- c:\cygwin64\bin\bash -c "chmod a+x ./BuildServer/Windows/run_build.sh" - c:\cygwin64\bin\bash -c "chmod a+x ./BuildServer/Windows/run_build.sh"
- c:\cygwin64\bin\bash -c "./BuildServer/Windows/run_build.sh" - c:\cygwin64\bin\bash -c "./BuildServer/Windows/run_build.sh"
- c:\cygwin64\bin\bash -c "dos2unix.exe ./BuildServer/Windows/run_tests.sh"
- c:\cygwin64\bin\bash -c "chmod a+x ./BuildServer/Windows/run_tests.sh"
- c:\cygwin64\bin\bash -c "./BuildServer/Windows/run_tests.sh"
allow_failure: false allow_failure: false
only: only:
- triggers - triggers
...@@ -136,26 +108,6 @@ build:windows: ...@@ -136,26 +108,6 @@ build:windows:
tags: tags:
- windows - windows
test:windows:
stage: test
script:
- c:\cygwin64\bin\bash -c "dos2unix.exe ./BuildServer/Windows/run_tests.sh"
- c:\cygwin64\bin\bash -c "chmod a+x ./BuildServer/Windows/run_tests.sh"
- c:\cygwin64\bin\bash -c "./BuildServer/Windows/run_tests.sh"
allow_failure: false
only:
- triggers
- tags
- /^feature-.*$/
- /^release-.*$/
- /^hotfix-.*$/
- /^bugfix-.*$/
- develop
dependencies:
- build:windows
tags:
- windows
deploy:windows: deploy:windows:
stage: deploy stage: deploy
script: script:
...@@ -166,6 +118,8 @@ deploy:windows: ...@@ -166,6 +118,8 @@ deploy:windows:
- triggers - triggers
- tags - tags
- develop - develop
dependencies:
- ci:windows
when: on_success when: on_success
artifacts: artifacts:
paths: paths:
......
...@@ -12,7 +12,6 @@ BLEU="\\033[1;34m" ...@@ -12,7 +12,6 @@ BLEU="\\033[1;34m"
##Select the build target ##Select the build target
# take the latest version of nmoldyn available on the forge # take the latest version of nmoldyn available on the forge
echo -e "$BLEU""Getting last MDANSE revision" "$NORMAL" echo -e "$BLEU""Getting last MDANSE revision" "$NORMAL"
...@@ -37,4 +36,10 @@ rm -rf /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pack ...@@ -37,4 +36,10 @@ rm -rf /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pack
# Build and install MDANSE to the homebrewed python # Build and install MDANSE to the homebrewed python
/Library/Frameworks/Python.framework/Versions/2.7/bin/python setup.py build >> BuildServer/Darwin/Scripts/build_log.txt 2>&1 /Library/Frameworks/Python.framework/Versions/2.7/bin/python setup.py build >> BuildServer/Darwin/Scripts/build_log.txt 2>&1
/Library/Frameworks/Python.framework/Versions/2.7/bin/python setup.py install >> BuildServer/Darwin/Scripts/build_log.txt 2>&1 status=$?
if [ $status -ne 0 ]; then
echo -e "$ROUGE" "Failed to build MDANSE" "$NORMAL"
exit $status
fi
exit 0
\ No newline at end of file
...@@ -38,10 +38,10 @@ cd BuildServer/Darwin/Scripts ...@@ -38,10 +38,10 @@ cd BuildServer/Darwin/Scripts
/usr/local/bin/python build.py py2app /usr/local/bin/python build.py py2app
rc=$? status=$?
if [[ $rc != 0 ]]; then if [[ $status != 0 ]]; then
echo -e "$ROUGE""Cannot build app." "$NORMAL" echo -e "$ROUGE""Cannot build app." "$NORMAL"
exit 1 exit $status
fi fi
cd ../Build cd ../Build
...@@ -84,4 +84,4 @@ chmod 777 ../Scripts/change_dylib_path.sh ...@@ -84,4 +84,4 @@ chmod 777 ../Scripts/change_dylib_path.sh
../Tools/create-dmg/create-dmg --background "../Resources/background.jpg" --volname "MDANSE" --window-pos 200 120 --window-size 800 400 --icon MDANSE.app 200 190 --hide-extension MDANSE.app --app-drop-link 600 185 "${MDANSE_DMG}" ./dist ../Tools/create-dmg/create-dmg --background "../Resources/background.jpg" --volname "MDANSE" --window-pos 200 120 --window-size 800 400 --icon MDANSE.app 200 190 --hide-extension MDANSE.app --app-drop-link 600 185 "${MDANSE_DMG}" ./dist
exit exit 0
...@@ -2,23 +2,31 @@ ...@@ -2,23 +2,31 @@
ROUGE="\\033[1;31m" ROUGE="\\033[1;31m"
cd $CI_PROJECT_DIR
export PYTHONPATH=${CI_PROJECT_DIR}/build/lib.macosx-10.6-intel-2.7
# Performs the unit tests # Performs the unit tests
cd Tests/UnitTests cd Tests/UnitTests
/Library/Frameworks/Python.framework/Versions/2.7/bin/nosetests --verbosity=3 -P . /Library/Frameworks/Python.framework/Versions/2.7/bin/nosetests --verbosity=3 -P .
# Exit now if unable to run tests # Exit now if unable to run tests
if [ $? -ne 0 ]; then status=$?
status = $? if [ $status -ne 0 ]; then
echo -e "$ROUGE""One or several unit tests failed" echo -e "$ROUGE""One or several unit tests failed"
exit status exit $status
fi fi
cd ../.. cd ../..
# Performs the functional tests
cd Tests/FunctionalTests/Jobs cd Tests/FunctionalTests/Jobs
rm -rf Test_*
/Library/Frameworks/Python.framework/Versions/2.7/bin/python BuildJobTests.py /Library/Frameworks/Python.framework/Versions/2.7/bin/python BuildJobTests.py
/Library/Frameworks/Python.framework/Versions/2.7/bin/nosetests --verbosity=3 --exe -P . /Library/Frameworks/Python.framework/Versions/2.7/bin/nosetests --verbosity=3 --exe Test_*.py
if [ $? -ne 0 ]; then
status=$? status=$?
if [ $status -ne 0 ]; then
echo -e "$ROUGE""One or several functional tests failed" echo -e "$ROUGE""One or several functional tests failed"
exit status exit $status
fi fi
cd ../../..
exit 0
\ No newline at end of file
...@@ -24,3 +24,10 @@ echo -e "$BLEU""Commit id = ${COMMIT_ID}<--" "$NORMAL" ...@@ -24,3 +24,10 @@ echo -e "$BLEU""Commit id = ${COMMIT_ID}<--" "$NORMAL"
echo "$BLEU""Building MDANSE" "$NORMAL" echo "$BLEU""Building MDANSE" "$NORMAL"
python setup.py build python setup.py build
status=$?
if [ $status -ne 0 ]; then
echo "Failed to build MDANSE"
exit $status
fi
exit 0
\ No newline at end of file
...@@ -71,3 +71,5 @@ sed -i "s/Installed-Size:.*/Installed-Size: $((1+(instSize/1024)))/g" ${DEBIAN_R ...@@ -71,3 +71,5 @@ sed -i "s/Installed-Size:.*/Installed-Size: $((1+(instSize/1024)))/g" ${DEBIAN_R
export TMPDIR=. export TMPDIR=.
fakeroot dpkg-deb -b ${DEBIAN_ROOT_DIR} ${DEBIAN_ROOT_DIR}/MDANSE-${VERSION_NAME}-${DISTRO}-${ARCH}.deb fakeroot dpkg-deb -b ${DEBIAN_ROOT_DIR} ${DEBIAN_ROOT_DIR}/MDANSE-${VERSION_NAME}-${DISTRO}-${ARCH}.deb
exit 0
\ No newline at end of file
...@@ -10,20 +10,23 @@ export PYTHONPATH=${CI_PROJECT_DIR}/build/lib.linux-x86_64-2.7 ...@@ -10,20 +10,23 @@ export PYTHONPATH=${CI_PROJECT_DIR}/build/lib.linux-x86_64-2.7
cd Tests/UnitTests cd Tests/UnitTests
nosetests --verbosity=3 -P . nosetests --verbosity=3 -P .
# Exit now if unable to run tests # Exit now if unable to run tests
status=$?
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
status = $?
echo -e "$ROUGE""One or several unit tests failed" echo -e "$ROUGE""One or several unit tests failed"
exit status exit $status
fi fi
cd ../.. cd ../..
# Performs the functional tests # Performs the functional tests
cd Tests/FunctionalTests/Jobs cd Tests/FunctionalTests/Jobs
rm -rf Test_*
python BuildJobTests.py python BuildJobTests.py
nosetests --verbosity=3 --exe -P . nosetests --verbosity=3 --exe Test_*.py
if [ $? -ne 0 ]; then
status=$? status=$?
if [ $status -ne 0 ]; then
echo -e "$ROUGE""One or several functional tests failed" echo -e "$ROUGE""One or several functional tests failed"
exit status exit $status
fi fi
exit 0
\ No newline at end of file
...@@ -61,10 +61,10 @@ echo "Extracting python ${PYTHON_MSI_WIN} in ${TARGET_DIR}" ...@@ -61,10 +61,10 @@ echo "Extracting python ${PYTHON_MSI_WIN} in ${TARGET_DIR}"
cmd /c "msiexec /L* pythonlog.txt /qn /a ${PYTHON_MSI_WIN} TARGETDIR=${TARGET_DIR}" cmd /c "msiexec /L* pythonlog.txt /qn /a ${PYTHON_MSI_WIN} TARGETDIR=${TARGET_DIR}"
# Exit now if something goes wrong # Exit now if something goes wrong
if [ $? -ne 0 ]; then status=$?
status=$? if [ $status -ne 0 ]; then
echo "Failed to extract python" echo "Failed to extract python"
exit status exit $status
fi fi
#Clean up python a bit, to keep the package size down #Clean up python a bit, to keep the package size down
...@@ -210,8 +210,10 @@ cd ${SCRIPT_DIR} ...@@ -210,8 +210,10 @@ cd ${SCRIPT_DIR}
cmd /V:ON /E:ON /C "setup_and_build.bat" "${CI_PROJECT_DIR_WIN}" "${TARGET_DIR}" ${MSVC_BUILD_TARGET} cmd /V:ON /E:ON /C "setup_and_build.bat" "${CI_PROJECT_DIR_WIN}" "${TARGET_DIR}" ${MSVC_BUILD_TARGET}
# Exit now if unable to build # Exit now if unable to build
if [ $? -ne 0 ]; then status=$?
status=$? if [ $status -ne 0 ]; then
echo "Failed to build MDANSE" echo "Failed to build MDANSE"
exit status exit $status
fi fi
exit 0
\ No newline at end of file
...@@ -48,3 +48,4 @@ echo "Creating nsis installer for target ${BUILD_TARGET}..." ...@@ -48,3 +48,4 @@ echo "Creating nsis installer for target ${BUILD_TARGET}..."
makensis /V4 /ONSISlog.txt /DVERSION=${VERSION_NAME} /DARCH=${BUILD_TARGET} /DTARGET_DIR="${TARGET_DIR}" MDANSE_installer.nsi makensis /V4 /ONSISlog.txt /DVERSION=${VERSION_NAME} /DARCH=${BUILD_TARGET} /DTARGET_DIR="${TARGET_DIR}" MDANSE_installer.nsi
exit 0
\ No newline at end of file
...@@ -11,8 +11,9 @@ cd %testsPath% ...@@ -11,8 +11,9 @@ cd %testsPath%
set testsPath=%2\Tests\FunctionalTests\Jobs set testsPath=%2\Tests\FunctionalTests\Jobs
cd %testsPath% cd %testsPath%
del Test_*
%1\python.exe BuildJobTests.py %1\python.exe BuildJobTests.py
%1\python.exe %1\Scripts\nosetests --verbosity=3 -P %testsPath% %1\python.exe %1\Scripts\nosetests --verbosity=3 %testsPath%\Test_*.py
exit %errorlevel% exit %errorlevel%
\ No newline at end of file
...@@ -17,9 +17,10 @@ echo "Running tests" ...@@ -17,9 +17,10 @@ echo "Running tests"
cmd /V:ON /E:ON /C "run_tests.bat" "${TARGET_DIR}" "${CI_PROJECT_DIR_WIN}" cmd /V:ON /E:ON /C "run_tests.bat" "${TARGET_DIR}" "${CI_PROJECT_DIR_WIN}"
# Exit now if unable to run tests # Exit now if unable to run tests
if [ $? -ne 0 ]; then status=$?
status=$? if [ $status -ne 0 ]; then
echo "Failed to extract python"
echo "One or several unit tests failed" echo "One or several unit tests failed"
exit status
fi fi
exit 0
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment