Skip to content
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

Unit tests for Checkstyle GUI components #11475

Closed
pbludov opened this issue Mar 27, 2022 · 3 comments
Closed

Unit tests for Checkstyle GUI components #11475

pbludov opened this issue Mar 27, 2022 · 3 comments

Comments

@pbludov
Copy link
Member

pbludov commented Mar 27, 2022

Issue

Checkstyle has minimalist graphical interface, used by developers for troubleshooting and research purpose.
This feature is not important, and has no much support. There is no tests for GUI in Checkstyle (except for the model).
And there is a reason for this. GUI tests require a physical display and exclusive access to input interfaces.
As a result, it is possible to break the GUI after some refactoring. See #9004 for example.

Idea

However, this can be done with caciocavallo, a pure virtual AWT driver.
With Cacio, all GUI windows are invisible and untouchable. This means that we can use it in CI and on the developer's PC without distracting the user with unexpected pop-ups.

Restrictions

  • The behavior of AWT components depends on the toolkit. On Mac, Linux and Windows, anything may be different. And, of course, it will be something different for the virtual toolkit. So it is impossible to gain 100% coverage for GUI: we need, for example, some lines of Windows-specific code and such code can be tested only on Windows.
  • Another restriction is modal dialogs: all of them should be mocked to prevent hanging of tests.

Result

The goal of this issue is to set up initial configuration for GUI tests and write tests for some components to validate this approach.
The improvement of GUI coverage should be done in other issues.

@pbludov pbludov self-assigned this Mar 27, 2022
pbludov added a commit to pbludov/checkstyle that referenced this issue Mar 27, 2022
pbludov added a commit to pbludov/checkstyle that referenced this issue Mar 27, 2022
pbludov added a commit to pbludov/checkstyle that referenced this issue Mar 27, 2022
pbludov added a commit to pbludov/checkstyle that referenced this issue Mar 27, 2022
pbludov added a commit to pbludov/checkstyle that referenced this issue Mar 29, 2022
pbludov added a commit to pbludov/checkstyle that referenced this issue Mar 29, 2022
pbludov added a commit to pbludov/checkstyle that referenced this issue Mar 29, 2022
pbludov added a commit to pbludov/checkstyle that referenced this issue Mar 29, 2022
pbludov added a commit to pbludov/checkstyle that referenced this issue Mar 29, 2022
nrmancuso pushed a commit to nrmancuso/checkstyle that referenced this issue Apr 1, 2022
pbludov added a commit to pbludov/checkstyle that referenced this issue Apr 2, 2022
pbludov added a commit to pbludov/checkstyle that referenced this issue Apr 2, 2022
romani pushed a commit that referenced this issue Apr 2, 2022
@romani
Copy link
Member

romani commented Apr 2, 2022

@pbludov , I presume we need to keep this issue to remove all excludes on gui classes.

Better to create new issue with more details on how exactly do updates what is left to do

@romani romani added this to the 10.2 milestone Apr 2, 2022
@pbludov pbludov closed this as completed Apr 2, 2022
@pbludov
Copy link
Member Author

pbludov commented Apr 2, 2022

Nick is working on #11482 right now. We should merge it. Then it will be possible to calculate the coverage %.

@pbludov
Copy link
Member Author

pbludov commented Apr 5, 2022

Continuation of this issue will be done in #11514

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants