feat(targets): Add a config fixture for target tests#3434
Draft
edgarrmondragon wants to merge 1 commit into
Draft
feat(targets): Add a config fixture for target tests#3434edgarrmondragon wants to merge 1 commit into
edgarrmondragon wants to merge 1 commit into
Conversation
Signed-off-by: Edgar Ramírez-Mondragón <edgarrm358@gmail.com>
Contributor
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: