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

RuleInclusionTest: record code coverage + one more test case #690

Merged
merged 2 commits into from
Nov 15, 2024

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Nov 15, 2024

Description

RuleInclusionTest: record code coverage

Code executed during "before class" methods is not recorded for code coverage, while code executed in "before" methods is, but the "before" method is executed before every test in the class, not just once before the tests in the class run.

So, to record code coverage, while still maintaining the performance benefits of only creating the Config and Ruleset objects once, the code still sets a static property and will only run if that static property has not been filled yet.

RuleInclusionTest: add test with directory include

Suggested changelog entry

N/A

Related issues/external references

Related to #146

Code executed during "before class" methods is not recorded for code coverage, while code executed in "before" methods is, but the "before" method is executed before _every_ test in the class, not just once before the tests in the class run.

So, to record code coverage, while still maintaining the performance benefits of only creating the Config and Ruleset objects once, the code still sets a static property and will only run if that static property has not been filled yet.
@jrfnl jrfnl added this to the 3.11.1 milestone Nov 15, 2024
@jrfnl jrfnl merged commit 8ed93db into master Nov 15, 2024
72 checks passed
@jrfnl jrfnl deleted the feature/ruleinclusiontests-improvements branch November 15, 2024 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant