You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "dweiss (via GitHub)" <gi...@apache.org> on 2025/02/16 17:30:07 UTC
[PR] Repeatable hunspell tests [lucene]
dweiss opened a new pull request, #14246:
URL: https://github.com/apache/lucene/pull/14246
Fixes #14235
Sorry this took surprisingly long. I've tried to clean up a few things along the way:
* the repositories are now pulled at constant refs embedded inside the gradle file, unless an explicit reference is passed using gradle properties for each repository. So `-Ptests.hunspell.libreoffice.ref=master` will test against the master branch (or any other sha provided there). For woorm, it's `-Ptests.hunspell.woorm.ref=main`.
* I've added a scheduled workflow run every Monday against latest dev branches of both projects.
I also cleaned up gradle scripts a bit.
* removed the separate test task and replaced it with a property that controls whether we pull/ test against remote repositories: `-Ptests.hunspell.regressions=true`. The separate task wasn't configured properly (it wasn't running in module mode) and in general I think it's better to just keep the 'test' task for running tests.
* gh workflows run just the `TestAllDictionaries` class, not everything.
I also had to open up some core packages to the test framework - this is a side effect of TestAllDictionaries measuring memory of Dictionary objects it creates. I think it'd be nice to make Dictionary implement Accountable and remove opens statements but it's probably a follow up issue.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [PR] Repeatable hunspell tests [lucene]
Posted by "rmuir (via GitHub)" <gi...@apache.org>.
rmuir commented on code in PR #14246:
URL: https://github.com/apache/lucene/pull/14246#discussion_r1957377876
##########
lucene/analysis/common/build.gradle:
##########
@@ -24,51 +26,104 @@ dependencies {
moduleTestImplementation project(':lucene:test-framework')
}
-// Fetch the data and enable regression tests against woorm/ libreoffice dictionaries.
-task checkoutHunspellRegressionRepos() {
- ext {
- checkoutDir = file("${buildDir}/hunspell-regressions")
- }
+// Enable Hunspell tests against LibreOffice/ Woorm dictionaries. We pull
+// these dictionaries dynamically from git of each respective project. To keep
+// things consistent across pull requests/ re-runs, we use a fixed git commit
+// for each project ({@linkplain https://github.com/apache/lucene/issues/14235 #14235}),
+// with a periodic workflow running against the latest commit on each
+// project's respective development branch.
+
+// A gradle property with the parent directory for all git clones for each project.
+def cloneDirProperty = project.layout.buildDirectory.dir("hunspell-regressions")
- outputs.dir checkoutDir
- doFirst {
- // Clone the repositories we need if they don't exist.
+// The list of dictionary projects to pull/ check against. Also includes
+// a full commit reference for each project. These should be updated
+// from time to time based on what's available at the head reference.
+def dictionaryProjects = [
[
- "libreoffice": "https://github.com/LibreOffice/dictionaries",
- "woorm": "https://github.com/wooorm/dictionaries"
- ].each { name, repo ->
- if (!file("${checkoutDir}/${name}").exists()) {
- checkoutDir.mkdirs()
- // This will work only if git is available, but I assume it is.
- project.exec {
+ "name": "libreoffice",
+ "url": "https://github.com/LibreOffice/dictionaries",
+ "ref": "762abe74008b94b2ff06db6f4024b59a8254c467" // head: master
+ ],
+ [
+ "name": "woorm",
+ "url": "https://github.com/wooorm/dictionaries",
+ "ref": "8cfea406b505e4d7df52d5a19bce525df98c54ab" // head: main
+ ]
+]
Review Comment:
yes, honestly any revision will work for the intended purpose of preventing regressions. If we want to discover new and interesting ways that dictionaries can be malformed in the wild that we should try to detect, that is different :)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [PR] Repeatable hunspell tests [lucene]
Posted by "dweiss (via GitHub)" <gi...@apache.org>.
dweiss commented on code in PR #14246:
URL: https://github.com/apache/lucene/pull/14246#discussion_r1957375830
##########
lucene/analysis/common/build.gradle:
##########
@@ -24,51 +26,104 @@ dependencies {
moduleTestImplementation project(':lucene:test-framework')
}
-// Fetch the data and enable regression tests against woorm/ libreoffice dictionaries.
-task checkoutHunspellRegressionRepos() {
- ext {
- checkoutDir = file("${buildDir}/hunspell-regressions")
- }
+// Enable Hunspell tests against LibreOffice/ Woorm dictionaries. We pull
+// these dictionaries dynamically from git of each respective project. To keep
+// things consistent across pull requests/ re-runs, we use a fixed git commit
+// for each project ({@linkplain https://github.com/apache/lucene/issues/14235 #14235}),
+// with a periodic workflow running against the latest commit on each
+// project's respective development branch.
+
+// A gradle property with the parent directory for all git clones for each project.
+def cloneDirProperty = project.layout.buildDirectory.dir("hunspell-regressions")
- outputs.dir checkoutDir
- doFirst {
- // Clone the repositories we need if they don't exist.
+// The list of dictionary projects to pull/ check against. Also includes
+// a full commit reference for each project. These should be updated
+// from time to time based on what's available at the head reference.
+def dictionaryProjects = [
[
- "libreoffice": "https://github.com/LibreOffice/dictionaries",
- "woorm": "https://github.com/wooorm/dictionaries"
- ].each { name, repo ->
- if (!file("${checkoutDir}/${name}").exists()) {
- checkoutDir.mkdirs()
- // This will work only if git is available, but I assume it is.
- project.exec {
+ "name": "libreoffice",
+ "url": "https://github.com/LibreOffice/dictionaries",
+ "ref": "762abe74008b94b2ff06db6f4024b59a8254c467" // head: master
+ ],
+ [
+ "name": "woorm",
+ "url": "https://github.com/wooorm/dictionaries",
+ "ref": "8cfea406b505e4d7df52d5a19bce525df98c54ab" // head: main
+ ]
+]
Review Comment:
This will need to be updated by hand, occasionally. The frequency of changes in those repositories isn't that great so no problem there, I think?
##########
lucene/core/src/java/module-info.java:
##########
@@ -63,6 +63,14 @@
// Open certain packages for the test framework (ram usage tester).
opens org.apache.lucene.document to
org.apache.lucene.test_framework;
+ opens org.apache.lucene.util.fst to
+ org.apache.lucene.test_framework;
+ opens org.apache.lucene.store to
+ org.apache.lucene.test_framework;
+ opens org.apache.lucene.util.automaton to
+ org.apache.lucene.test_framework;
+ opens org.apache.lucene.util to
+ org.apache.lucene.test_framework;
Review Comment:
Had to add these to make ram testing happy now that the tests run in module mode.
##########
.github/workflows/run-scheduled-hunspell.yml:
##########
@@ -0,0 +1,32 @@
+name: "Run scheduled checks: Hunspell tests against latest dictionaries"
+
+on:
+ workflow_dispatch:
+
+ schedule:
+ # 4:13 on Mondays
+ - cron: '13 4 * * 1'
+
+env:
+ DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
+
+jobs:
+ test:
+ name: Hunspell regression tests against latest dictionaries
+ timeout-minutes: 15
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v4
+ - uses: ./.github/actions/prepare-for-build
+
+ - name: Run Hunspell regression tests against latest commits in dictionary repositories
+ run: >
+ ./gradlew -p lucene/analysis/common
+ -Ptests.hunspell.regressions=true
+ -Ptests.verbose=true
+ -Ptests.hunspell.libreoffice.ref=master
+ -Ptests.hunspell.woorm.ref=main
Review Comment:
Here we pick the 'latest' commit from both branches for the scheduled workflow.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [PR] Repeatable hunspell tests [lucene]
Posted by "dweiss (via GitHub)" <gi...@apache.org>.
dweiss commented on PR #14246:
URL: https://github.com/apache/lucene/pull/14246#issuecomment-2661581299
Thanks. I'll backport to 10x as well.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org
Re: [PR] Repeatable hunspell tests [lucene]
Posted by "dweiss (via GitHub)" <gi...@apache.org>.
dweiss merged PR #14246:
URL: https://github.com/apache/lucene/pull/14246
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org