RFR: 8297071: Provide gradle "TEST_ONLY" flag to completely suppress building the sdk and shims [v3]
Kevin Rushforth
kcr at openjdk.org
Fri Apr 28 18:18:57 UTC 2023
On Thu, 27 Apr 2023 21:22:22 GMT, Ambarish Rapte <arapte at openjdk.org> wrote:
>> Add `TEST_ONLY` flag to gradle with default value as false.
>> Add new task named `shims`, This task depends on all shim tasks from all projects. Hence it will build all shim classes.
>>
>> If TEST_ONLY is set to true, the all non test tasks get disabled. When running a test task, this flag would reduce time in checking if all non test tasks are up to date.
>> How to use:
>> 1. Following command would fail in a clean repo,
>> > gradle -PTEST_ONLY=true :base:test
>> 2. The sdk and shims task must have been executed before running any test
>> > gradle sdk shims
>> > gradle -PTEST_ONLY=true :base:test
>> 3. Setting this flag to true with non test task would result in no task being run.
>> > gradle -PTEST_ONLY=true sdk -> It will not build sdk task
>>
>> TIP: use `--dry-run` option of gradle for speeding up testing the effect of this PR.
>
> Ambarish Rapte has updated the pull request incrementally with one additional commit since the last revision:
>
> update submit.yml
I get one failure when running the tests after first building the shims:
$ gradle --info shims
$ gradle --info --continue -PTEST_ONLY=true test
...
LoadTest > loadJarFile STANDARD_ERROR
Apr 28, 2023 8:43:39 AM com.sun.webkit.network.URLLoader doRun
WARNING: Unexpected error
java.nio.file.NoSuchFileException: .../modules/javafx.web/build/testing/resources/webArchiveJar.jar
...
LoadTest > loadJarFile FAILED
java.lang.AssertionError: netscape.javascript.JSException: ReferenceError: Can't find variable: jsr0
at test.javafx.scene.web.TestBase.submit(TestBase.java:206)
at test.javafx.scene.web.TestBase.executeScript(TestBase.java:217)
at test.javafx.scene.web.LoadTest.loadJarFile(LoadTest.java:324)
Caused by:
netscape.javascript.JSException: ReferenceError: Can't find variable: jsr0
at javafx.web at 21-internal/com.sun.webkit.dom.JSObject.fwkMakeException(JSObject.java:160)
at javafx.web at 21-internal/com.sun.webkit.WebPage.twkExecuteScript(Native Method)
at javafx.web at 21-internal/com.sun.webkit.WebPage.executeScript(WebPage.java:1576)
at javafx.web at 21-internal/javafx.scene.web.WebEngine.executeScript(WebEngine.java:985)
at test.javafx.scene.web.TestBase.lambda$executeScript$5(TestBase.java:217)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
at javafx.graphics at 21-internal/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:456)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at javafx.graphics at 21-internal/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:455)
at javafx.graphics at 21-internal/com.sun.glass.ui.monocle.RunnableProcessor.runLoop(RunnableProcessor.java:92)
at javafx.graphics at 21-internal/com.sun.glass.ui.monocle.RunnableProcessor.run(RunnableProcessor.java:51)
at java.base/java.lang.Thread.run(Thread.java:1589)
build.gradle line 55:
> 53: *
> 54: * Adding a new project or task:
> 55: * - Fix for JDK-XXXXXXX, introduces a restriction on assigning name for project or task.
Minor: replace with actual bug ID (8297071)
build.gradle line 57:
> 55: * - Fix for JDK-XXXXXXX, introduces a restriction on assigning name for project or task.
> 56: * - If the name of project or task contains word test/Test then it is considered as test task.
> 57: * - If the name of project or task contains word shim/Shim then it is considered as shims task.
Minor: there is no project that contains the name `shim`, so I think you can remove the "project or" from this comment.
gradle.properties.template line 82:
> 80: # Recommended to use TEST_ONLY instead of this property.
> 81:
> 82: #BUILD_SDK_FOR_TEST = false
Suggestion: Maybe remove this, since it is only kept for compatibility? It's fine if you want to keep it.
-------------
PR Review: https://git.openjdk.org/jfx/pull/1117#pullrequestreview-1403856506
PR Review Comment: https://git.openjdk.org/jfx/pull/1117#discussion_r1180308516
PR Review Comment: https://git.openjdk.org/jfx/pull/1117#discussion_r1180312014
PR Review Comment: https://git.openjdk.org/jfx/pull/1117#discussion_r1179042781
More information about the openjfx-dev
mailing list