-
Notifications
You must be signed in to change notification settings - Fork 50
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
Add "list-testplan" subcommand (New) #1047
Conversation
The new subcommand works similarly to "list-bootstrapped" since it also bootstraps a given test plan. However, it filters out the instantiated jobs and replaces them with their original template. In the end, a list of jobs and templates used in this test plan are returned as JSON-formatted data. This is to be used by external tools, for instance to create a document listing information (summary, description...) about executed jobs and templates. Fix CHECKBOX-1263
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1047 +/- ##
==========================================
+ Coverage 40.76% 40.80% +0.04%
==========================================
Files 336 336
Lines 37462 37490 +28
Branches 6371 6376 +5
==========================================
+ Hits 15271 15298 +27
Misses 21550 21550
- Partials 641 642 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
See if you want to change that small thing, beside that, merge it!
raise SystemExit("Test plan not found") | ||
self.sa.select_test_plan(ctx.args.TEST_PLAN) | ||
self.sa.bootstrap() | ||
job_and_template_list = [] |
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.
Minor small fix, use a set here, way faster to check if something is in there or not
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.
If I use a set()
instead of a list []
, I get the following error:
Traceback (most recent call last):
File "/home/pieq/.venvs/checkbox/bin/checkbox-cli", line 8, in <module>
sys.exit(main())
^^^^^^
File "/home/pieq/dev/work/checkbox/checkbox-ng/checkbox_ng/launcher/checkbox_cli.py", line 165, in main
return subcmd.invoked(ctx)
^^^^^^^^^^^^^^^^^^^
File "/home/pieq/dev/work/checkbox/checkbox-ng/checkbox_ng/launcher/subcommands.py", line 1375, in invoked
job_and_template_set.add(attrs)
TypeError: unhashable type: 'dict'
Works like a charm, thanks! Already using it for a refreshed doc version |
This implementation depends on bootstrapping, which is not good, because if ran on a device without the proper resources, some jobs may be ignored and would not show up in the generated output. I need to revisit how to get all the information we need. |
This PR is replaced by #1065 |
Description
The new subcommand works similarly to "list-bootstrapped" since it also
bootstraps a given test plan.
However, it filters out the instantiated jobs and replaces them with
their original template.
In the end, a list of jobs and templates used in this test plan are
returned as JSON-formatted data.
This is to be used by external tools, for instance to create a document
listing information (summary, description...) about executed jobs and
templates.
Resolved issues
CHECKBOX-1263
Documentation
TBD
Tests
Given the following units:
The command
$ checkbox-cli list-testplan com.canonical.certification::pieq-job-test-plan | jq
will return: