From 3ca8e6d62a1284cde1f966a42a1d6044191cf31a Mon Sep 17 00:00:00 2001 From: Philip Paquette Date: Thu, 14 Feb 2019 14:54:18 -0500 Subject: Using Python 3.7 by default for Jenkins tests --- .jenkins/Jenkinsfile | 70 ++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 57 insertions(+), 13 deletions(-) diff --git a/.jenkins/Jenkinsfile b/.jenkins/Jenkinsfile index 517cad2..1155bed 100644 --- a/.jenkins/Jenkinsfile +++ b/.jenkins/Jenkinsfile @@ -92,23 +92,23 @@ try { // 2. Running tests parallel_test = [:] -// Running Python 3.6 everytime, except for "web", "build", "build_rw" branch -parallel_test['python_3.6'] = { +// Running Python 3.7 everytime, except for "web", "build", "build_rw" branch +parallel_test['python_3.7'] = { node('ubuntu-1604-small') { - stage('Python 3.6') { + stage('Python 3.7') { try { timeout(time: 20, activity: true, unit: 'MINUTES') { - githubNotify account: USERNAME, context: CONTEXT + "/python3.6", credentialsId: 'ppaquette-jenkins-api-as-password', description: PENDING_MSG, gitApiUrl: '', repo: REPOSITORY, sha: COMMIT_HASH, status: 'PENDING', targetUrl: '' + githubNotify account: USERNAME, context: CONTEXT + "/python3.7", credentialsId: 'ppaquette-jenkins-api-as-password', description: PENDING_MSG, gitApiUrl: '', repo: REPOSITORY, sha: COMMIT_HASH, status: 'PENDING', targetUrl: '' withCredentials([sshUserPrivateKey(credentialsId: 'jenkins-ssh-key', keyFileVariable: 'SSH_KEY_FILE', passphraseVariable: '', usernameVariable: '')]) { checkout([$class: 'GitSCM', branches: [[name: CHECKOUT_BRANCH]], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CleanBeforeCheckout']], submoduleCfg: [], userRemoteConfigs: [[name: 'origin', refspec: CHECKOUT_REF, credentialsId: 'jenkins-ssh-key', url: GITHUB_URL]]]) sh ".jenkins/merge_pr.sh $PR_NUMBER $COMMIT_HASH $BASE_HASH $SSH_KEY_FILE \ - && wget -nv https://storage.googleapis.com/ppaquette-diplomacy/files/Miniconda3-py36.sh -O miniconda.sh \ + && wget -nv https://storage.googleapis.com/ppaquette-diplomacy/files/Miniconda3-py37.sh -O miniconda.sh \ && chmod +x ./miniconda.sh \ && rm -Rf $HOME/miniconda \ && ./miniconda.sh -b -p $HOME/miniconda \ && export PATH=$HOME/miniconda/bin:$PATH \ - && conda create -y -q -n py36 python=3.6 \ - && export PATH=$HOME/miniconda/envs/py36/bin:$PATH \ + && conda create -y -q -n py37 python=3.7 \ + && export PATH=$HOME/miniconda/envs/py37/bin:$PATH \ && mkdir -p $HOME/.cache/diplomacy \ && wget -nv https://storage.googleapis.com/ppaquette-diplomacy/cache-jenkins/convoy_paths_cache.pkl -O $HOME/.cache/diplomacy/convoy_paths_cache.pkl \ && .jenkins/get_cache.sh $PR_NUMBER $STRIPPED_BRANCH \ @@ -126,21 +126,65 @@ parallel_test['python_3.6'] = { && ./run_tests.sh \ && .jenkins/set_cache.sh $PR_NUMBER $STRIPPED_BRANCH" } - githubNotify account: USERNAME, context: CONTEXT + "/python3.6", credentialsId: 'ppaquette-jenkins-api-as-password', description: SUCCESS_MSG, gitApiUrl: '', repo: REPOSITORY, sha: COMMIT_HASH, status: 'SUCCESS', targetUrl: '' + githubNotify account: USERNAME, context: CONTEXT + "/python3.7", credentialsId: 'ppaquette-jenkins-api-as-password', description: SUCCESS_MSG, gitApiUrl: '', repo: REPOSITORY, sha: COMMIT_HASH, status: 'SUCCESS', targetUrl: '' } } catch(err) { - echo "Error encountered in parallel (Python 3.6): ${err}" + echo "Error encountered in parallel (Python 3.7): ${err}" exit_status = 1 currentBuild.result = "FAILURE" - githubNotify account: USERNAME, context: CONTEXT + "/python3.6", credentialsId: 'ppaquette-jenkins-api-as-password', description: FAILURE_MSG, gitApiUrl: '', repo: REPOSITORY, sha: COMMIT_HASH, status: 'FAILURE', targetUrl: '' + githubNotify account: USERNAME, context: CONTEXT + "/python3.7", credentialsId: 'ppaquette-jenkins-api-as-password', description: FAILURE_MSG, gitApiUrl: '', repo: REPOSITORY, sha: COMMIT_HASH, status: 'FAILURE', targetUrl: '' } } } } -// Only running 3.4 and 3.5 for Pull Requests (and for "jenkins" branch) +// Only running 3.4, 3.5, and 3.6 for Pull Requests (and for "jenkins" branch) if (BUILD_TYPE == 'pr' || (BUILD_TYPE == 'push' && COMMIT_BRANCH == 'jenkins')) { + parallel_test['python_3.6'] = { + node('ubuntu-1604-small') { + stage('Python 3.6') { + try { + timeout(time: 20, activity: true, unit: 'MINUTES') { + githubNotify account: USERNAME, context: CONTEXT + "/python3.6", credentialsId: 'ppaquette-jenkins-api-as-password', description: PENDING_MSG, gitApiUrl: '', repo: REPOSITORY, sha: COMMIT_HASH, status: 'PENDING', targetUrl: '' + withCredentials([sshUserPrivateKey(credentialsId: 'jenkins-ssh-key', keyFileVariable: 'SSH_KEY_FILE', passphraseVariable: '', usernameVariable: '')]) { + checkout([$class: 'GitSCM', branches: [[name: CHECKOUT_BRANCH]], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CleanBeforeCheckout']], submoduleCfg: [], userRemoteConfigs: [[name: 'origin', refspec: CHECKOUT_REF, credentialsId: 'jenkins-ssh-key', url: GITHUB_URL]]]) + sh ".jenkins/merge_pr.sh $PR_NUMBER $COMMIT_HASH $BASE_HASH $SSH_KEY_FILE \ + && wget -nv https://storage.googleapis.com/ppaquette-diplomacy/files/Miniconda3-py37.sh -O miniconda.sh \ + && chmod +x ./miniconda.sh \ + && rm -Rf $HOME/miniconda \ + && ./miniconda.sh -b -p $HOME/miniconda \ + && export PATH=$HOME/miniconda/bin:$PATH \ + && conda create -y -q -n py36 python=3.6 \ + && export PATH=$HOME/miniconda/envs/py36/bin:$PATH \ + && mkdir -p $HOME/.cache/diplomacy \ + && wget -nv https://storage.googleapis.com/ppaquette-diplomacy/cache-jenkins/convoy_paths_cache.pkl -O $HOME/.cache/diplomacy/convoy_paths_cache.pkl \ + && .jenkins/get_cache.sh $PR_NUMBER $STRIPPED_BRANCH \ + && pip install -r requirements.txt \ + && pip install -r requirements_dev.txt \ + && touch run_install_nvm.sh \ + && chmod +x run_install_nvm.sh \ + && ./run_install_nvm.sh \ + && echo '--------------------------------------------------' \ + && pip --version \ + && python --version \ + && which python \ + && git rev-parse HEAD \ + && git log -n 1 \ + && ./run_tests.sh \ + && .jenkins/set_cache.sh $PR_NUMBER $STRIPPED_BRANCH" + } + githubNotify account: USERNAME, context: CONTEXT + "/python3.6", credentialsId: 'ppaquette-jenkins-api-as-password', description: SUCCESS_MSG, gitApiUrl: '', repo: REPOSITORY, sha: COMMIT_HASH, status: 'SUCCESS', targetUrl: '' + } + } catch(err) { + echo "Error encountered in parallel (Python 3.6): ${err}" + exit_status = 1 + currentBuild.result = "FAILURE" + githubNotify account: USERNAME, context: CONTEXT + "/python3.6", credentialsId: 'ppaquette-jenkins-api-as-password', description: FAILURE_MSG, gitApiUrl: '', repo: REPOSITORY, sha: COMMIT_HASH, status: 'FAILURE', targetUrl: '' + } + } + } + } parallel_test['python_3.5'] = { node('ubuntu-1604-small') { stage('Python 3.5') { @@ -150,7 +194,7 @@ if (BUILD_TYPE == 'pr' || (BUILD_TYPE == 'push' && COMMIT_BRANCH == 'jenkins')) withCredentials([sshUserPrivateKey(credentialsId: 'jenkins-ssh-key', keyFileVariable: 'SSH_KEY_FILE', passphraseVariable: '', usernameVariable: '')]) { checkout([$class: 'GitSCM', branches: [[name: CHECKOUT_BRANCH]], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CleanBeforeCheckout']], submoduleCfg: [], userRemoteConfigs: [[name: 'origin', refspec: CHECKOUT_REF, credentialsId: 'jenkins-ssh-key', url: GITHUB_URL]]]) sh ".jenkins/merge_pr.sh $PR_NUMBER $COMMIT_HASH $BASE_HASH $SSH_KEY_FILE \ - && wget -nv https://storage.googleapis.com/ppaquette-diplomacy/files/Miniconda3-py36.sh -O miniconda.sh \ + && wget -nv https://storage.googleapis.com/ppaquette-diplomacy/files/Miniconda3-py37.sh -O miniconda.sh \ && chmod +x ./miniconda.sh \ && rm -Rf $HOME/miniconda \ && ./miniconda.sh -b -p $HOME/miniconda \ @@ -194,7 +238,7 @@ if (BUILD_TYPE == 'pr' || (BUILD_TYPE == 'push' && COMMIT_BRANCH == 'jenkins')) withCredentials([sshUserPrivateKey(credentialsId: 'jenkins-ssh-key', keyFileVariable: 'SSH_KEY_FILE', passphraseVariable: '', usernameVariable: '')]) { checkout([$class: 'GitSCM', branches: [[name: CHECKOUT_BRANCH]], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CleanBeforeCheckout']], submoduleCfg: [], userRemoteConfigs: [[name: 'origin', refspec: CHECKOUT_REF, credentialsId: 'jenkins-ssh-key', url: GITHUB_URL]]]) sh ".jenkins/merge_pr.sh $PR_NUMBER $COMMIT_HASH $BASE_HASH $SSH_KEY_FILE \ - && wget -nv https://storage.googleapis.com/ppaquette-diplomacy/files/Miniconda3-py36.sh -O miniconda.sh \ + && wget -nv https://storage.googleapis.com/ppaquette-diplomacy/files/Miniconda3-py37.sh -O miniconda.sh \ && chmod +x ./miniconda.sh \ && rm -Rf $HOME/miniconda \ && ./miniconda.sh -b -p $HOME/miniconda \ -- cgit v1.2.3