-
Notifications
You must be signed in to change notification settings - Fork 126
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
Adding test for KNNWeight #759
Changes from 1 commit
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 |
---|---|---|
|
@@ -165,6 +165,9 @@ dependencies { | |
api group: 'com.google.guava', name: 'guava', version:'30.0-jre' | ||
api group: 'commons-lang', name: 'commons-lang', version: '2.6' | ||
testFixturesImplementation "org.opensearch.test:framework:${opensearch_version}" | ||
testImplementation group: 'net.bytebuddy', name: 'byte-buddy', version: '1.12.22' | ||
testImplementation group: 'org.objenesis', name: 'objenesis', version: '3.2' | ||
testImplementation group: 'net.bytebuddy', name: 'byte-buddy-agent', version: '1.12.22' | ||
} | ||
|
||
|
||
|
@@ -196,6 +199,8 @@ test { | |
dependsOn buildJniLib | ||
systemProperty 'tests.security.manager', 'false' | ||
systemProperty "java.library.path", "$rootDir/jni/release" | ||
//this change enables mockito-inline that supports mocking of static classes/calls | ||
systemProperty "jdk.attach.allowAttachSelf", true | ||
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. this is required to mock static classes/methods 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. Add a comment in the file itself. 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. ack |
||
if (Os.isFamily(Os.FAMILY_WINDOWS)) { | ||
// Add the paths of built JNI libraries and its dependent libraries to PATH variable in System variables | ||
environment('PATH', System.getenv('PATH') + ";$rootDir/jni/release" + ";$rootDir/src/main/resources/windowsDependencies") | ||
|
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.
this is required to mock static classes/methods
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.
Quick feedback on this:
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.
Making changes in source will be problematic, there are many such classes involved in call chain.
We're using junit4, 4.13 to be precise.