Respect headless mode instead of enforcing it #137
Merged
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.
We have a mix of vanilla unit tests, TestFX-3.2 based tests and some legacy hand-crafted JavaFX tests in the project. Our main CI build is running on a Linux server, where we have not got a graphic environment, and our target JavaFX platform is Windows anyway. We tried to segregate unit tests that could be run in a headless mode from the JavaFX tests, but that proved to be a challenge. I know there is a @category(TestFX.class) available, but category activation/deactivation is rather clumsily implemented in Junit and Maven, and also it does not play well with custom JUnit Runners. We ended up improving one of our custom Runners to automatically mark all JavaFX tests as "ignored" in headless mode, but it would be good if TestFX looked after it itself. Also, the current forcing off of headless mode is also rather non-obvious and deprives us of control during build time.