-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8324641: [IR Framework] Add Setup method to provide custom arguments and set fields #17557
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
Conversation
|
👋 Welcome back epeter! A progress list of the required criteria for merging this PR into |
Webrevs
|
chhagedorn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a nice feature! I have a few comments.
As already discussed offline, I think we should clean up the entire code in the test VM and group verification code together to avoid spreading it all over the place. But this should not block this PR and should be done separately.
test/hotspot/jtreg/compiler/lib/ir_framework/test/ArgumentValue.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Christian Hagedorn <christian.hagedorn@oracle.com>
chhagedorn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the updates. I will have a closer look again at the README tomorrow but the code changes look good.
What's missing are some good and bad tests that use the new features. SetupExample.java already provides some good working examples and maybe that's sufficient. Maybe you can double check if it's worth to add some more good (i.e. non-failing) tests.
The bad tests can be added to TestBadFormat which should include things like a @Setup test without a corresponding @Test method, mixing setup and value etc. Can you add some of these bad tests?
test/hotspot/jtreg/compiler/lib/ir_framework/test/ArgumentsProvider.java
Outdated
Show resolved
Hide resolved
test/hotspot/jtreg/compiler/lib/ir_framework/test/ArgumentsProvider.java
Outdated
Show resolved
Hide resolved
|
@chhagedorn I have added quite a few tests now, and fixed a few bugs with them 😊 |
chhagedorn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding all these tests! I have some suggestions but only minor things and some more bad test ideas (if I did not miss that you already tested that).
| } catch (Exception e) { | ||
| throw new TestRunException("There was an error while invoking setup method " + | ||
| setupMethod + " on " + target + ", " + e); | ||
| setupMethod + " on " + target, e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was hard to spot as we've discussed offline :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm glad I fixed it!
Thanks for the help when debugging!
test/hotspot/jtreg/testlibrary_tests/ir_framework/examples/SetupExample.java
Outdated
Show resolved
Hide resolved
test/hotspot/jtreg/testlibrary_tests/ir_framework/examples/SetupExample.java
Outdated
Show resolved
Hide resolved
test/hotspot/jtreg/testlibrary_tests/ir_framework/examples/SetupExample.java
Outdated
Show resolved
Hide resolved
test/hotspot/jtreg/testlibrary_tests/ir_framework/examples/SetupExample.java
Outdated
Show resolved
Hide resolved
test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestBadFormat.java
Outdated
Show resolved
Hide resolved
test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestSetupTests.java
Show resolved
Hide resolved
thanks Christian! Co-authored-by: Christian Hagedorn <christian.hagedorn@oracle.com>
chhagedorn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for all the updates - looks good!
|
@eme64 This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be: You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been no new commits pushed to the ➡️ To integrate this PR with the above commit message to the |
TobiHartmann
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice. The changes look good to me.
|
Thanks @chhagedorn for all the discussions, brainstorming etc, and the detailed review 😊 |
|
Going to push as commit 8d9ad97.
Your commit was automatically rebased without conflicts. |
Bigger goal
I am tired of always writing IR tests where I have to write elaborate code in the
@Runmethod to create inputs, and then run the test method to creategoldoutput values in (hopefully) interpreter mode, and then later verify the results of the compiled method.Hence, I now introduce the "Setup" method, which can create custom argument values.
In a later RFE, I will implement automatic result verification, which implicitly intercepts the inputs and outputs of the test method, and compares the behaviour of the interpreter and the compiled code. That way, the pattern will be:
In this RFE: the Setup Method
The first step is the setup method.
Example:
jdk/test/hotspot/jtreg/testlibrary_tests/ir_framework/examples/SetupExample.java
Lines 49 to 87 in 08670a5
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/17557/head:pull/17557$ git checkout pull/17557Update a local copy of the PR:
$ git checkout pull/17557$ git pull https://git.openjdk.org/jdk.git pull/17557/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 17557View PR using the GUI difftool:
$ git pr show -t 17557Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/17557.diff
Webrev
Link to Webrev Comment