Add more JSON checks in Gecko Profiler gtests
Categories
(Core :: Gecko Profiler, task, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox85 | --- | fixed |
People
(Reporter: mozbugz, Assigned: mozbugz)
References
Details
Attachments
(4 files)
Most profiler gtests only check that some strings are present.
We should be more thorough, and checks that the profile JSON is correct, and contains all expected properties.
And this should make it easier to add tests when adding/modifying/fixing features.
Assignee | ||
Comment 1•4 years ago
|
||
JSONOutputCheck used to only check the profile output for the presence of some strings.
Now it parses the output as JSON, and navigates the JSON data to check expected properties, including their types, and values as needed.
Assignee | ||
Comment 2•4 years ago
|
||
JSONOutputCheck now checks a few more properties, including thread contents, and sub-process profiles.
Depends on D98890
Assignee | ||
Comment 3•4 years ago
|
||
Depends on D98891
Assignee | ||
Comment 4•4 years ago
|
||
Consolidate all JSON checks to go through JSONOutputCheck.
Depends on D98892
Comment 6•4 years ago
|
||
Backed out for hazard failures on GeckoProfiler.cpp
backout: https://hg.mozilla.org/integration/autoland/rev/01ac34a546cac054a520a3d8166439e7234c5c33
failure log: https://treeherder.mozilla.org/logviewer?job_id=324018295&repo=autoland&lineNumber=16247
[task 2020-12-09T08:17:17.079Z] 33:41.31 TEST-PASS | check_textrel | libmozavcodec.so
[task 2020-12-09T08:18:15.425Z] 34:39.65 In file included from Unified_cpp_tests_gtest0.cpp:2:
[task 2020-12-09T08:18:15.425Z] 34:39.65 /builds/worker/checkouts/gecko/tools/profiler/tests/gtest/GeckoProfiler.cpp: In function 'void JSONRootCheck(const Json::Value&, bool)':
[task 2020-12-09T08:18:15.425Z] 34:39.65 /builds/worker/checkouts/gecko/tools/profiler/tests/gtest/GeckoProfiler.cpp:110:21: error: unnecessary parentheses in declaration of 'meta' [-Werror=parentheses]
[task 2020-12-09T08:18:15.425Z] 34:39.65 110 | const Json::Value&(VARIABLE) = (GETTER)
[task 2020-12-09T08:18:15.425Z] 34:39.65 | ^
[task 2020-12-09T08:18:15.425Z] 34:39.65 /builds/worker/checkouts/gecko/tools/profiler/tests/gtest/GeckoProfiler.cpp:172:3: note: in expansion of macro 'GET_JSON'
[task 2020-12-09T08:18:15.425Z] 34:39.65 172 | GET_JSON(meta, aRoot["meta"], Object);
[task 2020-12-09T08:18:15.425Z] 34:39.65 | ^~~~~~~~
[task 2020-12-09T08:18:15.425Z] 34:39.65 /builds/worker/checkouts/gecko/tools/profiler/tests/gtest/GeckoProfiler.cpp:110:21: error: unnecessary parentheses in declaration of 'threads' [-Werror=parentheses]
[task 2020-12-09T08:18:15.425Z] 34:39.65 110 | const Json::Value&(VARIABLE) = (GETTER)
[task 2020-12-09T08:18:15.425Z] 34:39.65 | ^
Assignee | ||
Comment 7•4 years ago
|
||
Thank you Natalia.
clang-tidy made me do it! (Add parens in the macro.)
I've filed bug 1681464 about the discrepancy between clang-tidy and hazard builds.
Anyway, I think the hazard error is more appropriate in this case, since we're declaring a variable, it wouldn't make sense to provide something that would require parentheses.
Comment 9•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/d6f7e04dd094
https://hg.mozilla.org/mozilla-central/rev/a38ce531d418
https://hg.mozilla.org/mozilla-central/rev/cb22dee08955
https://hg.mozilla.org/mozilla-central/rev/0c9928eb7790
Description
•