Don't truncate subsecond precision in run-tests.php JUNIT output #7836
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.
When run-tests.php has been typed[1], the type of
$time
has beenchosen to be
int
. This, however, leads to truncation, and thesomewhat relevant subsecond precision is lost. We fix that by
changing the type to
float
, althoughint|string
would be moreappropriate, but requires PHP ≥ 7.4.0. Another option would be to
move the
number_format()
formatting intojunit_mark_test_as()
.[1] 11274f5
I've noticed this due to https://dev.azure.com/phpazuredevops/PHP/_build/results?buildId=22476&view=logs&j=0d3730b8-0d59-574b-ab4a-5e189a74d53b&t=492e5677-f211-533f-274d-3a4af39d4cce&l=42.