Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
code.vt.edu will be down for maintenance from 0530-0630 EDT Wednesday, March 26th
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
4e1826a5
Commit
4e1826a5
authored
6 years ago
by
Michael Youngstrom
Browse files
Options
Downloads
Patches
Plain Diff
Add Jenkinsfile for python pr tests
parent
cc2d04a4
Branches
Branches containing commit
Tags
release-2018-09-20-11.06
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Jenkinsfile
+368
-0
368 additions, 0 deletions
Jenkinsfile
with
368 additions
and
0 deletions
Jenkinsfile
0 → 100644
+
368
−
0
View file @
4e1826a5
def
runPythonTests
()
{
ansiColor
(
'gnome-terminal'
)
{
sshagent
(
credentials:
[
'jenkins-worker'
],
ignoreMissing:
true
)
{
checkout
changelog:
false
,
poll:
false
,
scm:
[
$class
:
'GitSCM'
,
branches:
[[
name:
'${sha1}'
]],
doGenerateSubmoduleConfigurations:
false
,
extensions:
[],
submoduleCfg:
[],
userRemoteConfigs:
[[
credentialsId:
'jenkins-worker'
,
refspec:
'+refs/heads/*:refs/remotes/origin/* +refs/pull/*:refs/remotes/origin/pr/*'
,
url:
'git@github.com:edx/edx-platform.git'
]]]
console_output
=
sh
(
returnStdout:
true
,
script:
'bash scripts/all-tests.sh'
).
trim
()
dir
(
'stdout'
)
{
writeFile
file:
"${TEST_SUITE}-${SHARD}-stdout.log"
,
text:
console_output
}
stash
includes:
'reports/**/*coverage*'
,
name:
"${TEST_SUITE}-${SHARD}-reports"
}
}
}
def
savePythonTestArtifacts
()
{
archiveArtifacts
allowEmptyArchive:
true
,
artifacts:
'reports/**/*,test_root/log/**/*.log,**/nosetests.xml,stdout/*.log,*.log'
junit
'**/nosetests.xml'
}
pipeline
{
agent
{
label
"coverage-worker"
}
options
{
timestamps
()
timeout
(
75
)
}
stages
{
stage
(
'Run Tests'
)
{
parallel
{
stage
(
'lms-unit-1'
)
{
agent
{
label
"jenkins-worker"
}
environment
{
SHARD
=
1
TEST_SUITE
=
'lms-unit'
}
steps
{
script
{
runPythonTests
()
}
}
post
{
always
{
script
{
savePythonTestArtifacts
()
}
}
}
}
stage
(
'lms-unit-2'
)
{
agent
{
label
"jenkins-worker"
}
environment
{
SHARD
=
2
TEST_SUITE
=
'lms-unit'
}
steps
{
script
{
runPythonTests
()
}
}
post
{
always
{
script
{
savePythonTestArtifacts
()
}
}
}
}
stage
(
'lms-unit-3'
)
{
agent
{
label
"jenkins-worker"
}
environment
{
SHARD
=
3
TEST_SUITE
=
'lms-unit'
}
steps
{
script
{
runPythonTests
()
}
}
post
{
always
{
script
{
savePythonTestArtifacts
()
}
}
}
}
stage
(
'lms-unit-4'
)
{
agent
{
label
"jenkins-worker"
}
environment
{
SHARD
=
4
TEST_SUITE
=
'lms-unit'
}
steps
{
script
{
runPythonTests
()
}
}
post
{
always
{
script
{
savePythonTestArtifacts
()
}
}
}
}
stage
(
'lms-unit-5'
)
{
agent
{
label
"jenkins-worker"
}
environment
{
SHARD
=
5
TEST_SUITE
=
'lms-unit'
}
steps
{
script
{
runPythonTests
()
}
}
post
{
always
{
script
{
savePythonTestArtifacts
()
}
}
}
}
stage
(
'lms-unit-6'
)
{
agent
{
label
"jenkins-worker"
}
environment
{
SHARD
=
6
TEST_SUITE
=
'lms-unit'
}
steps
{
script
{
runPythonTests
()
}
}
post
{
always
{
script
{
savePythonTestArtifacts
()
}
}
}
}
stage
(
'lms-unit-7'
)
{
agent
{
label
"jenkins-worker"
}
environment
{
SHARD
=
7
TEST_SUITE
=
'lms-unit'
}
steps
{
script
{
runPythonTests
()
}
}
post
{
always
{
script
{
savePythonTestArtifacts
()
}
}
}
}
stage
(
'lms-unit-8'
)
{
agent
{
label
"jenkins-worker"
}
environment
{
SHARD
=
8
TEST_SUITE
=
'lms-unit'
}
steps
{
script
{
runPythonTests
()
}
}
post
{
always
{
script
{
savePythonTestArtifacts
()
}
}
}
}
stage
(
'lms-unit-9'
)
{
agent
{
label
"jenkins-worker"
}
environment
{
SHARD
=
9
TEST_SUITE
=
'lms-unit'
}
steps
{
script
{
runPythonTests
()
}
}
post
{
always
{
script
{
savePythonTestArtifacts
()
}
}
}
}
stage
(
'lms-unit-10'
)
{
agent
{
label
"jenkins-worker"
}
environment
{
SHARD
=
10
TEST_SUITE
=
'lms-unit'
}
steps
{
script
{
runPythonTests
()
}
}
post
{
always
{
script
{
savePythonTestArtifacts
()
}
}
}
}
stage
(
'cms-unit-1'
)
{
agent
{
label
"jenkins-worker"
}
environment
{
SHARD
=
1
TEST_SUITE
=
'cms-unit'
}
steps
{
script
{
runPythonTests
()
}
}
post
{
always
{
script
{
savePythonTestArtifacts
()
}
}
}
}
stage
(
'cms-unit-2'
)
{
agent
{
label
"jenkins-worker"
}
environment
{
SHARD
=
2
TEST_SUITE
=
'cms-unit'
}
steps
{
script
{
runPythonTests
()
}
}
post
{
always
{
script
{
savePythonTestArtifacts
()
}
}
}
}
stage
(
'commonlib-unit-1'
)
{
agent
{
label
"jenkins-worker"
}
environment
{
SHARD
=
1
TEST_SUITE
=
'commonlib-unit'
}
steps
{
script
{
runPythonTests
()
}
}
post
{
always
{
script
{
savePythonTestArtifacts
()
}
}
}
}
stage
(
'commonlib-unit-2'
)
{
agent
{
label
"jenkins-worker"
}
environment
{
SHARD
=
2
TEST_SUITE
=
'commonlib-unit'
}
steps
{
script
{
runPythonTests
()
}
}
post
{
always
{
script
{
savePythonTestArtifacts
()
}
}
}
}
stage
(
'commonlib-unit-3'
)
{
agent
{
label
"jenkins-worker"
}
environment
{
SHARD
=
3
TEST_SUITE
=
'commonlib-unit'
}
steps
{
script
{
runPythonTests
()
}
}
post
{
always
{
script
{
savePythonTestArtifacts
()
}
}
}
}
}
}
stage
(
'Run coverage'
)
{
environment
{
CODE_COV_TOKEN
=
credentials
(
'CODE_COV_TOKEN'
)
TARGET_BRANCH
=
"origin/master"
CI_BRANCH
=
"${ghprbSourceBranch}"
SUBSET_JOB
=
"null"
// Keep this variable until we can remove the $SUBSET_JOB path from .coveragerc
}
steps
{
ansiColor
(
'gnome-terminal'
)
{
sshagent
(
credentials:
[
'jenkins-worker'
],
ignoreMissing:
true
)
{
checkout
changelog:
false
,
poll:
false
,
scm:
[
$class
:
'GitSCM'
,
branches:
[[
name:
'${sha1}'
]],
doGenerateSubmoduleConfigurations:
false
,
extensions:
[],
submoduleCfg:
[],
userRemoteConfigs:
[[
credentialsId:
'jenkins-worker'
,
refspec:
'+refs/heads/*:refs/remotes/origin/* +refs/pull/*:refs/remotes/origin/pr/*'
,
url:
'git@github.com:edx/edx-platform.git'
]]]
unstash
'lms-unit-1-reports'
unstash
'lms-unit-2-reports'
unstash
'lms-unit-3-reports'
unstash
'lms-unit-4-reports'
unstash
'lms-unit-5-reports'
unstash
'lms-unit-6-reports'
unstash
'lms-unit-7-reports'
unstash
'lms-unit-8-reports'
unstash
'lms-unit-9-reports'
unstash
'lms-unit-10-reports'
unstash
'cms-unit-1-reports'
unstash
'cms-unit-2-reports'
unstash
'commonlib-unit-1-reports'
unstash
'commonlib-unit-2-reports'
unstash
'commonlib-unit-3-reports'
sh
"./scripts/jenkins-report.sh"
}
}
}
post
{
always
{
publishHTML
([
allowMissing:
false
,
alwaysLinkToLastBuild:
false
,
keepAll:
true
,
reportDir:
'reports'
,
reportFiles:
'diff_coverage_combined.html'
,
reportName:
'Diff Coverage Report'
,
reportTitles:
''
])
publishHTML
([
allowMissing:
false
,
alwaysLinkToLastBuild:
false
,
keepAll:
true
,
reportDir:
'reports/cover'
,
reportFiles:
'index.html'
,
reportName:
'Coverage.py Report'
,
reportTitles:
''
])
}
}
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment