diff --git a/utils/ci/Jenkinsfile b/utils/ci/Jenkinsfile index 2e89a20df3e202b6796c77457023383d65100946..dbc2bd2a4bc72c23fa4f4976942a565698bdf728 100644 --- a/utils/ci/Jenkinsfile +++ b/utils/ci/Jenkinsfile @@ -8,6 +8,8 @@ * * SPDX-License-Identifier: EPL-2.0 ********************************************************************************/ + // Needed for selectors +// import hudson.plugins.copyartifact.* pipeline { agent none @@ -98,22 +100,46 @@ spec: PYTHON_EXECUTABLE = 'python3' } stages { + stage('Linux: Cleanup') { + steps { + container('openpass-build') { + sh 'bash repo/utils/ci/scripts/prepare.sh' + } + } + } stage('Run E2E') { steps { - build job: 'opEnd2End_Test', parameters: [string(name: 'OPTESTRUNNER_URL', value: "${env.OPTESTRUNNER_URL}"), - string(name: 'GECCO_URL', value:"${env.GECCO_URL}"), - string(name: 'GTGEN_CLI_URL', value: "${env.GTGEN_CLI_URL}"), - string(name: 'GTGEN_SIM_URL', value: "${env.GTGEN_SIM_URL}")], - propagate: true + script { + def e2eDownStream = build(job: 'opEnd2End_Test', + parameters: [string(name: 'OPTESTRUNNER_URL', value: "${env.OPTESTRUNNER_URL}"), + string(name: 'GECCO_URL', value:"${env.GECCO_URL}"), + string(name: 'GTGEN_CLI_URL', value: "${env.GTGEN_CLI_URL}"), + string(name: 'GTGEN_SIM_URL', value: "${env.GTGEN_SIM_URL}")], + propagate: true, + wait: true) + echo "Copying artifacts from build #${e2eDownStream.number}" + def artifactUrl = "https://ci.eclipse.org/openpass/job/opEnd2End_Test/${e2eDownStream.number}/artifact/artifacts/openPASS_EndToEndTests.tar.gz" + def artifactTestUrl = "https://ci.eclipse.org/openpass/job/opEnd2End_Test/${e2eDownStream.number}/artifact/artifacts/test_end_to_end.html" + echo "artifact url is ${artifactUrl}" + sh """ + cd artifacts + wget --no-check-certificate "${artifactUrl}" + wget --no-check-certificate "${artifactTestUrl}" + """ + // copyArtifacts( + // projectName: 'opEnd2End_Test', + // selector: specific("${e2eDownStream.number}"), + // filter: '**/*.tar.gz', + // target: 'artifacts/' + // ) + } } } } post { always { script { - sh 'bash repo/utils/ci/scripts/90_pack_artifacts.sh' archiveArtifacts allowEmptyArchive: true, artifacts: 'artifacts/**', followSymlinks: false - junit allowEmptyResults: true, testResults: 'build/**/*Tests.xml,repo/sim/tests/endToEndTests/pyOpenPASS/result_*.xml' } } } diff --git a/utils/ci/Jenkinsfile.e2e b/utils/ci/Jenkinsfile.e2e index 9dbbb335aec709da5ec47cecf30d78b5a9a0bfb5..4ae14d11298e21fa0b2fc98cdecf4f2e73da2e78 100644 --- a/utils/ci/Jenkinsfile.e2e +++ b/utils/ci/Jenkinsfile.e2e @@ -37,44 +37,36 @@ pipeline { PYTHON_EXECUTABLE = 'python3' } stages { - stage('Testing') - { + stage('Linux: Cleanup') { steps { container('openpass-build') { - sh 'bash repo/utils/ci/scripts/testing.sh' + sh 'bash repo/utils/ci/scripts_e2e/10_prepare.sh' + } + } + } + stage('Linux: Fetch binaries') { + steps { + container('openpass-build') { + sh 'bash repo/utils/ci/scripts_e2e/pull_gecco.sh' + sh 'bash repo/utils/ci/scripts_e2e/pull_optestrunner.sh' + // sh 'bash repo/utils/ci/scripts_e2e/pull_gtgen.sh' + sh 'bash repo/utils/ci/scripts_e2e/build_gtgen.sh' + } + } + } + stage('Linux: Run E2E') { + steps { + container('openpass-build') { + sh 'bash repo/utils/ci/scripts_e2e/run_gtgen.sh' + sh 'bash repo/utils/ci/scripts_e2e/55_endtoend.sh' } } } - // stage('Linux: Cleanup') { - // steps { - // container('openpass-build') { - // sh 'bash repo/utils/ci/scripts/10_prepare.sh' - // } - // } - // } - // stage('Linux: Fetch binaries') { - // steps { - // container('openpass-build') { - // sh 'bash repo/utils/ci/scripts/pull_gecco.sh' - // sh 'bash repo/utils/ci/scripts/pull_optestrunner.sh' - // // sh 'bash repo/utils/ci/scripts/pull_gtgen.sh' - // sh 'bash repo/utils/ci/scripts/build_gtgen.sh' - // } - // } - // } - // stage('Linux: Run E2E') { - // steps { - // container('openpass-build') { - // sh 'bash repo/utils/ci/scripts/run_gtgen.sh' - // sh 'bash repo/utils/ci/scripts/55_endtoend.sh' - // } - // } - // } } post { always { script { - sh 'bash repo/utils/ci/scripts/90_pack_artifacts.sh' + sh 'bash repo/utils/ci/scripts_e2e/90_pack_artifacts.sh' archiveArtifacts allowEmptyArchive: true, artifacts: 'artifacts/**', followSymlinks: false junit allowEmptyResults: true, testResults: 'build/**/*Tests.xml,repo/sim/tests/endToEndTests/pyOpenPASS/result_*.xml' } diff --git a/utils/ci/scripts/prepare.sh b/utils/ci/scripts/prepare.sh new file mode 100755 index 0000000000000000000000000000000000000000..8b40484965ccae0933b2b4f54da7ab0996dcfacb --- /dev/null +++ b/utils/ci/scripts/prepare.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +################################################################################ +# Copyright (c) 2021 in-tech GmbH +# 2022-2025 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +# +# This program and the accompanying materials are made available under the +# terms of the Eclipse Public License 2.0 which is available at +# http://www.eclipse.org/legal/epl-2.0. +# +# SPDX-License-Identifier: EPL-2.0 +################################################################################ + +################################################################################ +# This script prepares building +################################################################################ + +MYDIR="$(dirname "$(readlink -f $0)")" +cd "$MYDIR/../../../.." || exit 1 + +if [ ! -d repo ]; then + echo "repo folder doesn't exist as expected. exiting." + exit 1 +fi + +# wipe build directories and pyOpenPASS results +rm -rf artifacts deps +mkdir artifacts +pwd +printenv + +exit 0 diff --git a/utils/ci/scripts/10_prepare.sh b/utils/ci/scripts_e2e/10_prepare.sh similarity index 100% rename from utils/ci/scripts/10_prepare.sh rename to utils/ci/scripts_e2e/10_prepare.sh diff --git a/utils/ci/scripts/55_endtoend.sh b/utils/ci/scripts_e2e/55_endtoend.sh similarity index 100% rename from utils/ci/scripts/55_endtoend.sh rename to utils/ci/scripts_e2e/55_endtoend.sh diff --git a/utils/ci/scripts/90_pack_artifacts.sh b/utils/ci/scripts_e2e/90_pack_artifacts.sh similarity index 100% rename from utils/ci/scripts/90_pack_artifacts.sh rename to utils/ci/scripts_e2e/90_pack_artifacts.sh diff --git a/utils/ci/scripts/build_gtgen.sh b/utils/ci/scripts_e2e/build_gtgen.sh similarity index 100% rename from utils/ci/scripts/build_gtgen.sh rename to utils/ci/scripts_e2e/build_gtgen.sh diff --git a/utils/ci/scripts/pull_gecco.sh b/utils/ci/scripts_e2e/pull_gecco.sh similarity index 100% rename from utils/ci/scripts/pull_gecco.sh rename to utils/ci/scripts_e2e/pull_gecco.sh diff --git a/utils/ci/scripts/pull_gtgen.sh b/utils/ci/scripts_e2e/pull_gtgen.sh similarity index 100% rename from utils/ci/scripts/pull_gtgen.sh rename to utils/ci/scripts_e2e/pull_gtgen.sh diff --git a/utils/ci/scripts/pull_optestrunner.sh b/utils/ci/scripts_e2e/pull_optestrunner.sh similarity index 100% rename from utils/ci/scripts/pull_optestrunner.sh rename to utils/ci/scripts_e2e/pull_optestrunner.sh diff --git a/utils/ci/scripts/run_gtgen.sh b/utils/ci/scripts_e2e/run_gtgen.sh similarity index 100% rename from utils/ci/scripts/run_gtgen.sh rename to utils/ci/scripts_e2e/run_gtgen.sh