7904061: Enable JMH integration tests to be executed against other impls #163
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
NOTE: This PR should be marked as draft because not all tests have been migrated to this setup. I've migrated the ones in the root test package to get a feel on how things would work and get feedback on whether this approach is fine for the JMH community.
This is the last in a series of PRs extending JMH to benchmark Java code running as GraalVM native images more easily.
In this PR:
jmh-core-it
test jar to be created so that JMH extensions can consume it.RunnerFactory
interface with a method calledcreateRunner
that by default creates JMH'sRunner
instance. JMH extensions that want to run the same test with a different runner would apply changes like these. Here the JMH extension extends the defaultRunnerFactory
interface, and extends individual test classes to make them implement the extended runner factory interface.The result of both these changes enables JMH tests to be executed with the JMH extension:
Note that above we can observe that one of the JMH tests is disabled. It could happen that several JMH tests are not applicable to native image, e.g. perfasm tests. In the usage changes above we can observe how JUnit's
@Ignore
annotation can be easily used to disable particular tests as needed. In the particular case ofPrintFlags
, the JMH extension could filter this flag and not pass on (there are already such cases) so with that modification the test could pass but I left it as is so that test exclusion can be demonstrated for this PR.Here is the PR list for reference:
Progress
Issue
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jmh.git pull/163/head:pull/163
$ git checkout pull/163
Update a local copy of the PR:
$ git checkout pull/163
$ git pull https://git.openjdk.org/jmh.git pull/163/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 163
View PR using the GUI difftool:
$ git pr show -t 163
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jmh/pull/163.diff
Using Webrev
Link to Webrev Comment