From 1c69838bdc830035d7403a520d9d8d6492c2c28d Mon Sep 17 00:00:00 2001 From: Yifeng Xiao Date: Fri, 24 Aug 2018 10:38:31 +0800 Subject: [PATCH] Initial Jenkins scenario jobs (#8) Add jenkins job configurations and scripts for vic and vic-product scenario tests. --- jenkins/jjb/projects.yaml | 55 +++++++ jenkins/jjb/templates/scenario-tests.yaml | 149 +++++++++++++++++ jenkins/jjb/templates/scenario-trigger.yaml | 15 ++ jenkins/jjb/views.yaml | 17 ++ .../build.sh} | 24 ++- .../jenkins_job_trigger.py | 13 +- jenkins/jobs/vic-product-scenario/build.sh | 102 ++++++++++++ .../vic-product-scenario/selenium_grid.sh | 76 +++++++++ jenkins/jobs/vic-scenario/build.sh | 150 ++++++++++++++++++ jenkins/jobs/vic-scenario/upload-logs.sh | 71 +++++++++ 10 files changed, 660 insertions(+), 12 deletions(-) create mode 100644 jenkins/jjb/projects.yaml create mode 100644 jenkins/jjb/templates/scenario-tests.yaml create mode 100644 jenkins/jjb/templates/scenario-trigger.yaml create mode 100644 jenkins/jjb/views.yaml rename jenkins/jobs/{trigger/nightly_trigger.sh => scenario-trigger/build.sh} (73%) rename jenkins/jobs/{trigger => scenario-trigger}/jenkins_job_trigger.py (86%) create mode 100755 jenkins/jobs/vic-product-scenario/build.sh create mode 100755 jenkins/jobs/vic-product-scenario/selenium_grid.sh create mode 100755 jenkins/jobs/vic-scenario/build.sh create mode 100755 jenkins/jobs/vic-scenario/upload-logs.sh diff --git a/jenkins/jjb/projects.yaml b/jenkins/jjb/projects.yaml new file mode 100644 index 0000000..ea963d4 --- /dev/null +++ b/jenkins/jjb/projects.yaml @@ -0,0 +1,55 @@ +- project: + name: 'scenario-tests-trigger' + jobs: + - '{repo}-{version}-trigger': + repo: 'vic' + version: 'master' + branch: 'master' + prefix: 'vic_' + bucket: 'vic-engine-builds' + - '{repo}-{version}-trigger': + repo: 'vic' + version: '1.4.3' + branch: 'releases/1.4.3' + prefix: 'vic_' + bucket: 'vic-engine-builds' + - '{repo}-{version}-trigger': + repo: 'vic-product' + version: 'master' + branch: 'master' + prefix: 'vic-dev' + bucket: 'vic-product-ova-builds' + - '{repo}-{version}-trigger': + repo: 'vic-product' + version: '1.4.3' + branch: 'releases/1.4.3' + prefix: 'vic-dev' + bucket: 'vic-product-ova-builds' + +- project: + name: 'scenario-tests' + default_esx_build: '8169922' + default_vc_build: '8217866' + build_timeout: '1440' + parallel_jobs: '1' + jobs: + - 'vic-{version}-scenario': + repo: 'vic' + version: '1.4.3' + branch: 'releases/1.4.3' + node: 'vic-executor' + - 'vic-{version}-scenario': + repo: 'vic' + version: 'master' + branch: 'master' + node: 'vic-executor' + - 'vic-product-{version}-scenario': + repo: 'vic-product' + version: '1.4.3' + branch: 'releases/1.4.3' + node: 'vic-executor1' + - 'vic-product-{version}-scenario': + repo: 'vic-product' + version: 'master' + branch: 'master' + node: 'vic-executor1' \ No newline at end of file diff --git a/jenkins/jjb/templates/scenario-tests.yaml b/jenkins/jjb/templates/scenario-tests.yaml new file mode 100644 index 0000000..2d7efcc --- /dev/null +++ b/jenkins/jjb/templates/scenario-tests.yaml @@ -0,0 +1,149 @@ +- defaults: + name: 'scenario-tests' + description: 'This is a parameterized build for running Nimbus scenario tests against build of {repo} {branch}' + node: '{node}' + parameters: + - 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: BUILD_NUM + default: '' + description: 'Build number to test.' + - 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: 'git@gitlab.eng.vmware.com:core-build/vic-internal.git' + credentials-id: 'GitLabAutomationKey' + 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' + wrappers: + - timeout: + name: absolute_timeout + timeout: '{build_timeout}' + abort: true + type: absolute + - workspace-cleanup + - build-name: + name: ${{ENV,var="BUILD_NUM"}} + 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: