Integrated: 8297072: Provide gradle option to test a previously built SDK

Ambarish Rapte arapte at openjdk.org
Fri Sep 27 05:49:41 UTC 2024


On Mon, 23 Sep 2024 15:48:00 GMT, Ambarish Rapte <arapte at openjdk.org> wrote:

> #### Requirement:
> We want to be able to test a JavaFX SDK built somewhere else other than on current machine or current repo on same machine. Which means we should be able to run the unit and system tests with a different JavaFX SDK.
> 
> #### Change:
> ##### Run tests using a specified JavaFX SDK:
> - Introduce a property `TEST_JAVAFX_SDK_PATH` that points to the JavaFX SDK which was built elsewhere.
> - Modify the paths generated by build.gradle to point to the path sepcified by `TEST_JAVAFX_SDK_PATH`
> - When a `TEST_JAVAFX_SDK_PATH` is specified `-PTEST_ONLY=true` must also be specified.
> 
> ##### Generate the JavaFX SDK bundle
> - Generate the minimal JavaFX SDK bundle that is required to run the tests: We require content of the _build/sdk_ and _build/shims_ directories to achieve the same.
> 
> 
> #### Verification:
> ##### With a single machine:
> 1. Create two local copies JavaFX repo, [repo1, repo2]
> 2. Build sdk and shims in repo1. `gradle sdk shims`
> 3. In repo2, run different tests as,
>> gradle -PTEST_ONLY=true -PTEST_JAVAFX_SDK_PATH=**repo1/build**  :base:test <any tests>
> 4. In repo1 run `gradle all`
> 5. `javafx-sdk-shims.zip` file would be created under repo1/build. unzip it any `unzip-path` on machine
> 6. In repo2, run the tests by providing the `unzip-path` as TEST_JAVAFX_SDK_PATH
>> gradle -PTEST_ONLY=true -PTEST_JAVAFX_SDK_PATH=**unzip-path**  :base:test <any tests>
> 
> ##### With 2 machines.
> 1. Run `gradle all` on a machine1
> 2. Move build/javafx-sdk-shims.zip to machine2 and unzip to any `unzip-path`
> 3. Run the tests by providing the `unzip-path` as TEST_JAVAFX_SDK_PATH
>> gradle -PTEST_ONLY=true -PTEST_JAVAFX_SDK_PATH=**unzip-path**  :base:test <any tests>
> 
> 
> #### Additional changes:
> Additionally we observed that three unit tests failed because they access a specific path. A path that would no exists when JavaFX SDK is not built.
> 1. Controls test: test.javafx.scene.control.ControlTest.testRT18097
> It required path: modules/javafx.controls/build/classes/java/main/javafx.controls/javafx
> It is fixed by change on line 2811
> 
> 2. Graphics test: test.javafx.css.CssMetaDataTest.testRT18097
> It required path: modules/javafx.graphics/build/classes/java/main/javafx.graphics/javafx
> It is fixed by change on line 2722
> 
> 3. Base test: test.com.sun.javafx.runtime.VersionInfoTest
> It required path: build/module-lib/javafx.properties
> VersionInfoTest is specific to the local build of JavaFX. So, It can be safely excluded when TEST_JAVAFX_SDK_PATH is specified.
> It is fixed by change on line 2304 t...

This pull request has now been integrated.

Changeset: 7870a226
Author:    Ambarish Rapte <arapte at openjdk.org>
URL:       https://git.openjdk.org/jfx/commit/7870a226a21826e3979e314c0218d351b3cfb82f
Stats:     71 lines in 1 file changed: 61 ins; 0 del; 10 mod

8297072: Provide gradle option to test a previously built SDK

Reviewed-by: kcr, lkostyra

-------------

PR: https://git.openjdk.org/jfx/pull/1577


More information about the openjfx-dev mailing list