Skip to content
This repository was archived by the owner on Jan 12, 2023. It is now read-only.

Commit

Permalink
Use relative path
Browse files Browse the repository at this point in the history
  • Loading branch information
GoebelL committed Dec 17, 2021
1 parent 0092cea commit 9b377ed
Showing 1 changed file with 38 additions and 17 deletions.
55 changes: 38 additions & 17 deletions tests/portal-integration-tests.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ def execute() {
script: 'echo $AUTH_MODE;',
returnStdout: true
).trim()

def _prepareBuildTools = {
stage('Build - pull build tools') {
docker.image("${DOCKER_REGISTRY}/${DOCKER_ORGANIZATION}/oscm-maven:${DOCKER_TAG}").pull()
sh(
'docker tag ${DOCKER_REGISTRY}/${DOCKER_ORGANIZATION}/oscm-maven:${DOCKER_TAG} oscm-maven; '
docker.image("${DOCKER_REGISTRY}/${DOCKER_ORGANIZATION}/oscm-maven:${DOCKER_TAG}").pull()
sh(
'docker tag ${DOCKER_REGISTRY}/${DOCKER_ORGANIZATION}/oscm-maven:${DOCKER_TAG} oscm-maven; '
)
}
}
Expand All @@ -40,20 +40,20 @@ def execute() {
}
}
}


def _setupTenant = {
stage('Test webservices - setup tenant') {
if (authMode == 'OIDC') {
try {
env.clientId = "${CLIENT_ID}"
env.clientSecret = "${CLIENT_SECRET}"
} catch (exc) {
withCredentials([string(credentialsId: 'UI-TESTS-CLIENT-ID', variable: 'CLIENT_ID'), string(credentialsId: 'UI-TESTS-CLIENT-SECRET', variable: 'CLIENT_SECRET')]) {
env.clientId = "${CLIENT_ID}"
env.clientSecret = "${CLIENT_SECRET}"
}
}
try {
env.clientId = "${CLIENT_ID}"
env.clientSecret = "${CLIENT_SECRET}"
} catch (exc) {
withCredentials([string(credentialsId: 'UI-TESTS-CLIENT-ID', variable: 'CLIENT_ID'), string(credentialsId: 'UI-TESTS-CLIENT-SECRET', variable: 'CLIENT_SECRET')]) {
env.clientId = "${CLIENT_ID}"
env.clientSecret = "${CLIENT_SECRET}"
}
}
sh "cp ${WORKSPACE}/docker/config/oscm-identity/tenants/tenant-default.properties.template ${WORKSPACE}/docker/config/oscm-identity/tenants/tenant-default.properties"

sh "sed -ri 's|oidc.authUrlScope=.*|oidc.authUrlScope=openid profile offline_access https://graph.microsoft.com/user.read.all https://graph.microsoft.com/group.readwrite.all https://graph.microsoft.com/directory.readwrite.all|g' ${WORKSPACE}/docker/config/oscm-identity/tenants/tenant-default.properties"
Expand Down Expand Up @@ -117,17 +117,37 @@ def execute() {
"-e MAVEN_OPTS=\"${MAVEN_OPTS} \" " +
"oscm-maven clean install -e -f /build/oscm-ui-tests/pom.xml"
}
}
}

def _publishReport = {
stage('Tests - publish ui test report') {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
user = sh(returnStdout: true, script: 'id -u').trim()
group = sh(returnStdout: true, script: 'id -g').trim()
sh "sleep 120"

sh "docker run " +
"--name maven-ui-tests-${BUILD_ID}-report " +
"--user $user:$group " +
"--rm " +
"--network host " +
"--add-host oscm-identity:127.0.0.1 " +
"-v ${WORKSPACE}:/build " +
" ${RUN_PROXY_ARGS} " +
"-e MAVEN_OPTS=\"${MAVEN_OPTS} \" " +
"oscm-maven site -DgenerateReports=false"
}
try {
sh "echo 'Archive test results from oscm-ui-tests/target/surefire-reports/*.xml'"
sh "echo 'Archive test results from oscm-ui-tests/target/site/**/*'"
} finally {
archiveArtifacts "oscm-ui-tests/target/surefire-reports/*.xml"
archiveArtifacts "oscm-ui-tests/target/site/**/*"
sh "echo 'done.'"
}
}
}



def _cleanUp = {
stage('Tests - clean up') {
sh "if [ \$(docker volume ls -qf dangling=true | wc -l) != '0' ]; then docker volume ls -qf dangling=true | xargs -r docker volume rm > /dev/null; fi"
Expand All @@ -140,6 +160,7 @@ def execute() {
_stopUnusedContainers()
_setupMaildevPorts()
_installUITests()
_publishReport()
_cleanUp()
}

Expand Down

0 comments on commit 9b377ed

Please sign in to comment.