Use source locations in JUnit export when available
I have been working on outputting test results in JUnit's XML format. This will allow us to upload test results as artifacts from GitLab CI, and the results can be displayed on merge requests (see https://docs.gitlab.com/ce/ci/junit_test_reports.html#how-it-works for details).
For this to work, the export should ideally also contain the module name of failing tests, so that the merge request UI can display this information. This collection of MRs adds support for location information (currently only module name) and adds this information to tests generated by test-properties.
-
clean-platform!264 (merged) is needed to add location support to the common interface for the test tools. I have added this as a new record, currently with only one field (
loc_module
), so that it can easily be extended in the future. -
gast!27 (merged) is needed to keep track of the location in Gast. It is either retrieved from the binary (in the
Testable
instance for(a -> b)
, for example), or provided by the programmer withlocation_and_name
. -
clean-test-properties!1 (merged) is needed to use this
location_and_name
. - iTasks-SDK!299 (merged) updates for changes to Platform.
(CI on most of these fails because of dependencies between them.)
Our tests are currently still a bit ad hoc and this may seem unneeded, but hopefully in the future we will have more tests. Of course, these will not all be generated by test-properties (or even use Gast; e.g. iTasks-SDK#153). We will then have to think about ways to get location information in such other scenarios.
Here is what the UI looks like on a test project with a property named rem
on a function some_sequence
:
Clicking on the failed test reveals the module name main
: