Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consume vendor specific exclude list #3942

Merged
merged 1 commit into from
Sep 6, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 27 additions & 2 deletions jck/jtrunner/JavaTestRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ public class JavaTestRunner {
private static String jckConfigLoc;
private static String initialJtxFullPath;
private static String jtxFullPath;
private static String jtxDevFullPath;
private static String customJtx;
private static String kflFullPath;
private static String testFlagJtxFullPath;
private static String krbConfFile;
Expand Down Expand Up @@ -120,6 +122,7 @@ public class JavaTestRunner {
private static final String CONCURRENCY = "concurrency";
private static final String CONFIG_ALT_PATH = "configAltPath";
private static final String TASK = "task";
private static final String CUSTOM_JTX = "customJtx";

public static void main(String args[]) throws Exception {
ArrayList<String> essentialParameters = new ArrayList<String>();
Expand All @@ -136,6 +139,7 @@ public static void main(String args[]) throws Exception {
essentialParameters.add(CONCURRENCY);
essentialParameters.add(CONFIG_ALT_PATH);
essentialParameters.add(TASK);
essentialParameters.add(CUSTOM_JTX);

for (String arg : args) {
if (arg.contains("=")) {
Expand Down Expand Up @@ -169,6 +173,7 @@ public static void main(String args[]) throws Exception {
jvmOpts = System.getProperty("jvm.options").trim() + " " + System.getProperty("other.opts");
testFlag = System.getenv("TEST_FLAG");
task = testArgs.get(TASK);
customJtx = testArgs.get(CUSTOM_JTX);

try {
boolean jtbGenerated = false, testSuccedded = false, summaryGenerated = false;
Expand Down Expand Up @@ -267,6 +272,26 @@ public static boolean generateJTB() throws Exception {
System.out.println("Unable to find additional excludes list file " + jtxFullPath);
jtxFullPath = "";
}

jtxDevFullPath = jckRoot + File.separator + "excludes" + File.separator + jckVersion + "-dev.jtx";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we offer the option to pass in the full path, since in temurin-compliance case we are not able to add files to jckRoot, so we would have to host the exclude file elsewhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I will add a new input variable (e.g. -customJtx) to JavasTestRunner for passing in full path to an exclude file.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks Mesbah!

Copy link
Contributor Author

@Mesbah-Alam Mesbah-Alam Aug 31, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@smlambert - I have updated the PR. JavaTestRunner will now accepts a new input parameter called customJtx which can be used to supply a full (local) path to a custom jtx file. If supplied the custom jtx file will be appended to the excludeList property in the generated command (jtb) file.

Tested: Grinder_JCK/638.

(Note: The test was done using an internal machine where I pre-created a custom jtx file (/home/jenkins/mesbah/custom.jtx). It was then supplied viacustomJtx simply in CUSTOM_TARGET field (i.e. TARGET=jck_custom and CUSTOM_TARGET=api/java_beans/Beans/Beans.html customJtx=/home/jenkins/mesbah/custom.jtx).

(will share test output via slack).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Mesbah-Alam, I will run a similar test on the temurin-compliance server!

File jtxDevFile = new File(jtxDevFullPath);

if (jtxDevFile.exists()) {
System.out.println("Using additional excludes list file " + jtxDevFullPath);
} else {
System.out.println("Unable to find additional excludes list file " + jtxDevFullPath);
jtxDevFullPath = "";
}

if (customJtx != null && !customJtx.equals("")) {
File customJtxFile = new File(customJtx);
if (customJtxFile.exists()) {
System.out.println("Using additional custom excludes list file " + customJtx);
} else {
System.out.println("Unable to find additional custom excludes list file " + customJtx);
customJtx = "";
}
}

// Look for a known failures list file
kflFullPath = jckRoot + File.separator + "excludes" + File.separator + jckVersion + ".kfl";
Expand Down Expand Up @@ -415,9 +440,9 @@ public static boolean generateJTB() throws Exception {
// Only use default initial jtx exclude and disregard the rest of jck exclude lists
// when running a test via jck_custom.
if (task == null || !task.equals("custom")) {
fileContent += "set jck.excludeList.customFiles \"" + initialJtxFullPath + " " + jtxFullPath + " " + kflFullPath + " " + testFlagJtxFullPath + "\";\n";
fileContent += "set jck.excludeList.customFiles \"" + initialJtxFullPath + " " + jtxFullPath + " " + jtxDevFullPath + " " + customJtx + " " + kflFullPath + " " + testFlagJtxFullPath + "\";\n";
} else {
fileContent += "set jck.excludeList.customFiles \"" + initialJtxFullPath + " " + jtxFullPath + " " + kflFullPath + "\";\n";
fileContent += "set jck.excludeList.customFiles \"" + initialJtxFullPath + " " + jtxFullPath + " " + jtxDevFullPath + " " + customJtx + " " + kflFullPath + "\";\n";
}

fileContent += "runTests" + ";\n";
Expand Down