[ 
https://issues.apache.org/jira/browse/LUCENE-9660?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17433445#comment-17433445
 ] 

Dawid Weiss commented on LUCENE-9660:
-------------------------------------

It's not broken - it's normal and consistent with any other task (that is 
incremental). If your inputs and outputs are up-to-date, the task does not run. 
Lucene tests use random seed as input so they're sort of special here but other 
projects would use this feature to skip tests that have passed if nothing has 
changed in between.

If you're using gradle for a longer while there is nothing surprising about 
this. Changing this behavior would violate the principle of least surprise, in 
my opinion... But if you insist you can change it by forcing task outputs to 
never be up to date - 

{code}
outputs.upToDateWhen { false }
{code}
https://docs.gradle.org/current/javadoc/org/gradle/api/tasks/TaskOutputs.html#upToDateWhen-groovy.lang.Closure-

This should be added to each and every test task - somewhere here, perhaps:
https://github.com/dweiss/lucene/blob/main/gradle/testing/defaults-tests.gradle#L88


> gradle task cache should not cache --tests
> ------------------------------------------
>
>                 Key: LUCENE-9660
>                 URL: https://issues.apache.org/jira/browse/LUCENE-9660
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: general/build
>            Reporter: David Smiley
>            Assignee: Dawid Weiss
>            Priority: Minor
>
> I recently ran a specific test at the CLI via gradle to see if a particular 
> build failure repeats.  It includes the {{--tests}} command line option to 
> specify the test.  The test passed.  Later I wanted to run it again; I 
> suspected it might be flakey.  Gradle completed in 10 seconds, and I'm 
> certain it didn't actually run the test. There was no printout and the 
> build/test-results/test/outputs/...  from the test run still had not changed 
> from previously.
> Mike Drob informed me of "gradlew cleanTest" but I'd prefer to not have to 
> know about that, at least not for the specific case of wanting to execute a 
> specific test.
> CC [~dweiss]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to