-
Notifications
You must be signed in to change notification settings - Fork 7
Add pr test jobs #9
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,16 +35,16 @@ | |
branches: | ||
- 'master' | ||
basedir: 'vic-internal' | ||
- git: | ||
url: 'https://github.com/vmware/{repo}' | ||
branches: | ||
- '{branch}' | ||
basedir: '{repo}' | ||
- git: | ||
url: 'https://github.com/vmware/vic-tools' | ||
branches: | ||
- 'master' | ||
basedir: 'vic-tools' | ||
- git: | ||
url: 'https://github.com/vmware/{repo}' | ||
branches: | ||
- '{branch}' | ||
basedir: '{repo}' | ||
wrappers: | ||
- timeout: | ||
name: absolute_timeout | ||
|
@@ -131,7 +131,7 @@ | |
#!/bin/bash | ||
set -x | ||
|
||
./vic-tools/jenkins/jobs/vic-product-scenario/selenium_grid.sh create {version} | ||
./vic-tools/jenkins/jobs/vic-product-scenario/selenium_grid.sh create {version} {parallel_jobs} | ||
|
||
cat > build.envfile <<ENVS | ||
PARALLEL_JOBS={parallel_jobs} | ||
|
@@ -146,4 +146,172 @@ | |
ENVS | ||
|
||
docker run --net grid-{version} --privileged --rm --link selenium-hub-{version}:selenium-grid-hub -v /var/run/docker.sock:/var/run/docker.sock -v /etc/docker/certs.d:/etc/docker/certs.d -v "${{WORKSPACE}}":/go -v /vic-cache:/vic-cache --env-file "vic-internal/{repo}-scenario-{version}-secrets.list" --env-file build.envfile gcr.io/eminent-nation-87317/vic-integration-test:1.46 vic-tools/jenkins/jobs/vic-product-scenario/build.sh ${{TEST_CASES}} | ||
./vic-tools/jenkins/jobs/vic-product-scenario/selenium_grid.sh remove {version} | ||
./vic-tools/jenkins/jobs/vic-product-scenario/selenium_grid.sh remove {version} {parallel_jobs} | ||
|
||
- defaults: | ||
name: 'pr-tests' | ||
description: 'This is a parameterized build for verifying your test code in a PR' | ||
node: '{node}' | ||
parameters: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there any way to deduplicate these parameters with the other jobs? It seems like we'd want to keep most of them consistent. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. We can improve this later. |
||
- choice: | ||
name: VSPHERE_VERSION | ||
choices: | ||
- '6.7' | ||
- '6.5' | ||
- '6.0' | ||
description: 'The version of vSphere to run against. Skipped tests are determined by it.' | ||
- string: | ||
name: ESX_BUILD | ||
default: '{default_esx_build}' | ||
description: 'The build of ESX to deploy, e.g. ob-8169922 (6.7 default).' | ||
- string: | ||
name: VC_BUILD | ||
default: '{default_vc_build}' | ||
description: 'The build of VC to deploy, e.g. ob-8217866 (6.7 default).' | ||
- string: | ||
name: TEST_BRANCH | ||
default: '' | ||
description: 'Must specified. {repo} branch to check out tests from. May be a pull request, e.g. "pull/8063"' | ||
- string: | ||
name: BUILD_BRANCH | ||
default: '' | ||
description: 'This is {repo} branch to fetch build from google storage bucket, e.g. releases/1.4.3. master by default' | ||
- string: | ||
name: BUILD_NUM | ||
default: '' | ||
description: 'Build number to test. Get latest build in the google storage bucket folder if not specified' | ||
- string: | ||
name: NIMBUS_USER | ||
default: '' | ||
description: 'Must specified. The username of the nimbus user with which to run the tests' | ||
- password: | ||
name: NIMBUS_PASSWORD | ||
default: '' | ||
description: 'Must specified. The password of the nimbus user with which to run the tests' | ||
- choice: | ||
name: PARALLEL_JOBS | ||
choices: | ||
- '1' | ||
- '2' | ||
- '3' | ||
- '4' | ||
description: 'The parallel executor of robot tests.' | ||
- string: | ||
name: TEST_CASES | ||
default: '' | ||
description: | | ||
The specific test cases to run as part of the job. These are passed as arguments to pabot so will likely be of the form "tests/manual-test-cases/Group23-Future-Tests" | ||
Runs the default set of tests if left empty. | ||
scm: | ||
- git: | ||
url: '[email protected]:core-build/vic-internal.git' | ||
credentials-id: 'GitLabAutomationKey' | ||
branches: | ||
- 'master' | ||
basedir: 'vic-internal' | ||
- git: | ||
url: 'https://github.com/vmware/vic-tools' | ||
branches: | ||
- 'master' | ||
basedir: 'vic-tools' | ||
- git: | ||
url: 'https://github.com/vmware/{repo}' | ||
branches: | ||
- '${{TEST_BRANCH}}' | ||
basedir: '{repo}' | ||
name: '' | ||
refspec: '+refs/heads/*:refs/remotes/origin/* +refs/pull/*/head:refs/remotes/origin/pull/*' | ||
wrappers: | ||
- timeout: | ||
name: absolute_timeout | ||
timeout: '{build_timeout}' | ||
abort: true | ||
type: absolute | ||
- workspace-cleanup | ||
publishers: | ||
- robot: | ||
output-path: '{repo}/report' | ||
pass-threshold: '100' | ||
unstable-threshold: '100' | ||
- groovy-postbuild: | ||
script: | | ||
def vc_build = manager.envVars['VC_BUILD'] | ||
def esx_build = manager.envVars['ESX_BUILD'] | ||
def vsphere_version = manager.envVars.get('VSPHERE_VERSION') | ||
def summary = manager.createSummary("gear2.gif") | ||
summary.appendText("Infrastructure Builds:<ul>", false) | ||
summary.appendText("<li><b>vSphere Version</b> - ${{vsphere_version}}</li>", false) | ||
summary.appendText("<li><b>vCenter</b> - ${{vc_build}}</li>", false) | ||
summary.appendText("<li><b>ESXi</b> - ${{esx_build}}</li>", false) | ||
- email-ext: | ||
success: true | ||
aborted: true | ||
failure: true | ||
content-type: html | ||
send-to: | ||
- requester | ||
subject: 'vmware/{repo} PR Testing - ${{TEST_BRANCH}}' | ||
body: | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could this message include more information about the test run? If you're running a few tests at the same time, it seems like figuring out which one an email is talking about might require actually opening Jenkins There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TEST_BRANCH is PR number, what other information do you think is better to have in the email? |
||
Download link for the test logs is in the <a href="${{BUILD_URL}}/console">build console output</a> | ||
<p> | ||
${{VSPHERE_VERSION}} Jenkins Nimbus Scenario Job: <a href="${{BUILD_URL}}">${{BUILD_URL}}</a> | ||
<p> | ||
Run Report: ${{ROBOT_REPORTLINK}} | ||
<p> | ||
${{FILE,path="{repo}/console.log"}} | ||
|
||
- job-template: | ||
name: 'vic-pr-test' | ||
defaults: 'pr-tests' | ||
builders: | ||
- shell: | | ||
#!/bin/bash | ||
dest="vic-ci-logs/vmware/${{TEST_BRANCH}}/" | ||
|
||
cat > build.envfile <<ENVS | ||
PARALLEL_JOBS=${{PARALLEL_JOBS}} | ||
NIMBUS_RETRY_ATTEMPTS=5 | ||
NIMBUS_RETRY_DELAY=1m | ||
LOG_UPLOAD_DEST=${{dest}} | ||
GIT_COMMIT=${{GIT_COMMIT}} | ||
BUILD_TIMESTAMP=${{BUILD_TIMESTAMP}} | ||
BUILD_ID=${{BUILD_ID}} | ||
ESX_BUILD=${{ESX_BUILD}} | ||
VC_BUILD=${{VC_BUILD}} | ||
BUILD_TAG=vic_${{BUILD_NUM}} | ||
VCH_BUILD=${{BUILD_NUM}} | ||
VCH_BRANCH=${{BUILD_BRANCH}} | ||
ENVS | ||
|
||
docker run --rm -v "${{WORKSPACE}}":/go --env-file vic-internal/{repo}-scenario-master-secrets.list --env-file build.envfile -e NIMBUS_USER="${{NIMBUS_USER}}" -e NIMBUS_PASSWORD="${{NIMBUS_PASSWORD}}" --name=${{BUILD_TAG}} gcr.io/eminent-nation-87317/vic-integration-test:1.48 vic-tools/jenkins/jobs/vic-scenario/build.sh ${{VSPHERE_VERSION}} ${{TEST_CASES}} | ||
|
||
- job-template: | ||
name: 'vic-product-pr-test' | ||
defaults: 'pr-tests' | ||
builders: | ||
- shell: | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there any way to deduplicate this with other jobs? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know how to deduplicate this with other jobs. |
||
#!/bin/bash | ||
set -x | ||
|
||
if [ -z "${{TEST_BRANCH}}" ] || [ -z "${{NIMBUS_USER}}" ] || [ -z "${{NIMBUS_PASSWORD}}" ]; then | ||
echo "TEST_BRANCH, NIMBUS_USER and NIMBUS_PASSWORD are must specified" | ||
exit 1 | ||
fi | ||
./vic-tools/jenkins/jobs/vic-product-scenario/selenium_grid.sh create ${{BUILD_ID}} ${{PARALLEL_JOBS}} | ||
|
||
cat > build.envfile <<ENVS | ||
PARALLEL_JOBS=${{PARALLEL_JOBS}} | ||
ROBOT_REPORT=report | ||
NIMBUS_RETRY_ATTEMPTS=5 | ||
NIMBUS_RETRY_DELAY=1m | ||
ESX_BUILD=${{ESX_BUILD}} | ||
VC_BUILD=${{VC_BUILD}} | ||
BUILD_TAG=vic-product_${{BUILD_NUM}} | ||
VIC_PRODUCT_BUILD=${{BUILD_NUM}} | ||
VIC_PRODUCT_BRANCH=${{BUILD_BRANCH}} | ||
ENVS | ||
|
||
set +x | ||
docker run --net grid-${{BUILD_ID}} --privileged --rm --link selenium-hub-${{BUILD_ID}}:selenium-grid-hub -v /var/run/docker.sock:/var/run/docker.sock -v /etc/docker/certs.d:/etc/docker/certs.d -v "${{WORKSPACE}}":/go -v /vic-cache:/vic-cache --env-file "vic-internal/{repo}-scenario-master-secrets.list" --env-file build.envfile -e NIMBUS_USER="${{NIMBUS_USER}}" -e NIMBUS_PASSWORD="${{NIMBUS_PASSWORD}}" gcr.io/eminent-nation-87317/vic-integration-test:1.46 vic-tools/jenkins/jobs/vic-product-scenario/build.sh ${{TEST_CASES}} | ||
set -x | ||
./vic-tools/jenkins/jobs/vic-product-scenario/selenium_grid.sh remove ${{BUILD_ID}} ${{PARALLEL_JOBS}} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,7 +32,7 @@ VC_67_VERSION="ob-8217866" | |
|
||
DEFAULT_LOG_UPLOAD_DEST="vic-ci-logs" | ||
DEFAULT_ARTIFACT_BUCKET="vic-engine-builds" | ||
DEFAULT_VCH_BRANCH="" | ||
DEFAULT_VCH_BRANCH="master" | ||
DEFAULT_VCH_BUILD="*" | ||
DEFAULT_TESTCASES=("tests/manual-test-cases/Group5-Functional-Tests" "tests/manual-test-cases/Group13-vMotion" "tests/manual-test-cases/Group21-Registries" "tests/manual-test-cases/Group23-Future-Tests") | ||
|
||
|
@@ -65,7 +65,7 @@ testcases=("${@:-${DEFAULT_TESTCASES[@]}}") | |
VCH_BUILD=${VCH_BUILD:-${DEFAULT_VCH_BUILD}} | ||
VCH_BRANCH=${VCH_BRANCH:-${DEFAULT_VCH_BRANCH}} | ||
ARTIFACT_BUCKET=${ARTIFACT_BUCKET:-${DEFAULT_ARTIFACT_BUCKET}} | ||
if [ "${VCH_BRANCH}" == "master" ]; then | ||
if [ "${VCH_BRANCH}" == "${DEFAULT_VCH_BRANCH}" ]; then | ||
GS_PATH="${ARTIFACT_BUCKET}" | ||
else | ||
GS_PATH="${ARTIFACT_BUCKET}/${VCH_BRANCH}" | ||
|
@@ -125,7 +125,7 @@ pushd vic | |
echo "Tarball extraction passed, Running nightlies test.." | ||
fi | ||
|
||
pabot --processes ${PARALLEL_JOBS} --removekeywords TAG:secret ${excludes} --variable ESX_VERSION:"${ESX_BUILD}" --variable VC_VERSION:"${VC_BUILD}" -d report "${testcases[@]}" | ||
pabot --processes ${PARALLEL_JOBS} ${excludes} --variable ESX_VERSION:"${ESX_BUILD}" --variable VC_VERSION:"${VC_BUILD}" -d report "${testcases[@]}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we want to make this change; removing secret information from logs is important. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK. I will revert it back, but it is really difficulty for troubleshooting without logging them. |
||
cat report/pabot_results/*/stdout.txt | grep '::' | grep -E 'PASS|FAIL' > console.log | ||
|
||
# See if any VMs leaked | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the significance of this reordering?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Environment variable GIT_COMMIT will be set the the commit id of the last repo. Commit id of vic-tools and vic-internal is useless.