Commit a3075e4b authored by eric pellegrini's avatar eric pellegrini
Browse files

Merge branch 'master' into develop

parents 3158f7da fcdd3e84
Pipeline #947 passed with stages
in 16 minutes and 1 second
......@@ -4,16 +4,18 @@ stages:
- deploy
# trusty pipeline
build:trusty:
stage: build
script:
- ./BuildServer/Debian/run_build.sh
allow_failure: false
tags:
- ubuntu14.04
artifacts:
paths:
- build
tags:
- ubuntu14.04
test:trusty:
stage: test
script:
......@@ -29,8 +31,8 @@ deploy:trusty:
script:
- ./BuildServer/Debian/run_deploy.sh amd64 trusty
only:
- tags
- hotfix-.*
- master
- develop
when: on_success
artifacts:
paths:
......@@ -38,77 +40,83 @@ deploy:trusty:
tags:
- ubuntu14.04
# osx pipeline
# build:osx:
# stage: build
# script:
# - cd ./BuildServer/Darwin/Scripts
# - ./run_build.sh
# allow_failure: false
# tags:
# - mac
build:osx:
stage: build
script:
- ./BuildServer/Darwin/Scripts/run_build.sh
allow_failure: false
artifacts:
paths:
- build
tags:
- mac
# test:osx:
# stage: test
# script:
# - cd ./BuildServer/Darwin/Scripts
# - ./run_tests.sh
# allow_failure: false
# tags:
# - mac
test:osx:
stage: test
script:
- ./BuildServer/Darwin/Scripts/run_tests.sh
allow_failure: false
tags:
- mac
dependencies:
- build:osx
# deploy:osx:
# stage: deploy
# script:
# - cd ./BuildServer/Darwin/Scripts
# - ./run_deploy.sh
# only:
# - tags
# - hotfix-.*
# when: on_success
# artifacts:
# paths:
# - BuildServer/Darwin/Build/*.dmg
# tags:
# - mac
deploy:osx:
stage: deploy
script:
- ./BuildServer/Darwin/Scripts/run_deploy.sh
only:
- master
- develop
when: on_success
artifacts:
paths:
- BuildServer/Darwin/Build/*.dmg
tags:
- mac
# # windows 7 pipeline
# build:windows:
# stage: build
# script:
# - 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 "./BuildServer/Windows/run_build.sh"
# allow_failure: false
# tags:
# - windows
build:windows:
stage: build
script:
- 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 "./BuildServer/Windows/run_build.sh"
allow_failure: false
artifacts:
paths:
- .\BuildServer\Windows\Build
tags:
- 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
# tags:
# - 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
tags:
- windows
dependencies:
- build:windows
# deploy:windows:
# stage: deploy
# script:
# - c:\cygwin64\bin\bash -c "dos2unix.exe ./BuildServer/Windows/run_deploy.sh"
# - c:\cygwin64\bin\bash -c "chmod a+x ./BuildServer/Windows/run_deploy.sh"
# - c:\cygwin64\bin\bash -c "./BuildServer/Windows/run_deploy.sh"
# only:
# - tags
# - hotfix-.*
# when: on_success
# artifacts:
# paths:
# - BuildServer/Windows/Build/MDANSE*.exe
# tags:
# - windows
deploy:windows:
stage: deploy
script:
- c:\cygwin64\bin\bash -c "dos2unix.exe ./BuildServer/Windows/run_deploy.sh"
- c:\cygwin64\bin\bash -c "chmod a+x ./BuildServer/Windows/run_deploy.sh"
- c:\cygwin64\bin\bash -c "./BuildServer/Windows/run_deploy.sh"
only:
- master
- develop
when: on_success
artifacts:
paths:
- BuildServer/Windows/Build/MDANSE*.exe
tags:
- windows
......@@ -10,17 +10,9 @@
ROUGE="\\033[1;31m"
BLEU="\\033[1;34m"
VERSION_NAME=`python -c "execfile('MDANSE/__pkginfo__.py') ; print __version__`
export VERSION_NAME
##Select the build target
BUILD_TARGET=darwin
cd ../../../
# Which version name are we appending to the final archive
TARGET_DIR=MDANSE-${VERSION_NAME}-${BUILD_TARGET}
# take the latest version of nmoldyn available on the forge
echo -e "$BLEU""Getting last MDANSE revision" "$NORMAL"
......
......@@ -10,25 +10,16 @@
ROUGE="\\033[1;31m"
BLEU="\\033[1;34m"
if [ -n "${RUN_NIGHTLY_BUILD}" ]
VERSION_NAME=`sed -n 's/__version__.*=.*\"\(.*\)\"/\1/p' MDANSE/__pkginfo__.py`
if [ "${CI_BUILD_REF_NAME}" == "develop" ]
then
VERSION_NAME="devel"
else
if [[ ${CI_BUILD_TAG} =~ ^v([0-9]+\.[0-9]+\.[0-9]+)$ ]]
then
VERSION_NAME=${BASH_REMATCH[1]}
else
echo -e "$ROUGE""Invalid version number ${CI_BUILD_TAG}" "$NORMAL"
exit
fi
VERSION_NAME=${VERSION_NAME}-`git rev-parse --short HEAD`
fi
export VERSION_NAME
##Select the build target
BUILD_TARGET=darwin
cd ../../../
echo -e "$BLEU""Packaging MDANSE" "$NORMAL"
rm -rf BuildServer/Darwin/Build
mkdir BuildServer/Darwin/Build
......
#!/bin/bash
cd ../../../
ROUGE="\\033[1;31m"
# Performs the unit tests
cd Tests/UnitTests
nosetests --verbosity=3 -P .
# Exit now if unable to run tests
if [ $? -ne 0 ]; then
status = $?
echo -e "$ROUGE""One or several unit tests failed"
exit status
fi
cd ../..
cd Tests/FunctionalTests/Jobs
python BuildJobTests.py
nosetests --verbosity=3 --exe -P .
if [ $? -ne 0 ]; then
status=$?
echo -e "$ROUGE""One or several functional tests failed"
exit status
fi
cd ../../..
......@@ -7,20 +7,12 @@ export DISTRO=$2
# CONFIGURATION
#############################
echo "BUID REF NAME --> ${CI_BUILD_REF_NAME}"
## Add some colors
ROUGE="\\033[1;31m"
BLEU="\\033[1;34m"
##Select the build target
BUILD_TARGET=debian
cd
cd $CI_PROJECT_DIR
VERSION_NAME=`python -c "execfile('MDANSE/__pkginfo__.py') ; print __version__`
# Get revision number from git (without trailing newline)
REV_NUMBER=$(git rev-list --count HEAD)
echo -e "$BLEU""Revision number = ${REV_NUMBER}<--" "$NORMAL"
......
......@@ -11,16 +11,10 @@ export DISTRO=$2
ROUGE="\\033[1;31m"
BLEU="\\033[1;34m"
if [ -n "${RUN_NIGHTLY_BUILD}" ]
VERSION_NAME=`sed -n 's/__version__.*=.*\"\(.*\)\"/\1/p' MDANSE/__pkginfo__.py`
if [ "${CI_BUILD_REF_NAME}" == "develop" ]
then
VERSION_NAME="devel"
else
if [[ $CI_BUILD_TAG =~ ^v([0-9]+\.[0-9]+\.[0-9]+)$ ]]; then
VERSION_NAME=${BASH_REMATCH[1]}
else
echo -e "$ROUGE""Invalid version number ${CI_BUILD_TAG}" "$NORMAL"
exit
fi
VERSION_NAME=${VERSION_NAME}-`git rev-parse --short HEAD`
fi
##Select the build target
......
#!/bin/bash
ROUGE="\\033[1;31m"
cd $CI_PROJECT_DIR
export PYTHONPATH=${CI_PROJECT_DIR}/build/lib.linux-x86_64-2.7
......@@ -7,10 +9,21 @@ export PYTHONPATH=${CI_PROJECT_DIR}/build/lib.linux-x86_64-2.7
# Performs the unit tests
cd Tests/UnitTests
nosetests --verbosity=3 -P .
# Exit now if unable to run tests
if [ $? -ne 0 ]; then
status = $?
echo -e "$ROUGE""One or several unit tests failed"
exit status
fi
cd ../..
# Performs the functional tests
cd Tests/FunctionalTests/Jobs
python BuildJobTests.py
nosetests --verbosity=3 --exe -P .
if [ $? -ne 0 ]; then
status=$?
echo -e "$ROUGE""One or several functional tests failed"
exit status
fi
......@@ -10,8 +10,6 @@ else
BUILD_TARGET=$1
fi
VERSION_NAME=`cat MDANSE/__pkginfo__.py | sed "s/__version__\s*=\s*'\(.*\)'/\1/"`
if [ "$BUILD_TARGET" = "win32" ]; then
PYTHON_SUFFIX=""
MSVC_BUILD_TARGET="/x86"
......@@ -54,7 +52,6 @@ if [ -e "$TARGET_DIR_CYGWIN" ]; then
rm -rf ${TARGET_DIR_CYGWIN}
fi
DEPENDENCIES_DIR=${CI_WINDOWS_DEPENDENCIES_PATH_UNIX}/${BUILD_TARGET}
PYTHON_MSI=python-${PYTHON_VERSION}${PYTHON_SUFFIX}.msi
......@@ -65,7 +62,7 @@ cmd /c "msiexec /L* pythonlog.txt /qn /a ${PYTHON_MSI_WIN} TARGETDIR=${TARGET_D
# Exit now if something goes wrong
if [ $? -ne 0 ]; then
status = $?
status=$?
echo "Failed to extract python"
exit status
fi
......@@ -205,7 +202,7 @@ cmd /V:ON /E:ON /C "setup_and_build.bat" "${CI_PROJECT_DIR_WIN}" "${TARGET_DIR}"
# Exit now if unable to build
if [ $? -ne 0 ]; then
status = $?
status=$?
echo "Failed to build MDANSE"
exit status
fi
......@@ -12,17 +12,10 @@ else
BUILD_TARGET=$1
fi
if [ -n "${RUN_NIGHTLY_BUILD}" ]
VERSION_NAME=`sed -n 's/__version__.*=.*\"\(.*\)\"/\1/p' MDANSE/__pkginfo__.py`
if [ "${CI_BUILD_REF_NAME}" == "develop" ]
then
VERSION_NAME="devel"
else
if [[ ${CI_BUILD_TAG} =~ ^v([0-9]+\.[0-9]+\.[0-9]+)$ ]]
then
VERSION_NAME=${BASH_REMATCH[1]}
else
echo "Invalid version number ${CI_BUILD_TAG}"
exit
fi
VERSION_NAME=${VERSION_NAME}-`git rev-parse --short HEAD`
fi
##Which versions of external programs to use
......
......@@ -2,33 +2,23 @@
CI_PROJECT_DIR_WIN=$(cygpath -a -w ${CI_PROJECT_DIR})
echo "Project directory"
echo $CI_PROJECT_DIR_WIN
# Change working directory to the directory the script is in
# http://stackoverflow.com/a/246128
SCRIPT_DIR="${CI_PROJECT_DIR}/BuildServer/Windows"
echo "Script"
echo $SCRIPT_DIR
# This is the directory that will contain the temporary installation
TARGET_DIR="${CI_PROJECT_DIR_WIN}\\BuildServer\\Windows\\Build"
echo "Target"
echo $TARGET_DIR
#############################
# Build the packages
#############################
cd "${SCRIPT_DIR}"
ls
echo "Running tests"
cmd /V:ON /E:ON /C "run_tests.bat" "${TARGET_DIR}" "${CI_PROJECT_DIR_WIN}"
# Exit now if unable to run tests
if [ $? -ne 0 ]; then
status = $?
status=$?
echo "One or several unit tests failed"
exit status
fi
......
......@@ -34,7 +34,7 @@ import os
import shutil
import unittest
from MDANSE import PREFERENCES
from MDANSE.Core.Preferences import Preferences
from MDANSE.Core.Preferences import PreferencesError
from UnitTest import UnitTest
......@@ -44,17 +44,21 @@ class UnStringable:
raise TypeError("Object not castable to a string.")
class TestPreferences(UnitTest):
def setUp(self):
self._preferences = Preferences()
def test_get_item(self):
self.assertRaises(PreferencesError,PREFERENCES.__getitem__,'xxxxx')
self.assertRaises(PreferencesError,self._preferences.__getitem__,'xxxxx')
def test_set_item(self):
val = PREFERENCES["working_directory"].get_value()
PREFERENCES["working_directory"].set_value("test")
self.assertEqual(PREFERENCES["working_directory"].value,os.path.join(os.getcwd(),"test"))
PREFERENCES["working_directory"].set_value(val)
val = self._preferences["working_directory"].get_value()
self._preferences["working_directory"].set_value("test")
self.assertEqual(self._preferences["working_directory"].value,os.path.join(os.getcwd(),"test"))
self._preferences["working_directory"].set_value(val)
shutil.rmtree("test")
......@@ -64,7 +68,7 @@ class TestPreferences(UnitTest):
'''
# Test that loading a preferences file whose type is not a basestring throw a PreferencesError
self.assertRaises(PreferencesError,PREFERENCES.load,10)
self.assertRaises(PreferencesError,self._preferences.load,10)
def test_save_preferences(self):
'''
......@@ -72,9 +76,9 @@ class TestPreferences(UnitTest):
'''
# Test that saving a preferences file whose type is not a basestring throw a PreferencesError
self.assertRaises(PreferencesError,PREFERENCES.save,10)
self.assertRaises(PreferencesError,self._preferences.save,10)
# Test that saving a preferences whose path does not exists throw a PreferencesError
self.assertRaises(PreferencesError,PREFERENCES.save,os.path.join('xxxx','yyyy'))
self.assertRaises(PreferencesError,self._preferences.save,os.path.join('xxxx','yyyy'))
def suite():
loader = unittest.TestLoader()
......
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