Openjdk-tests: Enable to run tests against a Java which is not the one in the AdoptOpenJDK upstream job

Created on 23 Nov 2017  路  8Comments  路  Source: AdoptOpenJDK/openjdk-tests

I want to run the tests in the test job but against a Java which is not the one in the AdoptOpenJDK upstream job. Can we enable that?

question

Most helpful comment

To make it clear "upstream " story is not limited to adoptOpenjdk build. It supports any sdk build as long as upstream build name and build number is passed in test job.

I will update README.md to make it clear.

All 8 comments

Yes, if it's jdk from AdoptOpenJDK releases or nightly builds you can just simply set SDK_RESOURCE to releases/nightly.

Or if you have your own jdk to test against, you can run get.sh directly without option --sdkdir | -s:
get.sh -t openjdk-testsDIR -p platform -v jvmversion [-s downloadBinarySDKDIR]

@sophia-guo How I can do that using our own jenkin server,
So here is the scenario,

Currently in openjdk-tests repo, we have JTreg test under https://github.com/AdoptOpenJDK/openjdk-tests/tree/master/openjdk_regression.
We are creating a job in our IBMSDK Jenkins server https://hyc-rt-openjdk-jenkins.swg-devops.com/job/ibmsdk_test_build/configure, which is copy of https://ci.adoptopenjdk.net/view/OpenJDK%20tests/job/openjdk8_openj9_test_x86-64_linux/configure & can run JTreg tests.
We have created same label slave as Adoptopenjdk has (To get similar structure as Adoptopenjdk).

Issue what we are seeing now, if our job running with https://github.com/AdoptOpenJDK/openjdk-tests/blob/master/buildenv/jenkins/Jenkinsfile in the test pipeline, How the Jenkin file would know that tests needs to run in our IBMSDK build not the AdoptopenJDK provides.
Example our jenkin clone the IBMSDK source code and then build that which would be something like this,/home/jenkins/workspace/build_ibmsdk/IBMSDK-java/build/linux-x86_64-normal-server-release/
and then ideally we run the tests (in this case clone openjdk-test, and run Jenkinfile) and save that in artifacts.
Do we have any parameter or option in https://github.com/AdoptOpenJDK/openjdk-tests/blob/master/buildenv/jenkins/Jenkinsfile , where we can define external jenkin build location or different job which generate build and save that into artifacts?

I guess what you are suggesting is to run this in your local build in the local machine. Correct me if I have not understood correctly ?

@archanaNogriya as mentioned in discussion with you before, we will rework this script, but be aware, there are additional changes coming to the testing at AdoptOpenJDK (re: top level make targets and possibly even node labels in Jenkins), so we will be in flux for a little while.

@sophia-guo - ultimately this request is to make the Jenkinsfile generic enough that we can accept any SDK to be tested, much like the internal jobs do (optional parameter for an SDK_URL indicating where we can pick up an SDK to test, see TargetBasedPersonalBuild job in the urv-jenkins.canlab instance). By making a few 'upgrades' to testkitgen and our Jenkinsfiles, it will allow any participating teams at AdoptOpenJDK be able to easily setup their own customized internal Jenkins-based testing of an SDK based off the same model of testing at AdoptOpenJDK.

@ShelleyLambert yes, we can enhance to support customized build with specified SDK.

@archanaNogriya the scenario you mentioned is exactly same as adoptOpenjdk sdk build scenario.
If you go to configuration of "openjdk8_build_x86-64_linux" you can see that after "the execute shell" we add Trigger/call builds on other projects, which pass in all predefined parameters. The most important ones are "UPSTREAM_JOB_NAME=$JOB_NAME
UPSTREAM_JOB_NUMBER=$BUILD_NUMBER", which tells test builds to grab sdk from this specific jenkins build.

I have checked your jenkins build, which is using Pipeline. You can update your pipeline script to trigger your test jobs, code would likes:
build job: 'ibmsdk_test_build', parameters: [string(name: 'PLATFORM', value: 'x64_linux'), string(name: 'JAVA_VERSION', value: 'SE80), ... string(name: 'UPSTREAM_JOB_NAME', value: "${JOB_NAME}"), string(name: 'UPSTREAM_JOB_NUMBER', value: "${BUILD_NUMBER}")]

In this way test will use sdk from your home/jenkins/workspace/build_ibmsdk/IBMSDK-java/build/linux-x86_64-normal-server-release. The only thing need to double check is you will need to archive your sdk in your sdk jenkins build.

To make it clear "upstream " story is not limited to adoptOpenjdk build. It supports any sdk build as long as upstream build name and build number is passed in test job.

I will update README.md to make it clear.

This is really cool, a goal of the AdoptOpenJDK build farm is to provide a technology platform that others can easily adopt. Thanks @sophia-guo and @smlambert for making this happen on the testing side!

Perfect thanks @sophia-guo & @ShelleyLambert . let me try that.

If I am not mistaken, you have been able to use the Jenkinsfile for your builds.

I should also note that we will also clean up the '&&64' hard-coded part of the script, so that it too will be passed in as part of the MACHINE_LABEL, to allow for most flexibility.

Since I believe this issue has now been addressed, I will close it. (Any new requirements can get opened as new issue/enhancements).

Was this page helpful?
0 / 5 - 0 ratings