-
Notifications
You must be signed in to change notification settings - Fork 37
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
Changes from 9 commits
632b450
72c8b98
a441fd5
4b63fbf
d59127d
0c594dc
adf0352
ea0028d
f9817f5
dad496b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also just for understanding, what are yamlRestTests for? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here's an example test https://github.com/opensearch-project/OpenSearch/blob/1447d75e5e9ea042dd4bb645d71f25aea1fb42a8/modules/geo/src/yamlRestTest/resources/rest-api-spec/test/geo_shape/10_basic.yml ... it tests a search API with specific input and makes sure it gets the expected output. |
||
os: | ||
- ubuntu-latest | ||
- macOS-latest | ||
- windows-latest | ||
java: | ||
- 17 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dbwiddis WDYT? Since you worked on the CI initially. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pushed the change. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
whichcheck
does also but this does it into a jar.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed it to build.
There was a problem hiding this comment.
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 :)
There was a problem hiding this comment.
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.