Closed bheleker closed 8 months ago
generally looks fine, some formatting issues need fixing and can you please add some test coverage
I've fixed the formatting and added unit tests for parseTime. When I have time I will add some tests for startTime after parsing xml.
Thanks
I have completed updates to startTime logic and added unit tests for the parseTime function and the start times from a jUnit test result file
not manually tested
…s, test packages, and test suites
This pull request is to add information about start times to the different test result classes. Start times are recorded using epoch milliseconds. Many tests in JUnit (and even more converted to JUnit via other plugins i.e. xUnit) include start times for test suites as well as test cases which could be useful information for third-party plugins to have. The default value is -1 for an unset start time and the package start time is the earliest start time of its test cases. Additionally, the overall test result start time is the earliest set start time of a SuiteResult. The largest adds are the parseTime method for parsing the epoch millisecond time from a timestamp and the logic for setting start times. It is intended to be as non-invasive as possible, so no logic is introduced to derive the start time of a test class, but that can be derived by those that want to use the start times. This introduces no breaking changes and no change to the frontend. It will not affect the performance or output of the plugin itself and only introduces more possible information for those extending the plugin.
Testing done
No unit tests were added for the change. However, I made the change alongside my development of an extended TestDataPublisher for pseudo-tracing and metric data collection and was able to verify that start time for suites and test cases matched what was parsed from their reports. Additionally, all unit tests are still passing as the parsing of a start time does not affect the plugin's performance. Omission of a start time simply means it is set to -1 which I verified when testing my extension. Additionally, inclusion of a non-ISO start time results in a LOGGER.warning but does not affect the program's ability to run.