-
Notifications
You must be signed in to change notification settings - Fork 437
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
8319555: [TestBug] Utility for creating instruction window for manual tests #1413
base: master
Are you sure you want to change the base?
8319555: [TestBug] Utility for creating instruction window for manual tests #1413
Conversation
👋 Welcome back angorya! A progress list of the required criteria for merging this PR into |
❗ This change is not yet ready to be integrated. |
Webrevs
|
Not a review, but just a general comment or two.
That seems reasonable, but...
I'm not sure how much value there is in moving the files under a "src" directory without also providing a build script (ant or gradle) to be able to build it. We don't currently have the manual tests wired up to the build, so there is no good way to depend on anything outside of the directory in question (at least not without using an IDE, which is a developer convenience, not a build system). That should probably be solved first.
For all manual tests? Probably not. |
Thank you Kevin for the feedback! I had problems configuring the project with sources being in the root, but will take another look. |
66d7d0d
to
22da890
Compare
@andy-goryachev-oracle Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. See OpenJDK Developers’ Guide for more information. |
Moved the sources back to the root. Eclipse has a weird behavior when it comes to modular projects or mixing modular and classpath sources: the project which has been modified (or converted to modular or back) needs to be closed and re-opened, otherwise Eclipse loses its marbles. Both 2023-06 and 2024-03 versions seem to exhibit this behavior. |
@mstr2 @jperedadnr @sashamatveev @aghaisas |
This could use a second pair of eyes. I don't have time right now, but I'll add a couple comments. /reviewers 2 |
@kevinrushforth |
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 left one general comment inline. I also have a question about how to build this without a build script given that the utility is in a separate directory tree from the test application (EmojiText) that you updated to use this?
At a minimum, you need instructions for compiling and running it on the command line, but it might be better to defer this until we can wire up the manual tests to the build (which would be a good test sprint task).
tests/manual/text/EmojiTest.java
Outdated
|
||
"""; | ||
|
||
public class EmojiTest { |
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.
Our existing manual tests all extend Application
. Is there a reason this has to change? Absent a compelling reason, I'd prefer to not require test apps to stop extending Application in order to use this utility.
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.
Everything, including creating an instance of Application, is taken care of by the ManualTestWindow
. This simplifies the test code greatly.
What is the reason that the test must extend Application
?
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.
For example if test needs to access getParameters()
or getHostServices ()
from Application
how it can be done? I think it might be better to extend ManualTestWindow
from Application
and require test itself to extend ManualTestWindow
. In this case tests will extend Application
.
tests/manual/util/README.md
Outdated
Provide | ||
multi-line instructions here. | ||
""" | ||
). |
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.
Add size(1200, 800).
to example. I think adjusting size will be common enough and no need to look at ManualTestWindow
to figure it out.
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.
good point!
} | ||
``` | ||
|
||
Resulting application window: |
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.
Resulting application window does not look like it is from example above. Not sure if it is important.
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.
Not really important.
Apart from being resized to decrease the size of the PNG image, it looks exactly the same. Are you running it on a different platform? How does it look, anything appears missing (can you post a screenshot)?
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.
If you run EmojiTest
, then yes it will look correct, but if you run SampleManualTest
it will not. Since you added this image to SampleManualTest
as resulting image of SampleManualTest
. Look at ReadMe.md.
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.
indeed! thanks!
// TODO timeout | ||
// TODO log area | ||
// TODO screenshots on failure? | ||
// TODO initial position? |
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.
In general I do not like TODO in comments. You can file follow up issue to improve/extend ManualTestWindow
if needed.
stage.setWidth(width == 0 ? 800 : width); | ||
stage.setHeight(height == 0 ? 600 : height); |
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 think width
and height
is double
and not int
. Also, lets not change it. If test wants 0, then pass 0.
Thank you all for comments and suggestions! |
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.
Only minor comment about unused code. Otherwise looks fine to me.
/* | ||
Button screenshotButton = new Button("Screenshot"); | ||
screenshotButton.setMinWidth(100); | ||
screenshotButton.setOnAction((ev) -> { | ||
}); | ||
screenshotButton.setDisable(true); | ||
*/ |
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 will suggest to delete unused code.
|
||
HBox buttons = new HBox( | ||
10, | ||
//screenshotButton, |
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.
Same here.
|
it's in the test code, but ok - removed commented out code. thanks! |
@andy-goryachev-oracle This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
keep-alive |
I run manual tests on the command line like so:
This doesn't work with the new utility class, since it is outside of the class file hierarchy. |
I am running from within Eclipse. Here is the command line (remove newlines) it launches the EmojiTest. I think the key is to add the location of compiled classes via
(also, there might be some unnecessary -add-exports here as well) |
But this is a good question: is there a better way to organize the tests to make it easier to use common code? |
Yes this will work, but it requires me to compile |
We need to provide a build script for any manual test that isn't self-contained in a single directory (see my earlier comment). For example, we have a build script for MonkeyTester and FXMediaPlayer. As a separate step, we could make it available as part of the gradle build, as long as we can do it without adding individual tests to build.gradle (sort of like we do for apps), but the previous is the minimum. This should probably be put on the back burner until the next test sprint. |
or possibly build the common test code into a jar as a part of the standard build and include it along with |
moving to DRAFT until the next test sprint (after jfx23 ships). |
ManualTestWindow
This facility provides the base class for manual tests which displays the test instructions,
the UI under test, and the Pass/Fail buttons.
Example:
Resulting application window:
Readme:
https://github.com/andy-goryachev-oracle/jfx/blob/8319555.manual/tests/manual/util/README.md
@prrace 's test EmojiTest has been converted to use the new test window as a demonstration (also fixed the Eclipse project so it works now).
Q: What other features can be added to the test window?
Edit: the sources are left in their original place at the root of the project.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jfx.git pull/1413/head:pull/1413
$ git checkout pull/1413
Update a local copy of the PR:
$ git checkout pull/1413
$ git pull https://git.openjdk.org/jfx.git pull/1413/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 1413
View PR using the GUI difftool:
$ git pr show -t 1413
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/1413.diff
Webrev
Link to Webrev Comment