adoptium / adoptium/aqa-tests

Proposal: Tool to select jtreg version based on TEST.ROOT requiredVersion

Open
#6,862 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
HTML
Stars
155
Forks
346
Avg merge
2d 9h
Merged PRs (30d)
36

Description

**Summary**

This issue is a proposal to use the TEST.ROOT file (in the jdk source code) to specify which jtreg version we should use for OpenJDK testing.

**The Situation**

We currently hard-code the jtreg version we're using based on the JDK version we're testing.

The minimum jtreg version for a given set of tests is specified in a TEST.ROOT file the root test directory of each test target.

**The Problem**

[As this issue revealed](https://bugs.openjdk.org/browse/JDK-8376188), each TEST.ROOT file (of which there are several per jdk version) can specify a different minimum version of jtreg, some of which are later than the version we use for all jtreg testing on a given jdk version.

This means that, in at least one case, we're using a level of jtreg that is below the minimum version, which can cause errors.

**Proposed Solution**

The proposed solution is to select the jtreg version at runtime per-target.

Now, this can produce a chicken-or-the-egg situation. As the playlist is the correct location for identifying the root folder of a given target, we won't know (before consulting the playlist) which TEST.ROOT file to use, so preidentifying (before accessing the playlist) the correct jtreg version for a given target would be difficult.

So I propose we preidentify jtreg versions by *_TEST_DIR, and simply changing the playlist to say "use the jtreg version present in this test-dir-related-variable".

Example:
For jdk_tools, we use the test root directory identified by JTREG_JDK_TEST_DIR
However, we don't know that's the right test root directory until we access the playlist.
So, for the jtreg version, we do this in a script:
```
JTREG_MIN_VERSION_FOR_LANGTOOLS="1.2.3" #Extracted from TEST.ROOT for langtools tests.
JTREG_MIN_VERSION_FOR_HOTSPOT="4.5.6" #Extracted from TEST.ROOT for hotspot tests.
JTREG_MIN_VERSION_FOR_JDK="7.8.9" #Extracted at runtime from TEST.ROOT for jdk tests.
```
And then we do this in the playlist:
```
java -jar $(Q)$(D)jtreg$( JTREG_MIN_VERSION_FOR_JDK).jar$(Q) $(Q)$(JTREG_JDK_TEST_DIR):jdk_tools$(Q);
```

Contributor guide

Open the contributing guide

Research direction

Start by tracing how the playlist and *_TEST_DIR variables identify test targets, then inspect the TEST.ROOT files that provide each target's requiredVersion. The work is done when jtreg selection occurs per target and the playlist uses the corresponding version without selecting one below TEST.ROOT's minimum.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
testing-qa
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.