-
Notifications
You must be signed in to change notification settings - Fork 84
feat(targets): Add a config fixture for target tests #3434
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Edgar Ramírez-Mondragón <edgarrm358@gmail.com>
Reviewer's GuideAdds a fixture-based configuration mechanism for target tests via a new plugin_config fixture in the factory-generated test classes, updates existing target package tests to use this fixture for dynamic configs, and adds coverage to ensure the new fixture and runner wiring behave correctly. Sequence diagram for plugin_config-based target test runner setupsequenceDiagram
actor Pytest
participant GeneratedTargetTestClass
participant plugin_config_fixture
participant runner_fixture
participant TargetTestRunner
Pytest->>GeneratedTargetTestClass: request runner_fixture
GeneratedTargetTestClass->>plugin_config_fixture: call plugin_config()
plugin_config_fixture-->>GeneratedTargetTestClass: dict or None
GeneratedTargetTestClass->>runner_fixture: call runner(plugin_config)
runner_fixture->>TargetTestRunner: __init__(target_class, config=plugin_config, suite_config, kwargs)
TargetTestRunner-->>runner_fixture: TargetTestRunner instance
runner_fixture-->>Pytest: TargetTestRunner instance
Class diagram for generated target test class and TargetTestRunnerclassDiagram
class GeneratedTargetTestClass {
+dict config
+dict suite_config
+plugin_config() dict or None
+runner(plugin_config dict or None) TargetTestRunner
}
class TargetTestRunner {
+TargetTestRunner(target_class, config, suite_config, kwargs)
}
GeneratedTargetTestClass --> TargetTestRunner : creates
Flow diagram for plugin_config resolution in target testsflowchart TD
A[Request runner fixture] --> B[Call plugin_config fixture]
B --> C{plugin_config is None?}
C -->|Yes| D[Use default config from factory]
C -->|No| E[Use plugin_config dict]
D --> F[Instantiate TargetTestRunner with default config]
E --> F[Instantiate TargetTestRunner with custom config]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3434 +/- ##
==========================================
- Coverage 94.07% 94.06% -0.02%
==========================================
Files 69 69
Lines 5777 5780 +3
Branches 716 716
==========================================
+ Hits 5435 5437 +2
- Misses 239 240 +1
Partials 103 103
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
CodSpeed Performance ReportMerging #3434 will not alter performanceComparing Summary
Footnotes |
Summary by Sourcery
Introduce a fixture-based configuration mechanism for target tests and update existing target test suites to use it.
New Features:
Enhancements:
Tests: