diff --git a/doc/testing.html b/doc/testing.html index e57a73a59b4..e77ac0e03bf 100644 --- a/doc/testing.html +++ b/doc/testing.html @@ -27,6 +27,7 @@

Testing the JDK

  • Configuration
  • Test selection
  • @@ -59,6 +60,19 @@

    Test selection

    All functionality is available using the run-test make target. In this use case, the test or tests to be executed is controlled using the TEST variable. To speed up subsequent test runs with no source code changes, run-test-only can be used instead, which do not depend on the source and test image build.

    For some common top-level tests, direct make targets have been generated. This includes all JTReg test groups, the hotspot gtest, and custom tests (if present). This means that make run-test-tier1 is equivalent to make run-test TEST="tier1", but the latter is more tab-completion friendly. For more complex test runs, the run-test TEST="x" solution needs to be used.

    The test specifications given in TEST is parsed into fully qualified test descriptors, which clearly and unambigously show which tests will be run. As an example, :tier1 will expand to jtreg:$(TOPDIR)/test/hotspot/jtreg:tier1 jtreg:$(TOPDIR)/test/jdk:tier1 jtreg:$(TOPDIR)/test/langtools:tier1 jtreg:$(TOPDIR)/test/nashorn:tier1 jtreg:$(TOPDIR)/test/jaxp:tier1. You can always submit a list of fully qualified test descriptors in the TEST variable if you want to shortcut the parser.

    +

    Common Test Groups

    +

    Ideally, all tests are run for every change but this may not be practical due to the limited testing resources, the scope of the change, etc.

    +

    The source tree currently defines a few common test groups in the relevant TEST.groups files. There are test groups that cover a specific component, for example hotspot_gc. It is a good idea to look into TEST.groups files to get a sense what tests are relevant to a particular JDK component.

    +

    Component-specific tests may miss some unintended consequences of a change, so other tests should also be run. Again, it might be impractical to run all tests, and therefore tiered test groups exist. Tiered test groups are not component-specific, but rather cover the significant parts of the entire JDK.

    +

    Multiple tiers allow balancing test coverage and testing costs. Lower test tiers are supposed to contain the simpler, quicker and more stable tests. Higher tiers are supposed to contain progressively more thorough, slower, and sometimes less stable tests, or the tests that require special configuration.

    +

    Contributors are expected to run the tests for the areas that are changed, and the first N tiers they can afford to run, but at least tier1.

    +

    A brief description of the tiered test groups:

    +

    JTReg

    JTReg tests can be selected either by picking a JTReg test group, or a selection of files or directories containing JTReg tests.

    JTReg test groups can be specified either without a test root, e.g. :tier1 (or tier1, the initial colon is optional), or with, e.g. hotspot:tier1, test/jdk:jdk_util or $(TOPDIR)/test/hotspot/jtreg:hotspot_all. The test root can be specified either as an absolute path, or a path relative to the JDK top directory, or the test directory. For simplicity, the hotspot JTReg test root, which really is hotspot/jtreg can be abbreviated as just hotspot.

    diff --git a/doc/testing.md b/doc/testing.md index e36e73d1e95..34b5b8e7868 100644 --- a/doc/testing.md +++ b/doc/testing.md @@ -52,6 +52,52 @@ jtreg:$(TOPDIR)/test/nashorn:tier1 jtreg:$(TOPDIR)/test/jaxp:tier1`. You can always submit a list of fully qualified test descriptors in the `TEST` variable if you want to shortcut the parser. +### Common Test Groups + +Ideally, all tests are run for every change but this may not be practical due to the limited +testing resources, the scope of the change, etc. + +The source tree currently defines a few common test groups in the relevant `TEST.groups` +files. There are test groups that cover a specific component, for example `hotspot_gc`. +It is a good idea to look into `TEST.groups` files to get a sense what tests are relevant +to a particular JDK component. + +Component-specific tests may miss some unintended consequences of a change, so other +tests should also be run. Again, it might be impractical to run all tests, and therefore +_tiered_ test groups exist. Tiered test groups are not component-specific, but rather cover +the significant parts of the entire JDK. + +Multiple tiers allow balancing test coverage and testing costs. Lower test tiers are supposed to +contain the simpler, quicker and more stable tests. Higher tiers are supposed to contain +progressively more thorough, slower, and sometimes less stable tests, or the tests that require +special configuration. + +Contributors are expected to run the tests for the areas that are changed, and the first N tiers +they can afford to run, but at least tier1. + +A brief description of the tiered test groups: + +- `tier1`: This is the lowest test tier. Multiple developers run these tests every day. +Because of the widespread use, the tests in `tier1` are carefully selected and optimized to run +fast, and to run in the most stable manner. The test failures in `tier1` are usually followed up +on quickly, either with fixes, or adding relevant tests to problem list. GitHub Actions workflows, +if enabled, run `tier1` tests. + +- `tier2`: This test group covers even more ground. These contain, among other things, +tests that either run for too long to be at `tier1`, or may require special configuration, +or tests that are less stable, or cover the broader range of non-core JVM and JDK features/components +(for example, XML). + +- `tier3`: This test group includes more stressful tests, the tests for corner cases +not covered by previous tiers, plus the tests that require GUIs. As such, this suite +should either be run with low concurrency (`TEST_JOBS=1`), or without headful tests +(`JTREG_KEYWORDS=\!headful`), or both. + +- `tier4`: This test group includes every other test not covered by previous tiers. It includes, +for example, `vmTestbase` suites for Hotspot, which run for many hours even on large +machines. It also runs GUI tests, so the same `TEST_JOBS` and `JTREG_KEYWORDS` caveats +apply. + ### JTReg JTReg tests can be selected either by picking a JTReg test group, or a selection