-
Notifications
You must be signed in to change notification settings - Fork 10
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
remove duplicate code in decorators #3647
base: main
Are you sure you want to change the base?
Conversation
53e7da1
to
48b70ec
Compare
48b70ec
to
26aa2b2
Compare
5bec54b
to
7f88031
Compare
rebasing to fix issue on python |
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.
CI is failing
The java parametric test failure was due to a flaky test. After one rerun that scenario is now green. The php failures seem unrelated to this PR. The same tests are also failing on the main branch: https://github.com/DataDog/system-tests/actions/runs/12257217102/job/34195001337. We are mainly seeing failures on php-dev so it likely caused by a recent regression. Maybe this change: DataDog/dd-trace-php#2735? cc: @cataphract |
yep, for PHP : #3658 reviewing the PR |
utils/_decorators.py
Outdated
def missing_feature(condition=None, library=None, weblog_variant=None, reason=None, force_skip: bool = False): | ||
"""decorator, allow to mark a test function/class as missing""" | ||
expected_to_fail = _expected_to_fail(library=library, weblog_variant=weblog_variant, condition=condition) | ||
return partial(decorator, expected_to_fail, force_skip, condition, "missing_feature", reason) |
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.
Using named argument will be easier to maintain
return partial(decorator, expected_to_fail, force_skip, condition, "missing_feature", reason) | |
return partial(decorator, expected_to_fail=expected_to_fail, force_skip=force_skip, condition=condition, decorator_type="missing_feature", reason=reason) |
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 can only use positional arguments in partial(..).
utils/_decorators.py
Outdated
force_skip = False | ||
return partial(decorator, expected_to_fail, force_skip, condition, "incomplete_test_app", reason) |
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.
Same comment as above :
force_skip = False | |
return partial(decorator, expected_to_fail, force_skip, condition, "incomplete_test_app", reason) | |
return partial(decorator, expected_to_fail=expected_to_fail, force_skip=False, condition=condition, decorator_type="incomplete_test_app", reason=reason) |
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.
We can only use positional arguments in partial(....)
Motivation
Changes
missing_feature
,incomplete_test_app
,irrelevant
, andflaky
decorators_get_skipped_item
._get_expected_failure_item
can be used in all decorators._should_skip
Workflow
codeowners
file quickly.🚀 Once your PR is reviewed, you can merge it!
🛟 #apm-shared-testing 🛟
Reviewer checklist
[<language>]
, double-check that only<language>
is impacted by the changebuild-XXX-image
label is present