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

Parse problem list and generate json file #2698

Closed
llxia opened this issue Jun 30, 2021 · 18 comments
Closed

Parse problem list and generate json file #2698

llxia opened this issue Jun 30, 2021 · 18 comments

Comments

@llxia
Copy link
Contributor

llxia commented Jun 30, 2021

As part of Create a Disabled tests pipeline, we need to parse openjdk problemlist and get json file:

[{
"JDK_VERSION" : 17,
"JDK_IMPL" : "hotspot",
"TARGET" : "jdk_custom",
"CUSTOM_TARGET" : "java/lang/ClassLoader/nativeLibrary/NativeLibraryTest.java",
"GIT_ISSUE" : "https://github.com/adoptium/temurin-build/issues/248",
"PLATFORM" : "all"
},{
"JDK_VERSION" : 16,
"JDK_IMPL" : "openj9",
"TARGET" : "jdk_custom",
"CUSTOM_TARGET" : "java/lang/ClassLoader/Assert.java",
"GIT_ISSUE" : "https://github.com/eclipse-openj9/openj9/issues/6668",
"PLATFORM" : "x86-64_mac"
}]
@deepak-gittyup
Copy link
Contributor

Can I pick up this task ?

@smlambert
Copy link
Contributor

Yes, certainly @deepak-gittyup ! Please ask questions in this issue if you have any.

@deepak-gittyup
Copy link
Contributor

Thanks @smlambert

Here is my understanding of the requirement:
I need to write a parser (in JAVA) that takes the excludes directory as its input and creates a json file adhering to the format shown in the expected output shown above

What should be JDK_IMPL field ?
I see that the problem list files look like:
ProblemList_openjdk<JDK_VERSION>-<JDK_IMPL>.txt // For JDK_IMPL = openj9 and sap
or
ProblemList_openjdk<JDK_VERSION>.txt // For JDK_IMPL = hotspot ?

Where should this parser be placed ?
Should it be in the same dir that contains excludes dir something like this:
aqa-tests/openjdk/tools/CreateProblemListJson.java

I picturing the usage something like this

${JAVA_HOME}/bin/java CreateProblemListJson <path to the `excludes dir`>

@smlambert
Copy link
Contributor

hi @deepak-gittyup - @llxia will give you some direction on this issue.

@llxia
Copy link
Contributor Author

llxia commented Sep 8, 2021

I need to write a parser (in JAVA) that takes the excludes directory as its input and creates a json file adhering to the format shown in the expected output shown above

Personally, I think python will be much simpler. I know this makes python one of the prerequisites, but we should only run this script on xlinux for parsing. Plus, we have some code for Query git issue url to get issue status in python already.

What should be JDK_IMPL field ?
I see that the problem list files look like:
ProblemList_openjdk<JDK_VERSION>-<JDK_IMPL>.txt // For JDK_IMPL = openj9 and sap
or
ProblemList_openjdk<JDK_VERSION>.txt // For JDK_IMPL = hotspot ?

Yes, that is correct. If JDK_IMPL is provided in the file name, use it. Otherwise, defaults to the hotspot.

Where should this parser be placed ?

Maybe create a folder called disabledTestParser under https://github.com/adoptium/aqa-tests/tree/master/. We should put all related scripts into this folder.

@deepak-gittyup
Copy link
Contributor

Thanks for the clarification @llxia
Couple of other questions

What should be the value of the TARGET?
In the examples above, I see that both of them are set to jdk_custom
"TARGET" : "jdk_custom"

What should be the value of PLATFORM ?
The first example entry above seems to be picked up from ProblemList_openjdk17.txt
Here is the line

java/lang/ClassLoader/nativeLibrary/NativeLibraryTest.java	https://github.com/adoptium/temurin-build/issues/248	generic-all

So generic-all here is mapped to "PLATFORM" : "all"

Similarly, for the 2nd example entry is from ProblemList_openjdk16-openj9.txt
Here is the line

java/lang/ClassLoader/Assert.java	https://github.com/eclipse-openj9/openj9/issues/6668	macosx-x64

macosx-x64 is mapped to "PLATFORM" : "x86-64_mac"

Is there a general rule to this name mapping ?

I see other types too:

  • linux-s390x
  • macosx-all
  • windows-all
  • aix-all
  • linux-all,aix-all,macosx-all
    .
    .
    .

@llxia
Copy link
Contributor Author

llxia commented Sep 10, 2021

@deepak-gittyup Thanks for looking into this.

What should be the value of the TARGET?

"TARGET" : "jdk_custom"
This is the same for all tests. CUSTOM_TARGET should set to the *.java file path.

Is there a general rule to this name mapping ?

The PLATFORM that we are using is https://github.com/adoptium/aqa-tests/blob/master/buildenv/jenkins/openjdk_tests#L3. You can ignore SPEC and LABEL.
The value in problemlist has to match with PLATFORM. We can have an array that contains PLATFORM. For example, macosx-all should match all PLATFORMS that contain _mac. Therefore, in json, we have

"PLATFORM" :  "x86-64_mac,aarch64_mac"

@deepak-gittyup
Copy link
Contributor

I extracted all the unique Platform values from all the ProblemList*.txt files (deliberately omitting *-all for now):
LIST1

arm-linux
linux-aarch64
linux-arm
linux-ppc64le
linux-s390x
linux-x64
macosx-x64
windows-x64
windows-x86
x86-64_windows
z/OS-s390x

