RFR: 8297072: Provide gradle option to test a previously built SDK [v3]

Ambarish Rapte arapte at openjdk.org
Wed Sep 25 12:48:16 UTC 2024


> #### 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...

Ambarish Rapte has updated the pull request incrementally with one additional commit since the last revision:

  task for creating run args when -PTEST-ONLY=true

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

Changes:
  - all: https://git.openjdk.org/jfx/pull/1577/files
  - new: https://git.openjdk.org/jfx/pull/1577/files/fca8e6b1..d49a12fb

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jfx&pr=1577&range=02
 - incr: https://webrevs.openjdk.org/?repo=jfx&pr=1577&range=01-02

  Stats: 6 lines in 1 file changed: 4 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/jfx/pull/1577.diff
  Fetch: git fetch https://git.openjdk.org/jfx.git pull/1577/head:pull/1577

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


More information about the openjfx-dev mailing list