Repository navigation
Expand file tree
/
Copy pathJenkinsfile-e2e
More file actions
92 lines (86 loc) · 3.5 KB
/
Copy pathJenkinsfile-e2e
File metadata and controls
92 lines (86 loc) · 3.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
pipeline {
agent { label 'worker' }
options {
timeout(time: 30, unit: 'MINUTES')
}
environment {
REPO_NAME = sh(returnStdout: true, script: 'basename `git remote get-url origin` .git').trim()
VERSION = sh(returnStdout: true, script: 'uv version --short').trim()
LATEST_AUTHOR = sh(returnStdout: true, script: 'git show -s --pretty=%an').trim()
LATEST_COMMIT_ID = sh(returnStdout: true, script: 'git describe --tags --long --always').trim()
MAIN_BRANCH_REGEX = /(^main$)/
}
stages {
stage('Setup') {
steps {
script {
echo REPO_NAME
echo LATEST_AUTHOR
echo LATEST_COMMIT_ID
echo VERSION
echo env.BUILD_NUMBER
echo env.TAG_NAME
}
script {
sh 'uv sync --locked --all-groups'
sh 'hurl --version'
}
}
}
stage('End-to-End HURL Test') {
environment {
HURL_VARIABLE_BASE_URL="https://api.heigit.org/ohsome-api-staging/v2"
}
steps {
script {
withCredentials([string(credentialsId: 'heigit-api-prod-key', variable: 'HURL_SECRET_API_KEY')]) {
sh 'hurl --delay 12000 --test tests-end-to-end/*.hurl'
}
}
}
post {
failure {
rocket_basicsend("End-to-End Tests on *${REPO_NAME}*-build nr. ${env.BUILD_NUMBER} on Branch - ${env.BRANCH_NAME} (<${env.BUILD_URL}|Open Build in Jenkins>) were *unsuccessful*. Latest commit from ${LATEST_AUTHOR}.")
}
}
}
stage('End-to-End Schemathesis Test') {
environment {
VIRTUAL_ENV="${WORKSPACE}/.venv"
PATH="${VIRTUAL_ENV}/bin:${PATH}"
OPENAPI_URL="https://api.heigit.org/ohsome-api-staging/v2/openapi.json"
}
steps {
script {
withCredentials([string(credentialsId: 'heigit-api-prod-key', variable: 'API_KEY')]) {
sh 'schemathesis run $OPENAPI_URL'
}
}
}
post {
failure {
rocket_basicsend("End-to-End Tests on *${REPO_NAME}*-build nr. ${env.BUILD_NUMBER} on Branch - ${env.BRANCH_NAME} (<${env.BUILD_URL}|Open Build in Jenkins>) were *unsuccessful*. Latest commit from ${LATEST_AUTHOR}.")
}
}
}
stage('End-to-End Docs Example Test') {
environment {
VIRTUAL_ENV="${WORKSPACE}/.venv"
PATH="${VIRTUAL_ENV}/bin:${PATH}"
OHSOME_API_URL="https://api.heigit.org/ohsome-api-staging/v2"
}
steps {
script {
withCredentials([string(credentialsId: 'heigit-api-prod-key', variable: 'OHSOME_API_KEY')]) {
sh 'pytest --maxfail=1 --no-cov docs/source/how-to-guides/examples/'
}
}
}
post {
failure {
rocket_basicsend("End-to-End Tests on *${REPO_NAME}*-build nr. ${env.BUILD_NUMBER} on Branch - ${env.BRANCH_NAME} (<${env.BUILD_URL}|Open Build in Jenkins>) were *unsuccessful*. Latest commit from ${LATEST_AUTHOR}.")
}
}
}
}
}