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

Enable running jni test during gradle build #1553

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

navneet1v
Copy link
Collaborator

@navneet1v navneet1v commented Mar 17, 2024

Description

Earlier the jni tests were not running as part of ./gradlew build, with this change the tests will run as part of ./gradlew build.

To enable the tests I added a new gradle task jniTest, which can be run via ./gradlew jniTest. I also added the dependency of check task of gradle on this test. As check already runs integTest and test so it make sense to run jni test as part of check.

check task is already a dependency of build task.

Also validated that on doing ./gradlew build --dry-run I can see jniTest task.

How to run jni test with gradle?

# To run all tests
./gradlew jniTest
# To run nmslib tests
./gradlew jniTest -Dgtest_filter=Nmslib*
# To run faiss tests
./gradlew jniTest -Dgtest_filter=Faiss*

Same is added in docs.

Why Jni Test is not added as part of test task?

The test task currently runs all the Java unit test. My initial plan was to do that only, but what it will lead to is if a user just want to run specific unit test via --tests, then also the jni test will run. We can add a parameter that can skip the tests if explicitly passed but this also creates a huddle as on failure of unit test we cannot just copy paste the command provided by gradle to run the failed unit test.

Issues Resolved

#1453

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed as per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@navneet1v navneet1v added Maintenance Add support for new versions of OpenSearch/Dashboards from upstream backport 2.x labels Mar 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x Maintenance Add support for new versions of OpenSearch/Dashboards from upstream
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants