From 632b450c81c9f8a84b2da9d00232f050bb2c2ec7 Mon Sep 17 00:00:00 2001 From: Owais Kazi Date: Wed, 11 Oct 2023 15:33:30 -0700 Subject: [PATCH 1/8] Separated out tests in a different GHA workflow Signed-off-by: Owais Kazi --- .github/workflows/CI.yml | 8 ++++---- .github/workflows/test.yml | 39 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 97a1f4827..38ce2fa8c 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -1,4 +1,4 @@ -name: Build and Test Plugin +name: Build Plugin on: push: @@ -34,7 +34,7 @@ jobs: - windows-latest java: - 17 - name: Build and Test Plugin Template + name: Build if: github.repository == 'opensearch-project/opensearch-ai-flow-framework' runs-on: ${{ matrix.os }} @@ -45,9 +45,9 @@ jobs: with: java-version: ${{ matrix.java }} distribution: temurin - - name: Build and Run Tests + - name: Build run: | - ./gradlew check + ./gradlew check -x test -x integTest -x yamlRestTest - name: Upload Coverage Report if: matrix.os == 'ubuntu-latest' uses: codecov/codecov-action@v3 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..33f6b4616 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,39 @@ +name: Test Plugin + +on: + push: + branches-ignore: + - 'whitesource-remediate/**' + pull_request: + types: [opened, synchronize, reopened] + +jobs: + strategy: + matrix: + os: + - ubuntu-latest + - macOS-latest + - windows-latest + java: + - 17 + test: + if: github.repository == 'opensearch-project/opensearch-ai-flow-framework' + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - name: Test + run: ./gradlew test + yamlRestTest: + if: github.repository == 'opensearch-project/opensearch-ai-flow-framework' + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - name: Test + run: ./gradlew yamlRestTest + integTest: + if: github.repository == 'opensearch-project/opensearch-ai-flow-framework' + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - name: Test + run: ./gradlew integTest From 72c8b988cd9fc65828f58cf91da352f283e3295f Mon Sep 17 00:00:00 2001 From: Owais Kazi Date: Thu, 12 Oct 2023 15:06:24 -0700 Subject: [PATCH 2/8] Handled code coverage for the PR Signed-off-by: Owais Kazi --- .github/workflows/CI.yml | 5 ---- .github/workflows/test.yml | 54 +++++++++++++++++++------------------- 2 files changed, 27 insertions(+), 32 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 38ce2fa8c..7cbf277c8 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -48,8 +48,3 @@ jobs: - name: Build run: | ./gradlew check -x test -x integTest -x yamlRestTest - - name: Upload Coverage Report - if: matrix.os == 'ubuntu-latest' - uses: codecov/codecov-action@v3 - with: - file: ./build/reports/jacoco/test/jacocoTestReport.xml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 33f6b4616..b395386ef 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,32 +8,32 @@ on: types: [opened, synchronize, reopened] jobs: - strategy: - matrix: - os: - - ubuntu-latest - - macOS-latest - - windows-latest - java: - - 17 test: + strategy: + matrix: + os: + - ubuntu-latest + - macOS-latest + - windows-latest + java: + - 17 if: github.repository == 'opensearch-project/opensearch-ai-flow-framework' - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v4 - - name: Test - run: ./gradlew test - yamlRestTest: - if: github.repository == 'opensearch-project/opensearch-ai-flow-framework' - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v4 - - name: Test - run: ./gradlew yamlRestTest - integTest: - if: github.repository == 'opensearch-project/opensearch-ai-flow-framework' - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v4 - - name: Test - run: ./gradlew integTest + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - name: Test + run: ./gradlew test + + - name: YamlRestTest + run: + ./gradlew yamlRestTest + + - name: integTest + run: + ./gradlew integTest + + - name: Upload Coverage Report + if: matrix.os == 'ubuntu-latest' + uses: codecov/codecov-action@v3 + with: + file: ./build/reports/jacoco/test/jacocoTestReport.xml From a441fd566eb52824a2a9817c526dce9cf16f36e3 Mon Sep 17 00:00:00 2001 From: Owais Kazi Date: Thu, 12 Oct 2023 16:26:33 -0700 Subject: [PATCH 3/8] Testing without MacOS Signed-off-by: Owais Kazi --- .github/workflows/test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b395386ef..24fa898b7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,7 +13,6 @@ jobs: matrix: os: - ubuntu-latest - - macOS-latest - windows-latest java: - 17 From d59127deda1dc54d2be66a5f6b2679ce401cc19b Mon Sep 17 00:00:00 2001 From: Owais Kazi Date: Thu, 12 Oct 2023 16:34:45 -0700 Subject: [PATCH 4/8] Setting up JDK 17 Signed-off-by: Owais Kazi --- .github/workflows/test.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 24fa898b7..7872b76e5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,6 +20,13 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 + + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: 17 + distribution: temurin + - name: Test run: ./gradlew test From 0c594dcff1c0b2ea1acbd2b7a10ccc22bf96cf1a Mon Sep 17 00:00:00 2001 From: Owais Kazi Date: Thu, 12 Oct 2023 16:38:45 -0700 Subject: [PATCH 5/8] Added macOS back Signed-off-by: Owais Kazi --- .github/workflows/test.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7872b76e5..83c20ca17 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,6 +13,7 @@ jobs: matrix: os: - ubuntu-latest + - macOS-latest - windows-latest java: - 17 @@ -21,10 +22,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up JDK 17 + - name: Set up JDK ${{ matrix.java }} uses: actions/setup-java@v3 with: - java-version: 17 + java-version: ${{ matrix.java }} distribution: temurin - name: Test From adf0352b85ed074b7b47dfd72d13742836073e60 Mon Sep 17 00:00:00 2001 From: Owais Kazi Date: Thu, 12 Oct 2023 16:48:52 -0700 Subject: [PATCH 6/8] Fixed codecov Signed-off-by: Owais Kazi --- .github/workflows/test.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 83c20ca17..71327182f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -39,6 +39,10 @@ jobs: run: ./gradlew integTest + - name: Run Tests with Coverage + run: + ./gradlew test jacocoTestReport --info + - name: Upload Coverage Report if: matrix.os == 'ubuntu-latest' uses: codecov/codecov-action@v3 From ea0028d304e7340e5299e9bb792a60735c61ac5e Mon Sep 17 00:00:00 2001 From: Owais Kazi Date: Thu, 12 Oct 2023 21:35:02 -0700 Subject: [PATCH 7/8] Addressed PR comments Signed-off-by: Owais Kazi --- .github/workflows/test.yml | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 71327182f..b09fe9841 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,6 +11,10 @@ jobs: test: strategy: matrix: + test: + - test jacocoTestReport + - integTest + - yamlRestTest os: - ubuntu-latest - macOS-latest @@ -29,19 +33,7 @@ jobs: distribution: temurin - name: Test - run: ./gradlew test - - - name: YamlRestTest - run: - ./gradlew yamlRestTest - - - name: integTest - run: - ./gradlew integTest - - - name: Run Tests with Coverage - run: - ./gradlew test jacocoTestReport --info + run: ./gradlew ${{ matrix.test }} - name: Upload Coverage Report if: matrix.os == 'ubuntu-latest' From dad496ba69651b213cd1ecc57597e0d04edd5e6d Mon Sep 17 00:00:00 2001 From: Owais Kazi Date: Fri, 13 Oct 2023 10:19:27 -0700 Subject: [PATCH 8/8] Addressed PR comments Signed-off-by: Owais Kazi --- .github/workflows/CI.yml | 4 +++- .github/workflows/test.yml | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 7cbf277c8..db28fea02 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -33,7 +33,9 @@ jobs: - macOS-latest - windows-latest java: + - 11 - 17 + - 20 name: Build if: github.repository == 'opensearch-project/opensearch-ai-flow-framework' runs-on: ${{ matrix.os }} @@ -47,4 +49,4 @@ jobs: distribution: temurin - name: Build run: | - ./gradlew check -x test -x integTest -x yamlRestTest + ./gradlew build -x test -x integTest -x yamlRestTest diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b09fe9841..6b228a9f7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,7 +20,9 @@ jobs: - macOS-latest - windows-latest java: + - 11 - 17 + - 20 if: github.repository == 'opensearch-project/opensearch-ai-flow-framework' runs-on: ${{ matrix.os }} steps: