I realized that our current GitHub Actions workflow was not running most of our tests, since it was missing a plugin (surefire). Thankfully since we've been running our tests locally, they all passed with the change except UI tests, which couldn't run without a display. The normal solution to this problem is to run them in headless mode, which TestFX does supposedly support. However, this requires another package Monocle, which is very old (last release build is for JDK12...), and which includes some unfixed bugs which cause some of our UI tests to fail on headless mode (6-7 tests).
As an alternative, this PR makes the following changes:
The surefire plugin is now enabled.
Tests that require a UI/headless mode are separated into their own package now, under src/tests/ui/ and then their normal path. This includes all view tests (predictably), plus the add and remove command tests.
The maven workflow has been modified to exclude the UI tests. All other tests will still be run, which is better than the current state of affairs.
With these changes, all non-UI tests would now be properly run on GitHub Actions. For UI tests, we will need to ensure they all pass locally, and when reviewing a PR, the reviewer should also go and run the UI tests locally if possible, in addition to making sure the application runs normally.
I realized that our current GitHub Actions workflow was not running most of our tests, since it was missing a plugin (surefire). Thankfully since we've been running our tests locally, they all passed with the change except UI tests, which couldn't run without a display. The normal solution to this problem is to run them in headless mode, which TestFX does supposedly support. However, this requires another package Monocle, which is very old (last release build is for JDK12...), and which includes some unfixed bugs which cause some of our UI tests to fail on headless mode (6-7 tests).
As an alternative, this PR makes the following changes:
With these changes, all non-UI tests would now be properly run on GitHub Actions. For UI tests, we will need to ensure they all pass locally, and when reviewing a PR, the reviewer should also go and run the UI tests locally if possible, in addition to making sure the application runs normally.