Commit Graph

116 Commits

Author SHA1 Message Date
Dawid Weiss 6bb244a932
An improved check for ignoring the c2-crash test if running on a client compiler. (#12953) 2023-12-18 12:37:57 +01:00
Jakub Slowinski 3965319441
Attempting to clean up some remaining Solr references (#12939)
* Attempting to clean up some remaining Solr references

* Update gradle/help.gradle

Co-authored-by: Dawid Weiss <dawid.weiss@gmail.com>

---------

Co-authored-by: Dawid Weiss <dawid.weiss@gmail.com>
2023-12-14 06:02:16 -05:00
Chris Hegarty a6f70ad2bb
Reflow computeCommonPrefixLengthAndBuildHistogram to avoid crash (#12905)
This commit reflows the code in the method body of computeCommonPrefixLengthAndBuildHistogram, so as to avoid a JVM JIT crash. The purpose of this change is to workaround the JVM bug which is somewhat fragile, but the best that we can do for now and appears to be working well.
2023-12-11 20:10:03 +00:00
Uwe Schindler 880d0ba1a8
Rewrite JavaScriptCompiler to use modern JVM features (Java 17) (#12873)
* Rewrite Javascript expression compiler to use hidden classes and MethodHandles for functions

* Use dynamic constants for MethodHandles

* Remove invokestatic code and handle everything through dynamic constants

* Rewrite code to patch stack trace (keep Expressions class unmodified)

* Improve generating of constant names

* Remove classloader test (no longer needed)

* Add benchmark

* use better exception in benchmark

* Add documentation, migration guide and a utility method to convert legacy function maps

* also ignore SecurityException here while checking compatibility (if it happens only an imprecise error message is thrown)

* Use Map.copyOf to not clone the map each time we compile an expression

* Add another test with same method multiple times

* Update ASM to 9.6 and set classfile version to Java 17

* Cleanup classloader permissions, unfortunately "createClassLoader" is still needed for Jacoco for God knows what
2023-12-05 11:53:57 +01:00
Uwe Schindler 17bb73332c
Only enable support for tests.profile if jdk.jfr module is available in Gradle runtime (#12845) 2023-11-25 20:16:09 +01:00
Dawid Weiss d6836d3d0e
tests.multiplier could be omitted in failed test reproduce line (#12752)
The default tests.multiplier passed from gradle was 1, but
LuceneTestCase tried to compute its default value from TESTS_NIGHTLY.
This could lead to subtle errors: nightly mode failures would not report
tests.multipler=1 and when started from the IDE, the tests.multiplier
would be set to 2 (leading to different randomness).
2023-11-03 17:05:17 +01:00
Dawid Weiss 2482f7688b
Add createClassLoader to replicator permissions (block specific to jacoco). (#12684) 2023-10-16 09:11:57 +02:00
Robert Muir 94619e00e0
fix Panama provider to only have static final constants, but allow sysprops for testing.
Set those sysprops by the build when running tests: force integer vectors on always, and randomize vector size
2023-10-14 19:51:59 -04:00
Dawid Weiss 06341ffe1d GITHUB#12655: upgrade jacoco aggregation plugin (failed with gradle 8.x), change html output property. 2023-10-12 20:42:17 +02:00
Dawid Weiss ebfbc831ab
Omit -Ptests.haltonfailure=false in failed test repro line #12565 (#12566) 2023-09-18 14:30:53 +02:00
Chris Hegarty f756f90644
Integrate the Incubating Panama Vector API (#12311)
Leverage accelerated vector hardware instructions in Vector Search.

Lucene already has a mechanism that enables the use of non-final JDK APIs, currently used for the Previewing Pamana Foreign API. This change expands this mechanism to include the Incubating Pamana Vector API. When the jdk.incubator.vector module is present at run time the Panamaized version of the low-level primitives used by Vector Search is enabled. If not present, the default scalar version of these low-level primitives is used (as it was previously).

Currently, we're only targeting support for JDK 20. A subsequent PR should evaluate JDK 21.
---------

Co-authored-by: Uwe Schindler <uschindler@apache.org>
Co-authored-by: Robert Muir <rmuir@apache.org>
2023-05-25 07:59:50 +01:00
Tyler Bertrand c514089d66
Gradle optimizations (#12150)
* Define inputs and outputs for task validateJarLicenses
  * Lazily configure validateJarLicenses
* Move functionality from copyTestResources task into processTestResources task
  * Lazily configure processTestResources
  * Altered TestCustomAnalyzer.testStopWordsFromFile() to find resources in updated location
* Resolve "overlapping output" issue preventing processTestResources from being cached
* Provide system properties from CommandLineArgumentProviders
  * Configure certain system properties as inputs to take advantage of UP-TO-DATE checking
  * Applies the correct pathing strategies to take full advantage of caching even if builds are executed from different locations on disk
* Make validateSourcePatterns task cacheable by removing .gradle directory from its input
2023-03-06 19:17:37 +01:00
Uwe Schindler c9401bf064
Patch class files for Java 19 code to no longer have the "preview" flag (this enables Java 19 memory segments by default) (#12033) 2022-12-26 10:07:44 +01:00
Dawid Weiss 1f741ff63c
Upgrade gradle to 7.6. (#11993) 2022-12-02 09:18:38 +01:00
Dawid Weiss 82e57d1d6b Remove obsolete badapples tests switch (#468) 2022-11-18 16:57:24 +01:00
Robert Muir b292151f21
reland: 11925 javac options (#11937)
* pass jvm args to javac  #11925

* Update net.ltgt.errorprone to the latest version so that jvm args are not overwritten, add -XX:+PrintFlagsFinal for debugging

* speed up the pure javac case too

It does not help to fork additional VMs (although error-prone will do
this since it messes with bootstrap classpath), so we avoid forking.

Instead it is best to tune org.gradle.jvmargs.

* use the flags consistently everywhere (tests and doc)

* handle the different possible alt toolchain cases

The difference is invoking 'java' versus invoking 'javac', so the args must be fed differently.

Co-authored-by: Dawid Weiss <dawid.weiss@carrotsearch.com>
2022-11-15 19:28:52 -05:00
Robert Muir 0753f48a80
Revert "speed up javac and error-prone tasks by using less resources (#11927)"
This reverts commit deab699188.

Having a shitty day: git lost changes :(
2022-11-15 19:08:43 -05:00
Robert Muir deab699188
speed up javac and error-prone tasks by using less resources (#11927)
* pass jvm args to javac  #11925
* Update net.ltgt.errorprone to the latest version so that jvm args are not overwritten, add -XX:+PrintFlagsFinal for debugging
* speed up the pure javac case too

It does not help to fork additional VMs (although error-prone will do
this since it messes with bootstrap classpath), so we avoid forking.

Instead it is best to tune org.gradle.jvmargs.

* use the flags consistently everywhere (tests and doc)

Co-authored-by: Dawid Weiss <dweiss@apache.org>
2022-11-15 19:04:17 -05:00
Robert Muir a02db83235
Revert "speed up javac and error-prone tasks by using less resources (#11927)"
This reverts commit b9c51d9a59.
2022-11-15 18:19:09 -05:00
Dawid Weiss b9c51d9a59
speed up javac and error-prone tasks by using less resources (#11927)
* pass jvm args to javac  #11925
* Update net.ltgt.errorprone to the latest version so that jvm args are not overwritten, add -XX:+PrintFlagsFinal for debugging
* speed up the pure javac case too

It does not help to fork additional VMs (although error-prone will do
this since it messes with bootstrap classpath), so we avoid forking.

Instead it is best to tune org.gradle.jvmargs.

* use the flags consistently everywhere (tests and doc)

Co-authored-by: Robert Muir <rmuir@apache.org>
2022-11-15 16:06:38 -05:00
Patrick Zhai 26ec0dd44c
add gradle aggregated coverage console log and html location (#11882)
* jacoco/ coverage shouldn't trigger all test tasks as dependencies - instead, it should run after those test tasks that you choose to run. removed java plugin from top-level.

* Make coverage depend on the default test task.

* Update jacoco log plugin so that it doesn't make hard dependencies on test tasks.

Co-authored-by: Dawid Weiss <dawid.weiss@carrotsearch.com>
2022-10-28 23:33:37 -07:00
Robert Muir 4c434b7089
make 'gradle coverage' print test coverage summaries. (#11837)
Currently, this task is too silent and just writes HTML reports. It is a
nice improvement to print the summary to the console.

Before:

```
> Task :lucene:analysis:icu:jacocoTestReport
Code coverage report at: /home/rmuir/workspace/lucene/lucene/analysis/icu/build/reports/jacoco/test/html.
```

After:

```
> Task :lucene:analysis:icu:jacocoTestReport
Code coverage report at: /home/rmuir/workspace/lucene/lucene/analysis/icu/build/reports/jacoco/test/html.

> Task :lucene:analysis:icu:jacocoLogTestCoverage
Test Coverage:
    - Class Coverage: 100%
    - Method Coverage: 87.9%
    - Branch Coverage: 82.7%
    - Line Coverage: 92.8%
    - Instruction Coverage: 92.7%
    - Complexity Coverage: 78.8%
```
2022-10-05 21:46:20 -04:00
Uwe Schindler 3b9c728ab5
MR-JAR rewrite of MMapDirectory with JDK-19 preview Panama APIs (>= JDK-19-ea+23) (#912)
This uses Gradle's auto-provisioning to compile Java 19 classes and build a multi-release JAR from them. Please make sure to regenerate gradle.properties (delete it) or change "org.gradle.java.installations.auto-download" to "true"
2022-09-26 15:22:04 +02:00
Tomoko Uchida b911d1d47c
LUCENE-10531: Add @RequiresGUI test group for GUI tests (#893)
Co-authored-by: Dawid Weiss <dawid.weiss@carrotsearch.com>
2022-05-18 09:26:06 +09:00
Robert Muir 3edfeb5eb2
LUCENE-10532: remove @Slow annotation (#832)
Remove `@Slow` annotation, for more consistency with CI and local jobs. All tests can be fast!
2022-05-09 23:03:55 -04:00
Uwe Schindler 42fe2d5620
LUCENE-10364: Prepare and update errorprone plugin for Java 17 (#590) 2022-01-07 19:19:46 +01:00
Uwe Schindler 0b517573a4
LUCENE-10342: Add logging to static initializers to warn users if unmapping or object size calculation does not work (#572)
Co-authored-by: Tomoko Uchida <tomoko.uchida.1111@gmail.com>
2021-12-29 18:18:21 +01:00
Dawid Weiss d928c47d6e
LUCENE-10338: Scan for tests only by convention file name pattern (#565) 2021-12-26 18:18:24 +01:00
Dawid Weiss a94fbb79ac LUCENE-10301: make the test-framework a proper module by moving all test
classes to org.apache.lucene.tests.*. Also changes distribution layout
(all modules are now under modules/).
2021-12-21 20:30:45 +01:00
Dawid Weiss d2c98912eb This reverts commit a7b50f723d. 2021-12-19 08:51:13 +01:00
Dawid Weiss a7b50f723d Reverting back to b48cac02. 2021-12-18 23:36:30 +01:00
Dawid Weiss ae92e96481 Address Uwe's remarks. 2021-12-16 20:05:05 +01:00
Dawid Weiss 328b3cc55f LUCENE-10255: add support for .tests subprojects which contain module tests. 2021-12-10 17:16:19 +01:00
Dawid Weiss 263765a9b0 LUCENE-10226: test target creates a weird folder (lazy property). 2021-11-09 08:34:04 +01:00
Mike Drob 23256a30fa
Replace deprecated Gradle 7.2 properties (#417) 2021-10-29 09:59:47 -05:00
Dawid Weiss 81f5b4d642
LUCENE-9660: add tests.neverUpToDate=true option which, by default, makes test tasks always execute. (#410) 2021-10-25 14:51:11 +02:00
Uwe Schindler fc475360a8 Only pass "--illegal-access=deny" up to JDK-15, later versions deprecate the option and default to "deny" 2021-09-22 19:41:59 +02:00
Dawid Weiss de45b68c90 LUCENE-9448, LUCENE-9990: fix Luke's launcher task. 2021-09-16 08:49:26 +02:00
Dawid Weiss 2b0378cd4a Use JavaInfo instead of toolchains. Internal but works and is free of toolchain's quirks. 2021-08-25 10:03:59 +02:00
Dawid Weiss 68cf86ba35 Experiments with the new apis. 2021-08-25 10:03:59 +02:00
Dawid Weiss 523cea2c5d Revert "Adding initial patch by Gautam Worah" (restore pristine main)
This reverts commit 067ab4f503aabea59639e692e3ea9ee30750c68e.
2021-08-25 10:03:59 +02:00
Dawid Weiss bac22d6116 Adding initial patch by Gautam Worah 2021-08-25 10:03:59 +02:00
Robert Muir 06907a2c12
LUCENE-9188: Add jacoco code coverage support to gradle (#119)
Co-authored-by: Dawid Weiss <dawid.weiss@carrotsearch.com>
Co-authored-by: Uwe Schindler <uschindler@apache.org>
2021-05-02 16:24:06 +02:00
Dawid Weiss 246c4beb22
LUCENE-9854: Clean up utilities to download and extract test/ benchmark data sets. (#27) 2021-03-22 12:22:39 +01:00
Dawid Weiss 53bea54669
LUCENE-9375: cleaning up post-split conditional build logic and solr refs. (#22) 2021-03-18 11:04:45 +01:00
Dawid Weiss 7f5e660395
LUCENE-9375: some build file cleanups. (#10) 2021-03-10 21:47:37 +01:00
Dawid Weiss fdf486ba54 LUCENE-9375: post-repo-split removal of solr counterpart. 2021-03-10 11:20:08 +01:00
Dawid Weiss 409bc37c13
SOLR-14759: a few initial changes so that Lucene can be built independently while Solr code is still in place. (#2448) 2021-03-08 14:59:08 +01:00
Bruno Roustant 19e6560b7f
Restore read-only permission in solr-tests.policy 2021-03-04 16:20:17 +01:00
Dawid Weiss 7dc43f46fd
LUCENE-9818: print slowest suites, add an option to enable/ disable the function from options. (#2439) 2021-03-01 16:02:18 +01:00