From 87ffa07b665d7163e02579da3a97a4be8b7a5011 Mon Sep 17 00:00:00 2001 From: Andre Anjos Date: Tue, 24 Apr 2018 14:49:43 +0200 Subject: [PATCH] Simplify docker testing --- .gitignore | 6 ++++++ .gitlab-ci.yml | 8 ++++++-- conda/meta.yaml | 4 ++++ scripts/before_test.sh | 22 ++++++++++++---------- scripts/test.sh | 13 ------------- 5 files changed, 28 insertions(+), 25 deletions(-) delete mode 100755 scripts/test.sh diff --git a/.gitignore b/.gitignore index 0e57c465..0371e16d 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,9 @@ opsnr.stt .DS_Store html/ record.txt +_ci/ +miniconda.sh +miniconda/ +miniconda.cached/ +conda/recipe_append.yaml +conda-bld/ diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e9f4b964..d5fcb0f8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -68,12 +68,16 @@ stages: stage: docker before_script: # safe keep artifacts as before_build.sh will erase those... - - cp -a ${CONDA_ROOT}/conda-bld/linux-64/*.tar.bz2 . + - mv ${CONDA_ROOT}/conda-bld . - ./_ci/install.sh _ci master #updates ci support scripts - ./_ci/before_build.sh + - mv conda-bld ${CONDA_ROOT} - ./scripts/before_test.sh script: - - ./scripts/test.sh + - export BEAT_DOCKER_TESTS=true + - BOB_TEST_ONLY=true ./_ci/build.sh + after_script: + - ./_ci/after_build.sh build_linux_27: diff --git a/conda/meta.yaml b/conda/meta.yaml index b7c5fa4d..cac0b27f 100644 --- a/conda/meta.yaml +++ b/conda/meta.yaml @@ -53,7 +53,11 @@ test: commands: - worker --help + {% if environ.get('BEAT_DOCKER_TESTS', False) %} + - nosetests --with-coverage --cover-package={{ name }} -sv {{ name }} + {% else %} - nosetests --with-coverage --cover-package={{ name }} -sv {{ name }} --exclude=".*test_docker.*" + {% endif %} - sphinx-build -aEW {{ project_dir }}/doc {{ project_dir }}/sphinx - sphinx-build -aEb doctest {{ project_dir }}/doc sphinx - conda inspect linkages -p $PREFIX {{ name }} # [not win] diff --git a/scripts/before_test.sh b/scripts/before_test.sh index d5ffad9b..24bf2ea2 100755 --- a/scripts/before_test.sh +++ b/scripts/before_test.sh @@ -6,16 +6,6 @@ source ${basedir}/_ci/functions.sh REGISTRY="docker.idiap.ch" check_env REGISTRY -# Makes sure we activate the base environment if available -run_cmd source ${CONDA_ROOT}/etc/profile.d/conda.sh -run_cmd conda activate base -export_env PATH - -# Run our docker-based tests for this package -run_cmd conda create --yes --name docker python=${PYTHON_VERSION} -run_cmd conda install --yes --name docker --use-local ${CI_PROJECT_NAME}-${BOB_PACKAGE_VERSION}-*.tar.bz2 -run_cmd conda install --yes --name docker nose - # Select here images that are required for minimal operation (or tests) IMAGES=( "${REGISTRY}/beat/beat.env.system.python:1.3.0r0" @@ -88,3 +78,15 @@ if [ "$1" == "clean" ]; then run_cmd rm -rf "${BEAT_CORE_TEST_DIR}/${algodir}/build/" done fi + +# Makes sure we activate the base environment if available +run_cmd source ${CONDA_ROOT}/etc/profile.d/conda.sh +run_cmd conda activate base +export_env PATH + +for subchannel in linux-64 osx-64 noarch; do + if [ ! -d ${CONDA_ROOT}/conda-bld/${subchannel} ]; then + run_cmd mkdir -p ${CONDA_ROOT}/conda-bld/${subchannel} + fi + run_cmd conda index ${CONDA_ROOT}/conda-bld/${subchannel} +done diff --git a/scripts/test.sh b/scripts/test.sh deleted file mode 100755 index c3d78ab8..00000000 --- a/scripts/test.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash - -basedir=`pwd` -source ${basedir}/_ci/functions.sh - -# Makes sure we activate the base environment if available -run_cmd source ${CONDA_ROOT}/etc/profile.d/conda.sh -run_cmd conda activate base -export_env PATH - -# Runs the complete test suite, including docker-based tests -run_cmd conda activate docker -run_cmd nosetests --with-coverage --cover-package=beat.core -sv beat.core -- 2.21.0