Skip to content
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

DM-39672: make it possible to force failures in mock pipelines on the command-line #247

Merged
merged 2 commits into from Jun 21, 2023

Conversation

TallJimbo
Copy link
Member

@TallJimbo TallJimbo commented Jun 20, 2023

Checklist

  • ran Jenkins
  • added a release note for user-visible changes to doc/changes

@TallJimbo TallJimbo force-pushed the tickets/DM-39672 branch 2 times, most recently from ca13aff to 1ed856e Compare June 20, 2023 16:08
Copy link
Collaborator

@andy-slac andy-slac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

when mocking execution. This is a colon-separated 3-tuple,
where the first entry the task label, the second the
fully-qualified exception type (empty for ValueError, and the
third a string (usually quoted) of the form passed to --where,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"usually quoted" may be a bit confusing. I guess quoting is needed for shell only, not for the Python code that parses it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, just for the shell. Reworded to that effect.

return result
for entry in value:
try:
task_label, error_type_name, where = entry.split(":")
Copy link
Collaborator

@andy-slac andy-slac Jun 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more comment - what if where part also contains a colon (e.g. for slicing)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. I've updated this to

task_label, error_type_name, *where_terms = entry.split(":")
where = ":".join(where_terms)

to guard against that.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

entry.split(":", 2) is probably faster 🙂

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat, I didn't know about that argument.

@codecov
Copy link

codecov bot commented Jun 20, 2023

Codecov Report

Patch coverage: 41.17% and project coverage change: -0.16 ⚠️

Comparison is base (71390b7) 85.69% compared to head (8a44210) 85.53%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #247      +/-   ##
==========================================
- Coverage   85.69%   85.53%   -0.16%     
==========================================
  Files          47       47              
  Lines        4215     4231      +16     
  Branches      724      726       +2     
==========================================
+ Hits         3612     3619       +7     
- Misses        451      458       +7     
- Partials      152      154       +2     
Impacted Files Coverage Δ
python/lsst/ctrl/mpexec/cli/opt/optionGroups.py 100.00% <ø> (ø)
python/lsst/ctrl/mpexec/cli/script/qgraph.py 42.85% <ø> (ø)
python/lsst/ctrl/mpexec/cli/script/run.py 45.45% <ø> (ø)
python/lsst/ctrl/mpexec/cmdLineFwk.py 62.32% <0.00%> (ø)
python/lsst/ctrl/mpexec/cli/opt/options.py 86.95% <43.75%> (-13.05%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@TallJimbo TallJimbo merged commit 8f6ccc9 into main Jun 21, 2023
9 of 11 checks passed
@TallJimbo TallJimbo deleted the tickets/DM-39672 branch June 21, 2023 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants