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

BUG: fix common arg handling #45

Merged
merged 4 commits into from
Jul 11, 2024
Merged

BUG: fix common arg handling #45

merged 4 commits into from
Jul 11, 2024

Conversation

cpelley
Copy link
Collaborator

@cpelley cpelley commented Jul 11, 2024

#43 didn't quite fix the issue it was intended to address.
I must have left changes locally (i.e. not pushed up all changes to github). CI pytest failures were being hidden by our use of pipe.

  • Fixed argument handling behaviour (tests pass demonstrating this locally and via CI).
  • Fixed pytest failures being hidden (see test ${PIPESTATUS[0]} -eq 0 in the CI workflow).
  • Fixed test sensitivity to argparse version in dagrunner/tests/utils/test_function_to_parse.py.
  • Disabled logging integration tests running in CI (to be investigated and re-enabled in TEST: logging failures in CI #39).
    • This will cause a 'The test coverage has decreased' comment via the CI which can be ignored.

Issues

@cpelley cpelley added the bug Something isn't working label Jul 11, 2024
@cpelley cpelley self-assigned this Jul 11, 2024
@cpelley cpelley marked this pull request as draft July 11, 2024 08:30
- name: Run pytest + coverage report gen
run: pytest --cov=dagrunner --cov-report=term --cov-report=html | tee coverage_output.txt
run: pytest --cov=dagrunner --cov-report=term --cov-report=html --ignore=dagrunner/tests/utils/logging/test_integration.py | tee coverage_output.txt; test ${PIPESTATUS[0]} -eq 0
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Exclude logging test in CI until #44

Copy link
Contributor

The test coverage has decreased from 84% to 78% (commit SHA: 73929cd).
Please review test coverage. Report uploaded as artifact.

Comment on lines +135 to +137
callable_kwargs = callable_kwargs | _get_common_args_matching_signature(
callable_obj, common_kwargs, callable_kwargs.keys()
) # based on overriding arguments
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Changes that weren't included in #43, hidden pytest failures

Comment on lines +27 to +30
if "optional arguments:" in help_str:
# older versions of argparse use "optional arguments: instead of options:"
tar = tar.replace("options:", "optional arguments:")
assert help_str == tar
Copy link
Collaborator Author

@cpelley cpelley Jul 11, 2024

Choose a reason for hiding this comment

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

Supporting old and new argparse versions (not sure when this exactly changed right now). Was a cause of failures on CI and local succeeds.

@@ -12,6 +12,24 @@
CALLING_MOD = os.path.basename(sys.argv[0])


def assert_help_str(help_str, tar):
# Remove line wraps for easier comparison
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Line wrap changes between versions of argparse, so we remove them. Again a cause of failures on CI with success locally.

@cpelley
Copy link
Collaborator Author

cpelley commented Jul 11, 2024

The test coverage has decreased from 84% to 78%...

Safe to ignore this. Cause: ignoring logging integration tests (which don't work in CI right now). Will be re-enabled in #39.

@cpelley cpelley marked this pull request as ready for review July 11, 2024 09:44
@cpelley cpelley changed the title BUG: fix common arg passing BUG: fix common arg handling Jul 11, 2024
Copy link

@SamGriffithsMO SamGriffithsMO left a comment

Choose a reason for hiding this comment

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

LGTM

@cpelley cpelley merged commit d795acc into main Jul 11, 2024
1 check passed
@cpelley cpelley deleted the FIX_ARGUMENT_PASS branch July 11, 2024 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants