From f64d762d23a8aa32eeec6f9a7727de58fefe0ccc Mon Sep 17 00:00:00 2001 From: GeorgianaElena Date: Tue, 18 Feb 2020 16:47:18 +0200 Subject: [PATCH] Get env var right --- .circleci/config.yml | 46 ++++++++++++++++++++------------------------ tljh/installer.py | 2 +- 2 files changed, 22 insertions(+), 26 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index cf30062..924d472 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -40,14 +40,14 @@ commands: branch_path: type: string default: "" - steps: - run: name: Run basic tests command: | + CIRCLE_PR_BRANCH=`curl -s https://api.github.com/repos/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/pulls/$CIRCLE_PR_NUMBER | grep '"ref":' | grep -v "master" | cut -d '"' -f4` .circleci/integration-test.py run-test basic-tests \ test_hub.py test_install.py test_extensions.py \ - << parameters.upgrade >> << parameters.branch_path >> + << parameters.upgrade >> $CIRCLE_PR_BRANCH admin_tests: parameters: @@ -57,7 +57,6 @@ commands: branch_path: type: string default: "" - steps: - run: name: Run admin tests @@ -75,7 +74,6 @@ commands: branch_path: type: string default: "" - steps: - run: name: Run plugin tests @@ -86,20 +84,16 @@ commands: << parameters.upgrade >> bootstrap_checks: + parameters: + branch_path: + type: string + default: "" steps: - run: name: Run bootstrap checks command: | py.test integration-tests/test_bootstrap.py - get_pr_branch: - steps: - - run: - name: Get PR branch - command: | - CIRCLE_PR_BRANCH=`curl -s https://api.github.com/repos/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/pulls/${CIRCLE_PR_NUMBER} \ - | grep '"ref":' | grep -v "master" | cut -d '"' -f4' - jobs: unit-test: @@ -148,56 +142,57 @@ jobs: command: | apk add --no-cache python3 pytest - - get_pr_branch - - checkout - setup_remote_docker - build_systemd_image - - basic-tests: - branch_path: "git+https://github.com/{CIRCLE_PROJECT_USERNAME}/the-littlest-jupyterhub.git@${CIRCLE_PR_BRANCH}" + - basic_tests: + branch_path: $CIRCLE_PR_BRANCH - admin_tests: - branch_path: "git+https://github.com/{CIRCLE_PROJECT_USERNAME}/the-littlest-jupyterhub.git@${CIRCLE_PR_BRANCH}" + branch_path: 'git+https://github.com/$CIRCLE_PROJECT_USERNAME/the-littlest-jupyterhub.git@$CIRCLE_PR_BRANCH' - plugin_tests: - branch_path: "git+https://github.com/{CIRCLE_PROJECT_USERNAME}/the-littlest-jupyterhub.git@${CIRCLE_PR_BRANCH}" + branch_path: 'git+https://github.com/$CIRCLE_PROJECT_USERNAME/the-littlest-jupyterhub.git@$CIRCLE_PR_BRANCH' - bootstrap_checks: - branch_path: "git+https://github.com/{CIRCLE_PROJECT_USERNAME}/the-littlest-jupyterhub.git@${CIRCLE_PR_BRANCH}" + branch_path: 'git+https://github.com/$CIRCLE_PROJECT_USERNAME/the-littlest-jupyterhub.git@$CIRCLE_PR_BRANCH' upgrade-test: docker: - image: docker:18.05.0-ce-git + environment: + CIRCLE_PR_BRANCH: | + $(curl -s https://api.github.com/repos/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/pulls/$CIRCLE_PR_NUMBER \ + | grep '"ref":' | grep -v "master" | cut -d '"' -f4) + steps: - run: name: setup python3 command: | apk add --no-cache python3 pytest - - get_pr_branch - - checkout - setup_remote_docker - build_systemd_image - - basic-tests: + - basic_tests: upgrade: "--upgrade" - branch_path: "git+https://github.com/{CIRCLE_PROJECT_USERNAME}/the-littlest-jupyterhub.git@${CIRCLE_PR_BRANCH}" + branch_path: 'git+https://github.com/$CIRCLE_PROJECT_USERNAME/the-littlest-jupyterhub.git@$CIRCLE_PR_BRANCH' - admin_tests: upgrade: "--upgrade" - branch_path: "git+https://github.com/{CIRCLE_PROJECT_USERNAME}/the-littlest-jupyterhub.git@${CIRCLE_PR_BRANCH}" + branch_path: "git+https://github.com/$CIRCLE_PROJECT_USERNAME/the-littlest-jupyterhub.git@$CIRCLE_PR_BRANCH" - plugin_tests: upgrade: "--upgrade" - branch_path: "git+https://github.com/{CIRCLE_PROJECT_USERNAME}/the-littlest-jupyterhub.git@${CIRCLE_PR_BRANCH}" + branch_path: "git+https://github.com/$CIRCLE_PROJECT_USERNAME/the-littlest-jupyterhub.git@$CIRCLE_PR_BRANCH" documentation: @@ -240,4 +235,5 @@ workflows: jobs: - unit-test - integration-test + - upgrade-test - documentation diff --git a/tljh/installer.py b/tljh/installer.py index 3527725..092cec9 100644 --- a/tljh/installer.py +++ b/tljh/installer.py @@ -261,7 +261,7 @@ def ensure_user_environment(user_requirements_txt_file): else: if conda.check_miniconda_version( USER_ENV_PREFIX, miniconda_old_version - ) + ): conda_version = '4.5.8' # If no prior miniconda installation is found, we can install a newer version else: