-
Notifications
You must be signed in to change notification settings - Fork 722
Reproducing Test Failures Locally
These are the general steps that we apply to running a great variety of tests. We use TestKitGen, a thin veneer used to standardize the diverse set of test frameworks employed by the underlying tests.
-
Ensure test machine is set up with test prereqs.
-
Build or download/unpack the SDK you want to test to /someLocation
-
export TEST_JDK_HOME=/someLocation // set test JDK home. On windows, the windows path format is expected. (i.e., TEST_JDK_HOME=C:\someLocation )
-
git clone https://github.com/adoptium/aqa-tests.git (to /testLocation)
-
cd aqa-tests
-
./get.sh
-
cd TKG
-
export environment variables suitable for the SDK under test (i.e., export BUILD_LIST=functional )
-
make compile // fetches test material and compiles it, based on build.xml files in the test directories
-
make _< someTestTarget > // executes the test target (can be test group, level, level.group or specific test). i.e., openjdk (all tests in openjdk group), sanity.functional (all functional tests labelled at sanity level), extended.system (all system tests labelled at extended level), jdk_math (the specific jdk_math target defined as part of openjdk group), MauveMultiThreadLoadTest_0 (the first variation of the specific system test called MauveMultiThreadLoadTest), etc
Below is a list of common scenarios. As you can see, the approach to running the different groups of tests is very similar. With minimal changes to environment variables and target names, a great variety of test scenarios can be run. These instructions can be used for running any group of tests on any JDK version, any JDK implementation, and any platform/spec. For more details, please see the OpenJ9 Test Documentation.
There are a number of degrees of freedom by which you can generate, compile and execute test targets. Some variants are:
- test group [functional|system|openjdk|external|perf]
- level [sanity|extended|special]
- jdk version - [8|9|10|11]
- jdk impl - [openj9|hotspot|sap|ibm]
- spec - [linux_x86-64_cmprssptrs|linux_x86-64| etc] - as listed in buildspecs
JDK_VERSION, JDK_IMPL and SPEC can be auto-detected by our test framework, so setting those environment variables explicitly is no longer required.
If needed, users can turn off the auto-detection by setting AUTO_DETECT=off. If users set AUTO_DETECT off, then JDK_VERSION, JDK_IMPL and SPEC values are required.
Test group | JDK version | JDK impl | Platform/Spec | Env variables |
---|---|---|---|---|
functional | 8 | openj9 | x64_linux/linux_x86-64_cmprssptrs | export TEST_JDK_HOME=/someLocation export BUILD_LIST=functional |
system | 10 | openj9 | x64_linux/linux_x86-64_cmprssptrs | export TEST_JDK_HOME=/someLocation export BUILD_LIST=system |
openjdk | 11 | hotspot | x64_mac/macos_x86-64 | export TEST_JDK_HOME=/someLocation export BUILD_LIST=openjdk |
openjdk | 11 | openj9 | s390x_linux/linux_390-64_cmprssptrs | export TEST_JDK_HOME=/someLocation export BUILD_LIST=openjdk export JDK_CUSTOM_TARGET=java/lang/Class/GetModuleTest.java |
external | 8 | openj9 | x86_linux/linux_x86-64_cmprssptrs | export TEST_JDK_HOME=/someLocation export BUILD_LIST=external |
perf | 11 | openj9 | x86_linux/linux_x86-64_cmprssptrs | export TEST_JDK_HOME=/someLocation export BUILD_LIST=perf |
- Build or unpack the jdk8_x86-64_linux_openj9 SDK to /someLocation
- export TEST_JDK_HOME=/someLocation
- git clone https://github.com/adoptium/aqa-tests.git (to /testLocation)
- cd aqa-tests
- ./get.sh
- cd TKG
- export BUILD_LIST=functional
- make compile
- make _extended.functional
export NATIVE_TEST_LIBS=<path to native test libraries> (default to native-test-libs folder at same level as TEST_JDK_HOME)
- Build or unpack the jdk10_x86-64_linux_openj9 SDK to /someLocation
- export TEST_JDK_HOME=/someLocation
- git clone https://github.com/adoptium/aqa-tests.git (to /testLocation)
- cd aqa-tests
- ./get.sh
- cd TKG
- export BUILD_LIST=functional/JLM_Tests
- make compile
- make _sanity
- Build or unpack the jdk10_x86-64_linux_openj9 SDK to /someLocation
- export TEST_JDK_HOME=/someLocation
- git clone https://github.com/adoptium/aqa-tests.git (to /testLocation)
- cd aqa-tests
- ./get.sh
- cd TKG
- export BUILD_LIST=system
- make compile
- make _sanity.system
- Build or unpack the jdk11_x64_macos_hotspot SDK to /someLocation
- export TEST_JDK_HOME=/someLocation
- git clone https://github.com/adoptium/aqa-tests.git (to /testLocation)
- cd aqa-tests
- ./get.sh
- cd TKG
- export BUILD_LIST=openjdk
- make compile
- make _sanity.openjdk
Note: if tests need native libraries, please export test image path. This is used to construct -nativepath
in openjdk.mk. For example,
export TESTIMAGE_PATH = "$WORKSPACE/jdkbinary/openjdk-test-image" (to /yourTestImageLocation)
For this example, let's run a currently excluded test, java/lang/Class/GetModuleTest.java found in exclude file
- Build or unpack the jdk11-linux-s390x-openj9 SDK to /someLocation
- export TEST_JDK_HOME=/someLocation
- git clone https://github.com/adoptium/aqa-tests.git (to /testLocation)
- cd aqa-tests
- ./get.sh
- cd TKG
- export environment variables matching the SDK under test
export BUILD_LIST=openjdk
export TARGET=jdk_custom
export JDK_CUSTOM_TARGET=test/jdk/java/lang/Class/GetModuleTest.java // <- in jdk9+, tests are in test/jdk/*
or
export JDK_CUSTOM_TARGET=jdk/test/java/lang/Class/GetModuleTest.java // <- in jdk8, tests are in jdk/test/*
depends on openjdk test path
- make compile
- make _jdk_custom
- Build or unpack the jdk8-x86-64_linux_openj9 SDK to /someLocation
- export TEST_JDK_HOME=/someLocation
- git clone https://github.com/adoptium/aqa-tests.git (to /testLocation)
- cd aqa-tests
- ./get.sh
- cd TKG
- export environment variables matching the SDK under test (
export BUILD_LIST=external/scala
andexport EXTRA_DOCKER_ARGS="-v $TEST_JDK_HOME:/opt/java/openjdk"
) - make compile
- make _scala_test
- Build or unpack the jdk11-x86-64_linux_openj9 SDK to /someLocation
- export TEST_JDK_HOME=/someLocation
- git clone https://github.com/adoptium/aqa-tests.git (to /testLocation)
- cd aqa-tests
- ./get.sh
- cd TKG export BUILD_LIST=perf/idle_micro
- make compile
- make _IdleMicrobenchmark_J9