From 757c53d7871e006e92e43ef85f8b6c7f3f4fdce2 Mon Sep 17 00:00:00 2001 From: jannahsherif <144076374+jannahsherif@users.noreply.github.com> Date: Thu, 25 Jul 2024 18:43:57 +0300 Subject: [PATCH] negative cases for SE 8 tomee nightly.yml --- .github/workflows/nightly.yml | 80 ++++++++++++++++++++++++++++++++++- 1 file changed, 79 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 38c6445..bcd5b28 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -254,7 +254,7 @@ jobs: docker rmi test-image rm -rf app/payara - - name: Run Archetype for EE, SE 8, TomEE + - name: Run Archetype for EE 8, SE 8, TomEE run: | mvn archetype:generate -DinteractiveMode=false -DaskForDefaultPropertyValues=false -DarchetypeGroupId=org.eclipse.starter -DarchetypeArtifactId=jakarta-starter -DarchetypeVersion=2.3.0-SNAPSHOT -DjakartaVersion=8 -DjavaVersion=8 -Druntime=tomee -DoutputDirectory=app/tomee -Dgoals="clean package" | tee mvn_output.txt @@ -279,6 +279,84 @@ jobs: docker rmi test-image rm -rf app/tomee + - name: Run Archetype for EE 9, SE 8, TomEE + run: | + mvn archetype:generate -DinteractiveMode=false -DaskForDefaultPropertyValues=false -DarchetypeGroupId=org.eclipse.starter -DarchetypeArtifactId=jakarta-starter -DarchetypeVersion=2.3.0-SNAPSHOT -DjakartaVersion=9 -DjavaVersion=8 -Druntime=tomee -DoutputDirectory=app/tomee -Dgoals="clean package" | tee mvn_output.txt + + MAVEN_EXIT_CODE=${PIPESTATUS[0]} + ERROR_MESSAGE="TomEE requires Web Profile and Jakarta EE 8 or 9.1." + if ! { [ $MAVEN_EXIT_CODE -ne 0 ] && grep -q "$ERROR_MESSAGE" mvn_output.txt; }; then + echo "Maven build did not fail, or the expected error message was not found. Test failed." + exit 1 + fi + + rm -f mvn_output.txt + + - name: Run Archetype for EE 9.1, SE 8, TomEE + run: | + mvn archetype:generate -DinteractiveMode=false -DaskForDefaultPropertyValues=false -DarchetypeGroupId=org.eclipse.starter -DarchetypeArtifactId=jakarta-starter -DarchetypeVersion=2.3.0-SNAPSHOT -DjakartaVersion=9.1 -DjavaVersion=8 -Druntime=tomee -DoutputDirectory=app/tomee -Dgoals="clean package" | tee mvn_output.txt + + MAVEN_EXIT_CODE=${PIPESTATUS[0]} + ERROR_MESSAGE="TomEE requires Web Profile and Jakarta EE 8 or 9.1." + if ! { [ $MAVEN_EXIT_CODE -ne 0 ] && grep -q "$ERROR_MESSAGE" mvn_output.txt; }; then + echo "Maven build did not fail, or the expected error message was not found. Test failed." + exit 1 + fi + + rm -f mvn_output.txt + + - name: Run Archetype for EE 9.1 Web Profile, SE 8, TomEE + run: | + mvn archetype:generate -DinteractiveMode=false -DaskForDefaultPropertyValues=false -DarchetypeGroupId=org.eclipse.starter -DarchetypeArtifactId=jakarta-starter -DarchetypeVersion=2.3.0-SNAPSHOT -DjakartaVersion=9.1 -Dprofile=web -DjavaVersion=8 -Druntime=tomee -DoutputDirectory=app/tomee -Dgoals="clean package" | tee mvn_output.txt + + MAVEN_EXIT_CODE=${PIPESTATUS[0]} + ERROR_MESSAGE="TomEE requires Web Profile and Jakarta EE 8 or 9.1." + if ! { [ $MAVEN_EXIT_CODE -ne 0 ] && grep -q "$ERROR_MESSAGE" mvn_output.txt; }; then + echo "Maven build did not fail, or the expected error message was not found. Test failed." + exit 1 + fi + + rm -f mvn_output.txt + + - name: Run Archetype for EE 10, SE 8, TomEE + run: | + mvn archetype:generate -DinteractiveMode=false -DaskForDefaultPropertyValues=false -DarchetypeGroupId=org.eclipse.starter -DarchetypeArtifactId=jakarta-starter -DarchetypeVersion=2.3.0-SNAPSHOT -DjakartaVersion=10 -DjavaVersion=8 -Druntime=tomee -DoutputDirectory=app/tomee -Dgoals="clean package" | tee mvn_output.txt + + MAVEN_EXIT_CODE=${PIPESTATUS[0]} + ERROR_MESSAGE="TomEE requires Web Profile and Jakarta EE 8 or 9.1." + if ! { [ $MAVEN_EXIT_CODE -ne 0 ] && grep -q "$ERROR_MESSAGE" mvn_output.txt; }; then + echo "Maven build did not fail, or the expected error message was not found. Test failed." + exit 1 + fi + + rm -f mvn_output.txt + + - name: Run Archetype for EE 10 Web Profile, SE 8, TomEE + run: | + mvn archetype:generate -DinteractiveMode=false -DaskForDefaultPropertyValues=false -DarchetypeGroupId=org.eclipse.starter -DarchetypeArtifactId=jakarta-starter -DarchetypeVersion=2.3.0-SNAPSHOT -DjakartaVersion=10 -Dprofile=web -DjavaVersion=8 -Druntime=tomee -DoutputDirectory=app/tomee -Dgoals="clean package" | tee mvn_output.txt + + MAVEN_EXIT_CODE=${PIPESTATUS[0]} + ERROR_MESSAGE="TomEE requires Web Profile and Jakarta EE 8 or 9.1." + if ! { [ $MAVEN_EXIT_CODE -ne 0 ] && grep -q "$ERROR_MESSAGE" mvn_output.txt; }; then + echo "Maven build did not fail, or the expected error message was not found. Test failed." + exit 1 + fi + + rm -f mvn_output.txt + + - name: Run Archetype for EE 10 Core Profile, SE 8, TomEE + run: | + mvn archetype:generate -DinteractiveMode=false -DaskForDefaultPropertyValues=false -DarchetypeGroupId=org.eclipse.starter -DarchetypeArtifactId=jakarta-starter -DarchetypeVersion=2.3.0-SNAPSHOT -DjakartaVersion=10 -Dprofile=core -DjavaVersion=8 -Druntime=tomee -DoutputDirectory=app/tomee -Dgoals="clean package" | tee mvn_output.txt + + MAVEN_EXIT_CODE=${PIPESTATUS[0]} + ERROR_MESSAGE="Core Profile only available for Jakarta EE 10 and later." + if ! { [ $MAVEN_EXIT_CODE -ne 0 ] && grep -q "$ERROR_MESSAGE" mvn_output.txt; }; then + echo "Maven build did not fail, or the expected error message was not found. Test failed." + exit 1 + fi + + rm -f mvn_output.txt + - name: Run Archetype for EE 8, SE 8, WebLogic run: | mvn archetype:generate -DinteractiveMode=false -DaskForDefaultPropertyValues=false -DarchetypeGroupId=org.eclipse.starter -DarchetypeArtifactId=jakarta-starter -DarchetypeVersion=2.3.0-SNAPSHOT -DjakartaVersion=8 -DjavaVersion=8 -Druntime=weblogic -DoutputDirectory=app/weblogic -Dgoals="clean package" | tee mvn_output.txt