|
| 1 | +#!/bin/bash -ex |
| 2 | +# |
| 3 | +# Copyright (c) 2021 Oracle and/or its affiliates. |
| 4 | +# |
| 5 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | +# you may not use this file except in compliance with the License. |
| 7 | +# You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, software |
| 12 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | +# See the License for the specific language governing permissions and |
| 15 | +# limitations under the License. |
| 16 | +# |
| 17 | + |
| 18 | +# Path to this script |
| 19 | +[ -h "${0}" ] && readonly SCRIPT_PATH="$(readlink "${0}")" || readonly SCRIPT_PATH="${0}" |
| 20 | + |
| 21 | +# Load pipeline environment setup and define WS_DIR |
| 22 | +. $(dirname -- "${SCRIPT_PATH}")/includes/pipeline-env.sh "${SCRIPT_PATH}" '../..' |
| 23 | + |
| 24 | +# Setup error handling using default settings (defined in includes/error_handlers.sh) |
| 25 | +error_trap_setup |
| 26 | + |
| 27 | +mvn ${MAVEN_ARGS} --version |
| 28 | + |
| 29 | +# Temporary workaround until job stages will share maven repository |
| 30 | +mvn ${MAVEN_ARGS} -f ${WS_DIR}/pom.xml \ |
| 31 | + install -e \ |
| 32 | + -Dmaven.test.skip=true \ |
| 33 | + -DskipTests \ |
| 34 | + -Ppipeline |
| 35 | + |
| 36 | +# Run native image tests |
| 37 | +cd ${WS_DIR}/tests/integration/native-image |
| 38 | + |
| 39 | +# Prime build all native-image tests |
| 40 | +mvn ${MAVEN_ARGS} -e clean install |
| 41 | + |
| 42 | +# Build jlink images |
| 43 | +# mp-2 fails because of https://github.com/oracle/helidon-build-tools/issues/478 |
| 44 | +readonly native_image_tests="se-1 mp-1 mp-3" |
| 45 | +for native_test in ${native_image_tests}; do |
| 46 | + cd ${WS_DIR}/tests/integration/native-image/${native_test} |
| 47 | + mvn ${MAVEN_ARGS} package -e -Pjlink-image,staging -Djlink.image.addClassDataSharingArchive=false -Djlink.image.testImage=false |
| 48 | +done |
| 49 | + |
| 50 | +# Run tests with classpath and then module path |
| 51 | + |
| 52 | +# Run SE-1 (does not contain module-info.java) |
| 53 | +cd ${WS_DIR}/tests/integration/native-image/se-1 |
| 54 | +jri_dir=${WS_DIR}/tests/integration/native-image/se-1/target/helidon-tests-native-image-se-1-jri |
| 55 | + |
| 56 | +# Classpath |
| 57 | +${jri_dir}/bin/start --test |
| 58 | + |
| 59 | +# Run MP-1 |
| 60 | +cd ${WS_DIR}/tests/integration/native-image/mp-1 |
| 61 | +jri_dir=${WS_DIR}/tests/integration/native-image/mp-1/target/helidon-tests-native-image-mp-1-jri |
| 62 | + |
| 63 | +# Classpath |
| 64 | +${jri_dir}/bin/start |
| 65 | + |
| 66 | +# Module Path |
| 67 | +${jri_dir}/bin/java \ |
| 68 | + --module-path ${jri_dir}/app/helidon-tests-native-image-mp-1.jar:${jri_dir}/app/libs \ |
| 69 | + --module helidon.tests.nimage.mp/io.helidon.tests.integration.nativeimage.mp1.Mp1Main |
| 70 | + |
| 71 | +# Run MP-3 (just start and stop) |
| 72 | +cd ${WS_DIR}/tests/integration/native-image/mp-3 |
| 73 | +jri_dir=${WS_DIR}/tests/integration/native-image/mp-3/target/helidon-tests-native-image-mp-3-jri |
| 74 | + |
| 75 | +# Classpath |
| 76 | +${jri_dir}/bin/start --test |
| 77 | + |
| 78 | +# Module Path |
| 79 | +${jri_dir}/bin/java -Dexit.on.started=! \ |
| 80 | + --module-path ${jri_dir}/app/helidon-tests-native-image-mp-3.jar:${jri_dir}/app/libs \ |
| 81 | + --add-modules helidon.tests.nimage.quickstartmp \ |
| 82 | + --module io.helidon.microprofile.cdi/io.helidon.microprofile.cdi.Main |
0 commit comments