Skip to content

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