Here is all the supported Platform from PLATFORM_MAP (extracted from https://github.com/adoptium/aqa-tests/blob/master/buildenv/jenkins/openjdk_tests#L3):
LIST2

arm_linux
aarch64_mac
aarch64_linux
ppc32_aix
ppc32_linux
ppc64_aix
ppc64_linux
ppc64le_linux
riscv64_linux
riscv64_linux_xl
s390_linux
s390x_linux
s390x_zos
s390x_zos_xl
s390_zos
sparcv9_solaris
x86-64_solaris
x86-64_alpine-linux
x86-32_linux
x86-32_windows
x86-64_linux
x86-64_mac
x86-64_windows

My understanding is that now I have to map items in LIST1 to items in LIST2 before adding them to the final json
Here is my attempt at mapping them:

<style> </style>
Platforms from ProblemList (LIST1) Platform from PLATFORM_MAP (equivalent from LIST2) Does these LIST2 items match the corresponding LIST1 item ?
arm-linux arm_linux  
linux-aarch64 aarch64_linux  
linux-arm arm_linux  
linux-ppc64le ppc64le_linux  
linux-s390x s390x_linux s390x_zos_xl
linux-x64 x86-64_linux  
macosx-x64 x86-64_mac aarch64_mac
windows-x64 x86-64_windows  
windows-x86   x86-32_windows
x86-64_windows x86-64_windows  
z/OS-s390x s390x_zos s390x_linux, s390x_zos_xl

Hi @llxia

  • Does the table mapping look correct to you ?

  • From LIST1, what is the difference between the below 2 items. For now, I am assuming both are same
    ** arm-linux vs linux-arm
    ** windows-x64 vs x86-64_windows

  • Comments on the last column in the table above ? (Does these LIST2 items match the corresponding LIST1 item ?)

  • None of the entires in LIST1 have an equivalent mapping for the below entires in LIST2. Any suggestions for them ?
    ppc32_linux
    ppc64_linux
    riscv64_linux
    riscv64_linux_xl
    s390_linux
    s390_zos
    sparcv9_solaris
    x86-64_solaris
    x86-64_alpine-linux
    x86-32_linux

  • Should the 32bit arch type be included in the -all equivalent. For example is the below expectation correct:

    • linux-all: arm_linux,aarch64_linux,ppc32_linux,ppc64_linux,ppc64le_linux,riscv64_linux,riscv64_linux_xl,s390_linux,s390x_linux,x86-64_alpine-linux,x86-32_linux,x86-64_linux
    • windows-all: x86-32_windows,x86-64_windows
    • aix-all: ppc32_aix, ppc64_aix
  • Last type: generic-all should literally match everything ? Or simply use all ("PLATFORM" : "all")

@llxia
Copy link
Contributor Author

llxia commented Sep 10, 2021

You can ignore *_xl. We will remove them in the future. I think windows-x86 matches with x86-64_windows and x86-32_windows

None of the entires in LIST1 have an equivalent mapping for the below entires in LIST2. Any suggestions for them ?

We need to map problemlist value to PLATFORM. Not the other way around.

Should the 32bit arch type be included in the -all equivalent.

yes

Last type: generic-all should literally match everything ? Or simply use all ("PLATFORM" : "all")

Use "PLATFORM" : "all"

@deepak-gittyup
Copy link
Contributor

Thanks for quick reply @llxia

We need to map problemlist value to PLATFORM. Not the other way around.

Yes
What I was trying to say is, currently list of all supported PLATFORM types is known
But say tomorrow one of the entires in problem list line appears like this:

java/lang/Class/forName/NonJavaNames.sh		https://github.com/eclipse-openj9/openj9/issues/xxxx	linux-apline-x64

Then the mapping will fail since I currently don't know what the problemlist value linux-alpine-x64 should map to
Visually I can see that it should be mapped to x86-64_alpine-linux

Just like we have https://github.com/adoptium/aqa-tests/blob/master/buildenv/jenkins/openjdk_tests#L3, is there a corresponding list of problemlist value that may appear in the ProblemList*.txt files ?

@deepak-gittyup
Copy link
Contributor

deepak-gittyup commented Sep 11, 2021

Here is my first attempt at writing this parser:
#2858

Please review it

@llxia
Copy link
Contributor Author

llxia commented Sep 16, 2021

@sophia-guo we seem to have two formats of Linux arm in problem list. Is it correct?

Similar question for x86-64_windows in problem list.

java/lang/Class/GetPackageBootLoaderChildLayer.java https://github.com/eclipse-openj9/openj9/issues/5274 x86-64_windows

@llxia
Copy link
Contributor Author

llxia commented Sep 16, 2021

is there a corresponding list of problemlist value that may appear in the ProblemList*.txt files ?

@deepak-gittyup thanks for PR. I am ok with hardcoded the map for the initial version. For enhancement, I think we can split the value in problem list by -. The matching PLATFORM should contain the tokens with a few exceptions.

@sophia-guo
Copy link
Contributor

@llxia that must be added by mistake. The correct format for exclude lable should be OSNAME-ARCH. That is saying linux-arm, windows-x64 are the correct one.

@llxia
Copy link
Contributor Author

llxia commented Sep 28, 2021

@sophia-guo could you please open issues for them? I think they are good first issues.

@sophia-guo
Copy link
Contributor

sophia-guo commented Sep 28, 2021

Yes, Will do. @llxia #2908

@gervaisj
Copy link
Contributor

@llxia @smlambert Should this still be open? #2858 was merged in and the parser is functional (#2910 and #2905 track further development already)

@smlambert
Copy link
Contributor

Closed via #2858

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants