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
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 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,11 +45,6 @@ jobs:
with:
java-version: ${{ matrix.java }}
distribution: temurin
- name: Build and Run Tests
- name: Build
run: |
./gradlew check
- name: Upload Coverage Report
if: matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v3
with:
file: ./build/reports/jacoco/test/jacocoTestReport.xml
./gradlew check -x test -x integTest -x yamlRestTest
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.

42 changes: 42 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Test Plugin

on:
push:
branches-ignore:
- 'whitesource-remediate/**'
pull_request:
types: [opened, synchronize, reopened]

jobs:
test:
strategy:
matrix:
test:
- test jacocoTestReport
- integTest
- yamlRestTest
Copy link
Member

Choose a reason for hiding this comment

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

also just for understanding, what are yamlRestTests for?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's for testing the rest-api-spec yaml files. We don't have right now for our plugin, but we would in the future.

Copy link
Member

Choose a reason for hiding this comment

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

os:
- ubuntu-latest
- macOS-latest
- windows-latest
java:
- 17
Copy link
Member

Choose a reason for hiding this comment

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

I remember in AD we had to test on 11, 17, 20. Should we do that here too? I think default for 2.x is jdk 11 still but could be wrong

Copy link
Member Author

Choose a reason for hiding this comment

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

@dbwiddis WDYT? Since you worked on the CI initially.

Copy link
Member

Choose a reason for hiding this comment

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

https://opensearch.org/docs/latest/install-and-configure/install-opensearch/index/#java-compatibility this is what we have documented and i think java 20 is going to be for 3.x

Copy link
Member Author

Choose a reason for hiding this comment

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

Pushed the change.

Copy link
Member

Choose a reason for hiding this comment

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

We should probably match whatever OpenSearch tests.

if: github.repository == 'opensearch-project/opensearch-ai-flow-framework'
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4

- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
distribution: temurin

- name: Test
run: ./gradlew ${{ matrix.test }}

- name: Upload Coverage Report
if: matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v3
with:
file: ./build/reports/jacoco/test/jacocoTestReport.xml