From 5b43e215aaf05b90a5babf2ebb15e9621d63be7b Mon Sep 17 00:00:00 2001 From: Mike Bonnet Date: Feb 15 2018 23:33:25 +0000 Subject: [PATCH 1/4] use the f2ocp cluster configured in RCM Tools Jenkins --- diff --git a/Jenkinsfile b/Jenkinsfile index d8daee7..34a896f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -106,8 +106,8 @@ node('fedora') { stage('Perform functional tests') { unarchive mapping: ['appversion': 'appversion'] def appversion = readFile('appversion').trim() - openshift.withCluster('open.paas.redhat.com') { - openshift.doAs('openpaas-waiverdb-test-jenkins-credentials') { + openshift.withCluster('f2ocp') { + openshift.doAs('f2ocp-waiverdb-test-jenkins-credentials') { openshift.withProject('waiverdb-test') { def template = readYaml file: 'openshift/waiverdb-test-template.yaml' def models = openshift.process(template, From 80a8b550e4a3aeeda39b0e6fee0763bc45a92c46 Mon Sep 17 00:00:00 2001 From: Mike Bonnet Date: Feb 15 2018 23:37:03 +0000 Subject: [PATCH 2/4] grab the CA chain from the OpenShift service, and pass it to python-requests --- diff --git a/Jenkinsfile b/Jenkinsfile index 34a896f..4a12ba6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -131,7 +131,17 @@ node('fedora') { } def route_hostname = objects.narrow('route').object().spec.host echo "Running tests against https://${route_hostname}/" - withEnv(["WAIVERDB_TEST_URL=https://${route_hostname}/"]) { + def ca_chain = sh(returnStdout: true, script: """openssl s_client \ + -connect ${route_hostname}:443 \ + -servername ${route_hostname} -showcerts < /dev/null | \ + awk 'BEGIN {first_cert=1; in_cert=0}; + /BEGIN CERTIFICATE/ { if (first_cert == 1) first_cert = 0; else in_cert = 1 }; + { if (in_cert) print }; + /END CERTIFICATE/ { in_cert = 0 }'""") + writeFile(file: "${env.WORKSPACE}/ca-chain.crt", text: ca_chain) + echo "Wrote CA certificate chain to ${env.WORKSPACE}/ca-chain.crt" + withEnv(["WAIVERDB_TEST_URL=https://${route_hostname}/", + "REQUESTS_CA_BUNDLE=${env.WORKSPACE}/ca-chain.crt"]) { sh 'py.test functional-tests/' } } finally { From 240d9a71bb3086c3134408e8977bca9a90134fb0 Mon Sep 17 00:00:00 2001 From: Mike Bonnet Date: Feb 15 2018 23:37:10 +0000 Subject: [PATCH 3/4] run mock in verbose mode --- diff --git a/Jenkinsfile b/Jenkinsfile index 4a12ba6..cdb407b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -56,7 +56,7 @@ node('fedora') { sh """ mkdir -p mock-result/f26 flock /etc/mock/fedora-26-x86_64.cfg \ - /usr/bin/mock --resultdir=mock-result/f26 -r fedora-26-x86_64 --clean --rebuild rpmbuild-output/*.src.rpm + /usr/bin/mock -v --resultdir=mock-result/f26 -r fedora-26-x86_64 --clean --rebuild rpmbuild-output/*.src.rpm """ archiveArtifacts artifacts: 'mock-result/f26/**' }, From 911bb60fce98bfde19d3959f70e5be0a3c8a6b8d Mon Sep 17 00:00:00 2001 From: Mike Bonnet Date: Feb 15 2018 23:37:21 +0000 Subject: [PATCH 4/4] run mock build with networking enabled By default, networking is not enabled in a mock chroot. This causes sphinx to timeout while trying to query pagure.io about issues referenced in the docs. This significantly slows down the mock build. By enabling networking, we avoid the timeouts and speed up the build. Reproduceability is not a concern, since this is a throwaway test build anyway. --- diff --git a/Jenkinsfile b/Jenkinsfile index cdb407b..d5c0efe 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -56,7 +56,7 @@ node('fedora') { sh """ mkdir -p mock-result/f26 flock /etc/mock/fedora-26-x86_64.cfg \ - /usr/bin/mock -v --resultdir=mock-result/f26 -r fedora-26-x86_64 --clean --rebuild rpmbuild-output/*.src.rpm + /usr/bin/mock -v --enable-network --resultdir=mock-result/f26 -r fedora-26-x86_64 --clean --rebuild rpmbuild-output/*.src.rpm """ archiveArtifacts artifacts: 'mock-result/f26/**' },