ci: unit tests in jenkins

This commit is contained in:
Alexander Engelsberger 2021-11-05 14:30:08 +01:00
parent 59037e1a50
commit d11ab71b7e
No known key found for this signature in database
GPG Key ID: BE3F5909FF0D83E3
5 changed files with 42 additions and 11 deletions

5
.ci/python310.Dockerfile Normal file
View File

@ -0,0 +1,5 @@
FROM python:3.9
RUN adduser --uid 1000 jenkins
USER jenkins

5
.ci/python36.Dockerfile Normal file
View File

@ -0,0 +1,5 @@
FROM python:3.6
RUN adduser --uid 1000 jenkins
USER jenkins

38
Jenkinsfile vendored
View File

@ -1,19 +1,37 @@
pipeline {
agent none
stages {
stage('Tests') {
agent {
docker {
image 'python:3.9'
args '--user 0:0'
parallel {
stage('3.6'){
agent{
dockerfile {
filename 'python36.Dockerfile'
dir '.ci'
}
}
steps {
sh 'pip install pip --upgrade --progress-bar off'
sh 'pip install .[all] --progress-bar off'
sh '~/.local/bin/pytest -v --junitxml=reports/result.xml --cov=prototorch/ --cov-report=xml:reports/coverage.xml'
cobertura coberturaReportFile: 'reports/coverage.xml'
junit 'reports/**/*.xml'
}
}
steps {
sh 'pip install pip --upgrade --progress-bar off'
sh 'pip install .[all] --progress-bar off'
stage('3.10'){
agent{
dockerfile {
filename 'python310.Dockerfile'
dir '.ci'
}
}
steps {
sh 'pip install pip --upgrade --progress-bar off'
sh 'pip install .[all] --progress-bar off'
sh '~/.local/bin/pytest -v --junitxml=reports/result.xml --cov=prototorch/ --cov-report=xml:reports/coverage.xml'
cobertura coberturaReportFile: 'reports/coverage.xml'
junit 'reports/**/*.xml'
}
}
}
}
}

View File

@ -43,7 +43,10 @@ EXAMPLES = [
"matplotlib",
"torchinfo",
]
TESTS = ["codecov", "pytest"]
TESTS = [
"pytest-cov",
"pytest",
]
ALL = DATASETS + DEV + DOCS + EXAMPLES + TESTS
setup(