[SERVER-48212] Unittests with --filter or --fileNameFilter are excessively noisy Created: 14/May/20  Updated: 29/Oct/23  Resolved: 18/May/20

Status: Closed
Project: Core Server
Component/s: Testing Infrastructure
Affects Version/s: None
Fix Version/s: 4.7.0

Type: Improvement Priority: Major - P3
Reporter: Kevin Pulo Assignee: Kevin Pulo
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File unittest-output.txt    
Backwards Compatibility: Fully Compatible
Sprint: Sharding 2020-06-01
Participants:

 Description   

When using the ninja generator's "+" to run unittests from a single file (which uses --fileNameFilter under the hood), there are the "Running" and "Done running tests" messages from all suites in the actual unittest binary (which tends to be a lot, to minimise static linking overheads), even though the vast majority of them don't run any tests. There are also all the summary results from these suites which had no tests run, which I'm not interested in. These lines cause a lot of scrolling in the terminal, and obscure the real tests that I'm interested in.

The behaviour with --filter is similar, however using --suite only runs and shows output related to that suite (which is how I would like --filter and --fileNameFilter to behave).

For example, this is the current behaviour (attached because it's too large to fit in a Jira description), but instead of all that output it should just be:

$ ninja +replica_set_aware_service_test
[ 0 / 1 / 1 ] [  0%] [0.000s]  Building +replica_set_aware_service_test
{"t":{"$date":"2020-05-13T05:48:29.899Z"},"s":"I",  "c":"CONTROL",  "id":23285,   "ctx":"main","msg":"Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'"}
{"t":{"$date":"2020-05-13T05:48:29.912Z"},"s":"I",  "c":"TEST",     "id":23063,   "ctx":"main","msg":"Running","attr":{"suite":"ReplicaSetAwareServiceTest"}}
{"t":{"$date":"2020-05-13T05:48:29.912Z"},"s":"I",  "c":"TEST",     "id":23059,   "ctx":"main","msg":"Running","attr":{"test":"ReplicaSetAwareService","rep":1,"reps":1}}
{"t":{"$date":"2020-05-13T05:48:29.925Z"},"s":"I",  "c":"TEST",     "id":23060,   "ctx":"main","msg":"Done running tests"}
{"t":{"$date":"2020-05-13T05:48:29.936Z"},"s":"I",  "c":"TEST",     "id":4680101, "ctx":"main","msg":"Result","attr":{"suite":{"name":"ReplicaSetAwareServiceTest","tests":1,"fails":0,"asserts":0,"time":{"durationMillis":13},"failures":[]}}}
{"t":{"$date":"2020-05-13T05:48:29.938Z"},"s":"I",  "c":"TEST",     "id":23065,   "ctx":"main","msg":"Totals","attr":{"totals":{"name":"TOTALS","tests":1,"fails":0,"asserts":0,"time":{"durationMillis":13},"failures":[]}}}
{"t":{"$date":"2020-05-13T05:48:29.938Z"},"s":"I",  "c":"TEST",     "id":23069,   "ctx":"main","msg":"SUCCESS - All tests in all suites passed"}



 Comments   
Comment by Githook User [ 18/May/20 ]

Author:

{'name': 'Kevin Pulo', 'email': 'kevin.pulo@mongodb.com', 'username': 'devkev'}

Message: SERVER-48212 only output unittest suite start/end/results if any tests were actually run
Branch: master
https://github.com/mongodb/mongo/commit/db424dad9915da5fa307799c4c6aa464e820e38a

Generated at Thu Feb 08 05:16:28 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.