From b779141e15d90cd7e739fc427e7b357c7b2ee081 Mon Sep 17 00:00:00 2001 From: jhartmann Date: Fri, 21 Jun 2024 15:19:57 +0200 Subject: [PATCH 1/4] chore(workflows):[#371] add workaround cucumber report token replacement --- .github/workflows/cucumber-integration-test.yaml | 6 +++++- .../org/eclipse/tractusx/irs/cucumber/RunCucumberTest.java | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cucumber-integration-test.yaml b/.github/workflows/cucumber-integration-test.yaml index 2126c93385..e7a0ac6501 100644 --- a/.github/workflows/cucumber-integration-test.yaml +++ b/.github/workflows/cucumber-integration-test.yaml @@ -40,7 +40,11 @@ jobs: ADMIN_USER_API_KEY: ${{ secrets.adminUserApiKey }} ISSUE_FILTER: ${{ inputs.executionFilter }} CUCUMBER_PUBLISH_TOKEN: ${{ secrets.cucumberPublishToken }} - run: mvn clean verify -P cucumber -Dgroups="$ISSUE_FILTER" -pl irs-cucumber-tests -am --batch-mode 2> irs-cucumber-tests/report-banner.txt + # workaround replacement since injecting the token via environment variable does not work + run: | + sed -i "s//${CUCUMBER_PUBLISH_TOKEN}/g" irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/RunCucumberTest.java + + mvn clean verify -P cucumber -Dgroups="$ISSUE_FILTER" -pl irs-cucumber-tests -am --batch-mode 2> irs-cucumber-tests/report-banner.txt - name: Publish Cucumber Results uses: EnricoMi/publish-unit-test-result-action@v2.16.1 diff --git a/irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/RunCucumberTest.java b/irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/RunCucumberTest.java index df211207f2..9143bd4cbb 100644 --- a/irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/RunCucumberTest.java +++ b/irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/RunCucumberTest.java @@ -22,7 +22,7 @@ import static io.cucumber.junit.platform.engine.Constants.ANSI_COLORS_DISABLED_PROPERTY_NAME; import static io.cucumber.junit.platform.engine.Constants.GLUE_PROPERTY_NAME; import static io.cucumber.junit.platform.engine.Constants.PLUGIN_PROPERTY_NAME; -import static io.cucumber.junit.platform.engine.Constants.PLUGIN_PUBLISH_ENABLED_PROPERTY_NAME; +import static io.cucumber.junit.platform.engine.Constants.PLUGIN_PUBLISH_TOKEN_PROPERTY_NAME; import org.junit.platform.suite.api.ConfigurationParameter; import org.junit.platform.suite.api.IncludeEngines; @@ -33,7 +33,7 @@ @IncludeEngines("cucumber") @SelectPackages("org.eclipse.tractusx.irs.cucumber") @ConfigurationParameter(key = GLUE_PROPERTY_NAME, value = "org.eclipse.tractusx.irs.cucumber") -@ConfigurationParameter(key = PLUGIN_PUBLISH_ENABLED_PROPERTY_NAME, value = "true") +@ConfigurationParameter(key = PLUGIN_PUBLISH_TOKEN_PROPERTY_NAME, value = "") @ConfigurationParameter(key = ANSI_COLORS_DISABLED_PROPERTY_NAME, value = "true") @ConfigurationParameter(key = PLUGIN_PROPERTY_NAME, value = "pretty,junit:target/cucumber-junit-report.xml,html:target/report.html") From 0fa32b92075c89ed74f4431f1e00f8e0f39cb41c Mon Sep 17 00:00:00 2001 From: jhartmann Date: Fri, 21 Jun 2024 15:49:04 +0200 Subject: [PATCH 2/4] chore(workflows):[#371] add workaround cucumber report token replacement --- .github/workflows/cucumber-integration-test.yaml | 2 +- .../java/org/eclipse/tractusx/irs/cucumber/RunCucumberTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cucumber-integration-test.yaml b/.github/workflows/cucumber-integration-test.yaml index e7a0ac6501..3bc12a0383 100644 --- a/.github/workflows/cucumber-integration-test.yaml +++ b/.github/workflows/cucumber-integration-test.yaml @@ -42,7 +42,7 @@ jobs: CUCUMBER_PUBLISH_TOKEN: ${{ secrets.cucumberPublishToken }} # workaround replacement since injecting the token via environment variable does not work run: | - sed -i "s//${CUCUMBER_PUBLISH_TOKEN}/g" irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/RunCucumberTest.java + sed -i "s/CUCUMBER_TOKEN_IRS_PLACEHOLDER/${CUCUMBER_PUBLISH_TOKEN}/g" irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/RunCucumberTest.java mvn clean verify -P cucumber -Dgroups="$ISSUE_FILTER" -pl irs-cucumber-tests -am --batch-mode 2> irs-cucumber-tests/report-banner.txt diff --git a/irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/RunCucumberTest.java b/irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/RunCucumberTest.java index 9143bd4cbb..044469b9f4 100644 --- a/irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/RunCucumberTest.java +++ b/irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/RunCucumberTest.java @@ -33,7 +33,7 @@ @IncludeEngines("cucumber") @SelectPackages("org.eclipse.tractusx.irs.cucumber") @ConfigurationParameter(key = GLUE_PROPERTY_NAME, value = "org.eclipse.tractusx.irs.cucumber") -@ConfigurationParameter(key = PLUGIN_PUBLISH_TOKEN_PROPERTY_NAME, value = "") +@ConfigurationParameter(key = PLUGIN_PUBLISH_TOKEN_PROPERTY_NAME, value = "CUCUMBER_TOKEN_IRS_PLACEHOLDER") @ConfigurationParameter(key = ANSI_COLORS_DISABLED_PROPERTY_NAME, value = "true") @ConfigurationParameter(key = PLUGIN_PROPERTY_NAME, value = "pretty,junit:target/cucumber-junit-report.xml,html:target/report.html") From c956eaf2cca1b550ec9d75f1087ee3407fa7fc50 Mon Sep 17 00:00:00 2001 From: jhartmann Date: Fri, 21 Jun 2024 16:19:34 +0200 Subject: [PATCH 3/4] chore(workflows):[#371] add workaround cucumber report token replacement --- .../java/org/eclipse/tractusx/irs/cucumber/RunCucumberTest.java | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/RunCucumberTest.java b/irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/RunCucumberTest.java index 044469b9f4..ac1fd087f3 100644 --- a/irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/RunCucumberTest.java +++ b/irs-cucumber-tests/src/test/java/org/eclipse/tractusx/irs/cucumber/RunCucumberTest.java @@ -29,7 +29,7 @@ import org.junit.platform.suite.api.SelectPackages; import org.junit.platform.suite.api.Suite; -@Suite +@Suite(failIfNoTests = false) @IncludeEngines("cucumber") @SelectPackages("org.eclipse.tractusx.irs.cucumber") @ConfigurationParameter(key = GLUE_PROPERTY_NAME, value = "org.eclipse.tractusx.irs.cucumber") diff --git a/pom.xml b/pom.xml index 206cffe376..c2a3bd8350 100644 --- a/pom.xml +++ b/pom.xml @@ -335,7 +335,7 @@ org.apache.maven.plugins maven-surefire-plugin - INTEGRATION_TEST,INACTIVE + INTEGRATION_TEST,INACTIVE,Ignore cucumber.execution.dry-run=true From a8b312ea70e28cb2bfd86d2d60b48cc4e4066847 Mon Sep 17 00:00:00 2001 From: jhartmann Date: Fri, 21 Jun 2024 16:23:54 +0200 Subject: [PATCH 4/4] chore(workflows):[#371] add cucumber report to github step summary --- .github/workflows/cucumber-integration-test.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cucumber-integration-test.yaml b/.github/workflows/cucumber-integration-test.yaml index 3bc12a0383..6e417a74fe 100644 --- a/.github/workflows/cucumber-integration-test.yaml +++ b/.github/workflows/cucumber-integration-test.yaml @@ -60,6 +60,7 @@ jobs: grep -E "^│.*│$" irs-cucumber-tests/report-banner.txt > irs-cucumber-tests/cucumber-report.txt sed -i 's/│//g' irs-cucumber-tests/cucumber-report.txt cat irs-cucumber-tests/cucumber-report.txt + cat irs-cucumber-tests/cucumber-report.txt >> $GITHUB_STEP_SUMMARY - name: Find previous comment in PR if: always() && github.event_name == 'pull_request'