DAOS-19439 test: refactor NLT to make it more readable and its results easier to understand - #18808
DAOS-19439 test: refactor NLT to make it more readable and its results easier to understand#18808mchaarawi wants to merge 5 commits into
Conversation
|
Ticket title is 'refactor NLT' |
bf5cf16 to
9018ef1
Compare
9018ef1 to
f97406f
Compare
NLT was a single ~7,000-line script whose results were scattered across
JUnit xml, three warnings json files, valgrind xml and a raw log tarball,
so finding the one issue behind a CI failure meant cross-referencing
several artifacts. This reworks NLT for both readability and result
triage without changing what it tests or how CI invokes it.
Reporting: NLT now writes a single human-readable summary (nlt-summary.md,
also printed to the console and archived by CI). It lists the verdict and
counts, each failed test with the DFuse/DAOS log lines that caused it
quoted inline plus a logfile:line reference, remaining log-analysis
findings grouped per test (with a server-wide group for shared-server
logs), valgrind notes and the slowest tests. Findings are correlated to
the owning test via a per-thread active-test context, since POSIX tests
run in parallel. The existing junit/json artifacts are unchanged for the
Jenkins plugins. Controlled by --summary (default on, "" disables).
Suites: add --suite {ci,manual,all}. Tests too slow or disk-hungry for CI
(stable_cont_inode, test_dfs_check, test_alloc_pil4dfs_ls) are no longer
dead/commented code in the CI path; they run only under --suite manual|all.
xtest_stable_cont_inode is renamed manual_stable_cont_inode and discovered
via PosixTests.generate_manual_test_list(); --test list shows a manual
section.
Structure: split node_local_test.py into a dependency-ordered nlt/ package
(base, config, reporting, logging_utils, client, server, dfuse, helpers,
posix_tests, fault_injection, special_tests, runner, cli). node_local_test.py
is now a thin shim so ci/unit scripts and developer invocation are
unchanged. Add utils/nlt/README.md, include the package in .dockerignore,
and archive nlt-summary.md from the NLT and Fault-injection stages.
Skip-unit-test: true
Skip-func-test-vm: true
skip-test-hardware: true
skip-unit-test-memcheck: true
skip-unit-test-bdev: true
Signed-off-by: Mohamad Chaarawi <mohamad.chaarawi@hpe.com>
f97406f to
1c99c98
Compare
daltonbohning
left a comment
There was a problem hiding this comment.
How do you feel about moving utils/nlt to src/tests/nlt?
yea i guess that makes sense |
Signed-off-by: Mohamad Chaarawi <mohamad.chaarawi@hpe.com>
|
@mchaarawi: Interesting... Long overdue! Do you want me to look at reworking #18779 as a PR for this? I think with your fix for the deadlock issue it will be less important to get the watchdog landed, but I think it would be super useful to have going forward. |
yes that makes sense and would be appreciated if i don't have to rebase this PR. |
Skip-unit-test: true skip-unit-test-memcheck: true skip-unit-test-bdev: true skip-functional: true Signed-off-by: Mohamad Chaarawi <mohamad.chaarawi@hpe.com>
dc991de to
916e013
Compare
daltonbohning
left a comment
There was a problem hiding this comment.
Still working through this. Nothing blocking so far. Just leaving comments for future improvements.
| # The NLT implementation lives in src/tests/nlt; ship it preserving the relative path so the | ||
| # utils/node_local_test.py shim can import it. | ||
| rsync -R -rlpt -z -e "ssh $SSH_KEY_ARGS" src/tests/nlt jenkins@"$NODE":build/ |
There was a problem hiding this comment.
Future: we could define NLT more as a package so this is not necessary
| """Setup and import the log tracing code""" | ||
| # Try and pick this up from the src tree if possible; src/tests/ is the parent of this package. | ||
| file_self = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | ||
| logparse_dir = join(file_self, 'ftest/cart/util') |
There was a problem hiding this comment.
Future: NLT using a file under ftest implies that file should not live under ftest
| from .base import get_active_test | ||
|
|
||
|
|
||
| class WarningsFactory(): |
There was a problem hiding this comment.
Future: generally more exception handling in helper functions.
| text = '\n'.join(lines) + '\n' | ||
| with open(filename, 'w') as sfd: | ||
| sfd.write(text) |
There was a problem hiding this comment.
Future: check if lines is large enough to warrant using sfd.writelines instead
Skip-unit-test: true skip-unit-test-memcheck: true skip-unit-test-bdev: true skip-functional: true Signed-off-by: Mohamad Chaarawi <mohamad.chaarawi@hpe.com>
Signed-off-by: Mohamad Chaarawi <mohamad.chaarawi@hpe.com>
Deferring the following items to a follow-on PR:
|
NLT was a single ~7,000-line script whose results were scattered across JUnit xml, three warnings json files, valgrind xml and a raw log tarball, so finding the one issue behind a CI failure meant cross-referencing several artifacts. This reworks NLT for both readability and result triage without changing what it tests or how CI invokes it.
Reporting: NLT now writes a single human-readable summary (nlt-summary.md, also printed to the console and archived by CI). It lists the verdict and counts, each failed test with the DFuse/DAOS log lines that caused it quoted inline plus a logfile:line reference, remaining log-analysis findings grouped per test (with a server-wide group for shared-server logs), valgrind notes and the slowest tests. Findings are correlated to the owning test via a per-thread active-test context, since POSIX tests run in parallel. The existing junit/json artifacts are unchanged for the Jenkins plugins. Controlled by --summary (default on, "" disables).
Suites: add --suite {ci,manual,all}. Tests too slow or disk-hungry for CI (stable_cont_inode, test_dfs_check, test_alloc_pil4dfs_ls) are no longer dead/commented code in the CI path; they run only under --suite manual|all. xtest_stable_cont_inode is renamed manual_stable_cont_inode and discovered via PosixTests.generate_manual_test_list(); --test list shows a manual section.
Structure: split node_local_test.py into a dependency-ordered nlt/ package (base, config, reporting, logging_utils, client, server, dfuse, helpers, posix_tests, fault_injection, special_tests, runner, cli). node_local_test.py is now a thin shim so ci/unit scripts and developer invocation are unchanged. Add utils/nlt/README.md, include the package in .dockerignore, and archive nlt-summary.md from the NLT and Fault-injection stages.
skip-test-hardware: true
Steps for the author:
After all prior steps are complete: