Mercurial > hg
changeset 41744:0ae89ab3f025
test: stabilize test-run-tests.t output
We have reached a point where the duration in JSON reports of
`test-run-tests.t` were greater or equal than 10 seconds, which doesn't match
anymore the regex. For example here:
https://ci.octobus.net/blue/organizations/jenkins/MercurialPy2/detail/MercurialPy2/276/pipeline
```
"diff": "", ? (re)
- "end": "\s*[\d\.]{4,5}", ? (re)
+ "end": "10.040",
"result": "skip", ? (re)
```
Instead of accepting more characters, I changed the regex to accept any number
of digits before the `.` then 3 or 4 digits after. This way the regex is more
precise (only one `.` is authorized and we can ensure that the precision
doesn't change).
Differential Revision: https://phab.mercurial-scm.org/D5966
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Thu, 14 Feb 2019 15:35:47 +0100 |
parents | 1c4d6ab2ecb8 |
children | 83d294c71f1e |
files | tests/test-run-tests.t |
diffstat | 1 files changed, 45 insertions(+), 45 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/test-run-tests.t Thu Feb 14 14:36:16 2019 +0100 +++ b/tests/test-run-tests.t Thu Feb 14 15:35:47 2019 +0100 @@ -1174,31 +1174,31 @@ $ cat report.json testreport ={ "test-failure.t": [\{] (re) - "csys": "\s*[\d\.]{4,5}", ? (re) - "cuser": "\s*[\d\.]{4,5}", ? (re) + "csys": "\s*\d+\.\d{3,4}", ? (re) + "cuser": "\s*\d+\.\d{3,4}", ? (re) "diff": "---.+\+\+\+.+", ? (re) - "end": "\s*[\d\.]{4,5}", ? (re) + "end": "\s*\d+\.\d{3,4}", ? (re) "result": "failure", ? (re) - "start": "\s*[\d\.]{4,5}", ? (re) - "time": "\s*[\d\.]{4,5}" (re) + "start": "\s*\d+\.\d{3,4}", ? (re) + "time": "\s*\d+\.\d{3,4}" (re) }, ? (re) "test-skip.t": { - "csys": "\s*[\d\.]{4,5}", ? (re) - "cuser": "\s*[\d\.]{4,5}", ? (re) + "csys": "\s*\d+\.\d{3,4}", ? (re) + "cuser": "\s*\d+\.\d{3,4}", ? (re) "diff": "", ? (re) - "end": "\s*[\d\.]{4,5}", ? (re) + "end": "\s*\d+\.\d{3,4}", ? (re) "result": "skip", ? (re) - "start": "\s*[\d\.]{4,5}", ? (re) - "time": "\s*[\d\.]{4,5}" (re) + "start": "\s*\d+\.\d{3,4}", ? (re) + "time": "\s*\d+\.\d{3,4}" (re) }, ? (re) "test-success.t": [\{] (re) - "csys": "\s*[\d\.]{4,5}", ? (re) - "cuser": "\s*[\d\.]{4,5}", ? (re) + "csys": "\s*\d+\.\d{3,4}", ? (re) + "cuser": "\s*\d+\.\d{3,4}", ? (re) "diff": "", ? (re) - "end": "\s*[\d\.]{4,5}", ? (re) + "end": "\s*\d+\.\d{3,4}", ? (re) "result": "success", ? (re) - "start": "\s*[\d\.]{4,5}", ? (re) - "time": "\s*[\d\.]{4,5}" (re) + "start": "\s*\d+\.\d{3,4}", ? (re) + "time": "\s*\d+\.\d{3,4}" (re) } } (no-eol) --json with --outputdir @@ -1231,31 +1231,31 @@ $ cat output/report.json testreport ={ "test-failure.t": [\{] (re) - "csys": "\s*[\d\.]{4,5}", ? (re) - "cuser": "\s*[\d\.]{4,5}", ? (re) + "csys": "\s*\d+\.\d{3,4}", ? (re) + "cuser": "\s*\d+\.\d{3,4}", ? (re) "diff": "---.+\+\+\+.+", ? (re) - "end": "\s*[\d\.]{4,5}", ? (re) + "end": "\s*\d+\.\d{3,4}", ? (re) "result": "failure", ? (re) - "start": "\s*[\d\.]{4,5}", ? (re) - "time": "\s*[\d\.]{4,5}" (re) + "start": "\s*\d+\.\d{3,4}", ? (re) + "time": "\s*\d+\.\d{3,4}" (re) }, ? (re) "test-skip.t": { - "csys": "\s*[\d\.]{4,5}", ? (re) - "cuser": "\s*[\d\.]{4,5}", ? (re) + "csys": "\s*\d+\.\d{3,4}", ? (re) + "cuser": "\s*\d+\.\d{3,4}", ? (re) "diff": "", ? (re) - "end": "\s*[\d\.]{4,5}", ? (re) + "end": "\s*\d+\.\d{3,4}", ? (re) "result": "skip", ? (re) - "start": "\s*[\d\.]{4,5}", ? (re) - "time": "\s*[\d\.]{4,5}" (re) + "start": "\s*\d+\.\d{3,4}", ? (re) + "time": "\s*\d+\.\d{3,4}" (re) }, ? (re) "test-success.t": [\{] (re) - "csys": "\s*[\d\.]{4,5}", ? (re) - "cuser": "\s*[\d\.]{4,5}", ? (re) + "csys": "\s*\d+\.\d{3,4}", ? (re) + "cuser": "\s*\d+\.\d{3,4}", ? (re) "diff": "", ? (re) - "end": "\s*[\d\.]{4,5}", ? (re) + "end": "\s*\d+\.\d{3,4}", ? (re) "result": "success", ? (re) - "start": "\s*[\d\.]{4,5}", ? (re) - "time": "\s*[\d\.]{4,5}" (re) + "start": "\s*\d+\.\d{3,4}", ? (re) + "time": "\s*\d+\.\d{3,4}" (re) } } (no-eol) $ ls -a output @@ -1287,31 +1287,31 @@ $ cat report.json testreport ={ "test-failure.t": [\{] (re) - "csys": "\s*[\d\.]{4,5}", ? (re) - "cuser": "\s*[\d\.]{4,5}", ? (re) + "csys": "\s*\d+\.\d{3,4}", ? (re) + "cuser": "\s*\d+\.\d{3,4}", ? (re) "diff": "", ? (re) - "end": "\s*[\d\.]{4,5}", ? (re) + "end": "\s*\d+\.\d{3,4}", ? (re) "result": "success", ? (re) - "start": "\s*[\d\.]{4,5}", ? (re) - "time": "\s*[\d\.]{4,5}" (re) + "start": "\s*\d+\.\d{3,4}", ? (re) + "time": "\s*\d+\.\d{3,4}" (re) }, ? (re) "test-skip.t": { - "csys": "\s*[\d\.]{4,5}", ? (re) - "cuser": "\s*[\d\.]{4,5}", ? (re) + "csys": "\s*\d+\.\d{3,4}", ? (re) + "cuser": "\s*\d+\.\d{3,4}", ? (re) "diff": "", ? (re) - "end": "\s*[\d\.]{4,5}", ? (re) + "end": "\s*\d+\.\d{3,4}", ? (re) "result": "skip", ? (re) - "start": "\s*[\d\.]{4,5}", ? (re) - "time": "\s*[\d\.]{4,5}" (re) + "start": "\s*\d+\.\d{3,4}", ? (re) + "time": "\s*\d+\.\d{3,4}" (re) }, ? (re) "test-success.t": [\{] (re) - "csys": "\s*[\d\.]{4,5}", ? (re) - "cuser": "\s*[\d\.]{4,5}", ? (re) + "csys": "\s*\d+\.\d{3,4}", ? (re) + "cuser": "\s*\d+\.\d{3,4}", ? (re) "diff": "", ? (re) - "end": "\s*[\d\.]{4,5}", ? (re) + "end": "\s*\d+\.\d{3,4}", ? (re) "result": "success", ? (re) - "start": "\s*[\d\.]{4,5}", ? (re) - "time": "\s*[\d\.]{4,5}" (re) + "start": "\s*\d+\.\d{3,4}", ? (re) + "time": "\s*\d+\.\d{3,4}" (re) } } (no-eol) $ mv backup test-failure.t