Repository navigation
test-cnm: Support sending / polling multiple queues in one test run #65
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
5e14abe
Print full test id in list command
reweeden fcbd4fc
Move ChecksumReaderProxy and ChecksumWriter to uploader.py
reweeden 0f0ddc6
Refactor `tester` internals to support multiple cnm queues
reweeden 84cbb4c
Allow getting test specific config from the metadata.json file
reweeden 2fa0521
Add provider and trace as attributes on ExecutableTest
reweeden 7641891
Only save metadata file if contents changed
reweeden 6739134
Replace utcnow()
reweeden e092b0d
Allow overriding dynamic config with cli args
reweeden a58f34c
Bump version number
reweeden File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| import argparse | ||
| import logging | ||
|
|
||
| from test_cnm.config import ConfigBasic | ||
| from test_cnm.metadata import Metadata | ||
| from test_cnm.tester.collector import BucketTestCollector | ||
|
|
||
| log = logging.getLogger(__name__) | ||
|
|
||
|
|
||
| def add_parser( | ||
| subparsers: argparse._SubParsersAction, | ||
| ) -> argparse.ArgumentParser: | ||
| parser_update_metadata = subparsers.add_parser( | ||
| "configure", | ||
| help="Update metadata file to set test level configuration", | ||
| ) | ||
| parser_update_metadata.add_argument( | ||
| "filter", | ||
| help="Glob pattern to filter tests by. Can include '*', '?' and '[]' expressions", | ||
| nargs="*", | ||
| default=[], | ||
| ) | ||
| properties_group = parser_update_metadata.add_argument_group("properties") | ||
| properties_group.add_argument( | ||
| "--cnm-ingest-queue", | ||
| help="Override the cnm_ingest_queue that the CNM-S will be sent to for the tests", | ||
| ) | ||
| properties_group.add_argument( | ||
| "--cnm-response-queue", | ||
| help="Override the cnm_response_queue that the CNM client will poll for the CNM-R response for the tests", | ||
| ) | ||
| parser_update_metadata.set_defaults( | ||
| func=cmd_update_metadata, | ||
| config_cls=ConfigBasic, | ||
| ) | ||
|
|
||
| return parser_update_metadata | ||
|
|
||
|
|
||
| def cmd_update_metadata( | ||
| parser: argparse.ArgumentParser, | ||
| args: argparse.Namespace, | ||
| config: ConfigBasic, | ||
| ): | ||
| filters = args.filter | ||
|
|
||
| session = config.session() | ||
|
|
||
| collector = BucketTestCollector( | ||
| session, | ||
| config.test_bucket, | ||
| ) | ||
| tests = collector.collect_tests(filters) | ||
|
|
||
| with Metadata(session, config.test_bucket) as metadata: | ||
| for test in tests.values(): | ||
| test_id = test.get_id() | ||
| cfg = metadata.test_config[test_id] | ||
|
|
||
| for attr in ("cnm_ingest_queue", "cnm_response_queue"): | ||
| value = getattr(args, attr) | ||
| if value: | ||
| log.debug("%s setting %s to %s", test_id, attr, value) | ||
| cfg[attr] = value | ||
|
|
||
| if cfg: | ||
| log.info("%s:", test_id) | ||
| for attr, value in cfg.items(): | ||
| log.info(" %s: %s", attr, value) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.