From 0dc2d2a9d5b4bd96ae4ac9c99d357c4acd11af06 Mon Sep 17 00:00:00 2001 From: normanj-bitquill <78755797+normanj-bitquill@users.noreply.github.com> Date: Fri, 14 Feb 2025 16:24:40 -0800 Subject: [PATCH] Move end-to-end tests to a separate workflow (#1052) Signed-off-by: Norman Jordan --- .../workflows/end-to-end-test-workflow.yml | 40 +++++++++++++++++++ .github/workflows/test-and-build-workflow.yml | 2 +- .../spark/e2e/EndToEndITSuite.scala | 2 +- 3 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/end-to-end-test-workflow.yml diff --git a/.github/workflows/end-to-end-test-workflow.yml b/.github/workflows/end-to-end-test-workflow.yml new file mode 100644 index 000000000..b5b416034 --- /dev/null +++ b/.github/workflows/end-to-end-test-workflow.yml @@ -0,0 +1,40 @@ +name: End-to-End Tests + +on: + pull_request: + push: + +jobs: + build: + strategy: + fail-fast: false + matrix: + entry: + - { os: ubuntu-latest, java: 11 } + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Set up JDK 11 + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: 11 + + - name: Set up SBT + uses: sbt/setup-sbt@v1 + + - name: Set SBT_OPTS + # Needed to extend the JVM memory size to avoid OutOfMemoryError for HTML test report + run: echo "SBT_OPTS=-Xmx2G" >> $GITHUB_ENV + + - name: End-to-End Test + run: sbt e2etest/test + + - name: Upload test report + if: always() # Ensures the artifact is saved even if tests fail + uses: actions/upload-artifact@v4 + with: + name: test-reports + path: target/test-reports # Adjust this path if necessary \ No newline at end of file diff --git a/.github/workflows/test-and-build-workflow.yml b/.github/workflows/test-and-build-workflow.yml index 2d69fd406..17cbb923c 100644 --- a/.github/workflows/test-and-build-workflow.yml +++ b/.github/workflows/test-and-build-workflow.yml @@ -33,7 +33,7 @@ jobs: run: echo "SBT_OPTS=-Xmx2G" >> $GITHUB_ENV - name: Integ Test - run: sbt integtest/integration e2etest/test + run: sbt integtest/integration - name: Upload test report if: always() # Ensures the artifact is saved even if tests fail diff --git a/e2e-test/src/test/scala/org/opensearch/spark/e2e/EndToEndITSuite.scala b/e2e-test/src/test/scala/org/opensearch/spark/e2e/EndToEndITSuite.scala index 7bf398203..970404f77 100644 --- a/e2e-test/src/test/scala/org/opensearch/spark/e2e/EndToEndITSuite.scala +++ b/e2e-test/src/test/scala/org/opensearch/spark/e2e/EndToEndITSuite.scala @@ -86,7 +86,7 @@ class EndToEndITSuite extends AnyFlatSpec with TableDrivenPropertyChecks with Be } } }.start() - val completed = dockerProcess.waitFor(30, TimeUnit.MINUTES) + val completed = dockerProcess.waitFor(20, TimeUnit.MINUTES) stopReading = true if (!completed) { throw new IllegalStateException("Unable to start docker cluster")