Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separated out tests in a different GHA workflow #84

Closed
wants to merge 10 commits into from
Closed
8 changes: 4 additions & 4 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and Test Plugin
name: Build Plugin

on:
push:
Expand Down Expand Up @@ -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 }}

Expand All @@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just wondering, why not use gradlew build here?

Copy link
Member Author

@owaiskazi19 owaiskazi19 Oct 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can. I don't have any strong opinion here. We had check before I kept the same.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am good with either, ./gradlew build means we also run assemble which runs the :compileJava, :processResources which check does also but this does it into a jar.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed it to build.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should step back and figure out all the dependencies and figure out what we are trying to optimize here. With the current PR we're shifting the tests somewhere else (still in series so not really gaining much) but duplicating compile/build stuff in parallel.

My general preference would be for CI to keep all the check stuff and test and code coverage bits, and just spin off the integ tests and yaml tests into another job in parallel (or just put them in the CI yaml at the top level under "jobs").

Lots of different ways to do it, haven't really been convinced we have a problem that needs solving yet :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with you. I will go ahead and close the PR. We can always come back and open it back when the plugin becomes heavy.

if: matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v3
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -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
Loading