-
Notifications
You must be signed in to change notification settings - Fork 8.3k
twister: ztest: harness: Fix missed TestCase statuses #80088
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
twister: ztest: harness: Fix missed TestCase statuses #80088
Conversation
eb6daa8 to
e97344b
Compare
|
@arikgreen, do you still have any other objections for your -1 ? |
sorry, should be approved |
e97344b to
35ad4d6
Compare
|
rebase to resolve merge conflicts |
ok, this is a rather very intrusive and disruptive change of a very well known problem that we pushed aside for a while now. The main issue here is that we define suites on different levels, the outcome of transitioning from old ztest to macro based ztest. We have the testsuite defined at the yaml level and then the suites in ztests, so when you have multiple suites in ztest resuing the same testcases, it faills apart, but that happens in a pair for tests we have right now, so it was easy to ignore. Some changes in twister were introduced to address this, but never got to the final fix. I am fine with the fix, the question if it is the right time for it or if we should wait and solicit more discussion and reviews to make sure this does not break someone's downstream. |
well, although 'very intrusive and disruptive' sounds ominously, it is another old problem, like adjusting to hwmv2 board naming, which should be fixed. Why not to do it "sooner", at 4.0 next major version release ? |
|
Dear reviewers, do you find any objections on this fix for a very well known old problem in Twister, preventing its solution in v.4.0 ? |
|
@golowanow please post the list of tests that are showing this behaviour. |
35ad4d6 to
a343ffe
Compare
a343ffe to
f39a91b
Compare
The known in-tree tests affected by the problem are now listed in #80706 (will be updated when we find more). Other changes so far:
|
|
dear reviewers, ^ up to your attention. |
|
@golowanow I meet some suspect issues with this pr. if I run and I get a very long time in compare to the main branch code, and the log shows some warning |
right, these warnings (from 3 tests) are good examples of how this PR allows to spot two kinds of problems not visible before: I left these log records as warnings for now to make such situations visible. The proposed PR addresses the basic level of the Twister/Ztest problems, and the next step will be to improve Twister reporting to show the Suite/Case repetitions correctly. |
Fix a problem of Ztest suite names not taken into account by Twister to identify a TestCase, so in some situations a Ztest test's status was not assigned to the proper TestCase and it remains 'None' whereas the actual status value lost, eventually the resulting total execution counters not correct. The issue was observed in these situations: * Ztest application with multiple test suites having same test names. * Ztest suite is 'skipped' entirely on execution with all its tests. The proposed solution extends Twister test case name for Ztest to include Ztest suite name, so the resulting identifier looks like: `<test_scenario_name>.<ztest_suite_name>.<ztest_name>` The above naming scheme now requires ztest_suite_name part to be provided for `--sub-test` command line option. Testcase identifiers in twister.json and testplan.json will also include ztest_suite_name component. The Twister Ztest(Test) Harness is improved to track all state changes known from the test application's log for Ztest suites and test cases, so now it parses log output from a Ztest application more scurpulously. Regular expressions to match log records are extended and optimized to compile them only once and, in some cases, fixed (suite summary). Signed-off-by: Dmitrii Golovanov <[email protected]>
Update Test Application diagram as well as Test Scenario and Test Case naming conventions to make them more clear and aligned to Ztest suite name included as a part of Test Case name. Signed-off-by: Dmitrii Golovanov <[email protected]>
Fix Ztest test function name extraction from ELF symbols for C++ compiled binaries where symbol names need additional 'demangling' to match with corresponding test names. The `c++filt` utility (part of binutils) is called for demangling when it is needed. Twister test suite extension and adjustment. Signed-off-by: Dmitrii Golovanov <[email protected]>
3e3126d to
0a563af
Compare
|
rebased to resolve merge conflicts after #81129 |
PerMac
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly LGTM but have a question I'd like to get answered before accepting/requesting change ("repeated" redundant)?
|
@PerMac @golowanow before we go forward with this i wanted to discuss enabling |
yeah, it might be a next This fix has its scope intentionally reduced to focus on the problem it is targeting. One aspect of |
|
Fixes: #80706
Fix a problem of Ztest suite names not taken into account by Twister to identify a TestCase, so in some situations a Ztest test's status was not assigned to the proper TestCase and it remains 'None' whereas the actual status value lost, eventually the resulting total execution counters not correct.
The proposed solution extends Twister test case name for Ztest to include Ztest suite name, so the resulting identifier looks like:
<test_scenario_name>.<ztest_suite_name>.<ztest_name>The above naming scheme now requires ztest_suite_name part to be provided for
--sub-testcommand line option.Testcase identifiers in twister.json and testplan.json will also include ztest_suite_name component.
The Twister Ztest(Test) Harness is improved to track all state changes known from the test application's log for Ztest suites and test cases, so now it parses log output from a Ztest application more scurpulously. Regular expressions to match log records are extended and optimized to compile them only once and, in some cases, fixed (suite summary).
Twister documentation update.
Fix for C++ Ztest function name 'demangling' - when Ztest application is written in C++ with namespace(s) test function names in ELF are additionally decorated ('mangled').
The issue was observed in these situations (for known in-tree tests affected see #80706):
for example,
/scripts/twister -p native_sim -T ./tests/ztestold:
new:
for example,
./scripts/twister -p native_sim -T ./tests/drivers/can/api/ -s drivers.can.apiwhere
get_transceiver- was skipped, others - the same situation as example 1old:
new: