-
Notifications
You must be signed in to change notification settings - Fork 601
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
tests: allow to re-execute aborted tests #11811
tests: allow to re-execute aborted tests #11811
Conversation
…w-log-parser-tool
…b3b70..1c9dff58ff 1c9dff58ff Merge pull request canonical#23 from snapcore/improve-log-parser cc7ee488d1 Fix shellcheck 324b99e719 revert change in log-analyzer test f746f40ebe Fix shellcheck 2d7dbbe1bd Fix spelling 728dd64c2c Last set of changes for log analizer tools bf389dcd01 New fixes for log parses 3b56339b88 Merge pull request canonical#22 from snapcore/tests-fix-spread-shellcheck 488408d792 fix shellcheck test b9340d265c Fix spread-shellcheck and update the test with new scenario git-subtree-dir: tests/lib/external/snapd-testing-tools git-subtree-split: 1c9dff58ff43d120d8ca5cc19b305a5c99ea2698
…w-log-parser-tool
…f58ff..84dc8092b1 84dc8092b1 Merge pull request canonical#24 from snapcore/improve-log-parser 515770b3bf Add support for fedora-35 875c29b5ce Updated results with latest log-parser changes d27f2bcdb7 Fix log-parser b2cce1fcce fix wording 14d15e4fe4 Fixes for log-parser and changes for log analyzer 438d92d241 Log analyzer updated to support reexecute in all the scenarios git-subtree-dir: tests/lib/external/snapd-testing-tools git-subtree-split: 84dc8092b13c63c02ade50198bfddf6f520e8ab4
...rnal/snapd-testing-tools/tests/log-analyzer/data/aborted-and-failed-execute-and-restore.json
Outdated
Show resolved
Hide resolved
tests/lib/external/snapd-testing-tools/tests/log-analyzer/spread.yaml
Outdated
Show resolved
Hide resolved
tests/lib/external/snapd-testing-tools/tests/log-analyzer/task.yaml
Outdated
Show resolved
Hide resolved
tests/lib/external/snapd-testing-tools/tests/log-analyzer/task.yaml
Outdated
Show resolved
Hide resolved
tests/lib/external/snapd-testing-tools/tests/log-analyzer/tests/test-2/task.yaml
Outdated
Show resolved
Hide resolved
reexec_tasks="$(_merge_tasks_lists "$aborted_tasks" "$exec_and_failed_tasks")" | ||
|
||
# In case all the tests are failed or aborted, then the execution expression is used to reexecute | ||
if [ "$(echo "$reexec_tasks" | wc -w)" = "$(echo "$all_tasks" | wc -w)" ]; then |
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.
Ah, now I think I understand: wc -w
is used to count the list of tasks? If so, I'd recommend to create a count_tasks()
function and use it whenever you need to get the task count, so that if we see that wc -w
fails in some cases, we can fix it in a single place.
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.
sure, thanks
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.
Thanks! Actually I was thinking only of a function that returns the number of tasks, and then you'd have to do the comparison manually, but your approach of combining the two actions (getting the number of tasks and comparing it with the expected value) makes a lot of sense.
If I may raise a nitpick, I'd then rename the function from count_tasks
to something like expect_task_count
, compare_task_count
, ensure_task_count
...
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.
@mardy yes, compare_tasks_count I think is the best name, thanks
Thanks, that's a big set of changes :-) A few comments, mostly about readability, because I think that it would be hard for me to work on this code, if I don't understand why certain things are done in this way. |
…w-log-parser-tool
…092b1..2540135b90 2540135b90 Merge pull request canonical#25 from snapcore/add-indent-to-log-parser 2536b0f070 Minor improvements in log-parser and log-analyzer based con review comments git-subtree-dir: tests/lib/external/snapd-testing-tools git-subtree-split: 2540135b9022dc2782f44827a091818f271f4a91
@mardy Thanks for reviewing, I already addressed the comments. |
…w-log-parser-tool
…35b90..b4654950d4 b4654950d4 Merge pull request canonical#26 from snapcore/support-csv-for-expressions 3250bbd885 Support expressions with comma separation git-subtree-dir: tests/lib/external/snapd-testing-tools git-subtree-split: b4654950d49e465d4c978e6ce1cd9eac898e063a
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.
Thanks Sergio, I think you skipped a couple of comments that were hidden due to the the big amount of comments, but thanks for the updates :-)
…950d4..7fe27d4aea 7fe27d4aea Improve log analyzer utility 207536268e Merge pull request canonical#19 from snapcore/new-spread-manager 2f2ff2e282 Update spread manager to support csv 33a44ca3be Merge branch 'main' into new-spread-manager 6b2b56afc3 Fix another shellcheck 56163e170b Fix shellcheck d96ab8094f Merge branch 'main' into new-spread-manager 60fb99f02f new dir task5 259a7e188c Fix spread test e674234454 New spread-manager tool git-subtree-dir: tests/lib/external/snapd-testing-tools git-subtree-split: 7fe27d4aea8302aeb29f44517808f690633eb547
…w-log-parser-tool
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.
I see that you removed the compare_task_count() and replaces with those lists_*
function. It makes things simpler indeed. LGTM, thanks!
This change introduces the new log parser and log analyzer tools.
The log parser has several fixes and new features which allows to detect aborted tasks during prepare phase.
Also the new log analyzer has new features like detection when the re-execute can be done and the list of tasks to re-execute including scenarios with aborted tests.