Run import performance test also for v3 Locations#14404
Open
valentijnscholten wants to merge 9 commits intoDefectDojo:devfrom
Open
Run import performance test also for v3 Locations#14404valentijnscholten wants to merge 9 commits intoDefectDojo:devfrom
valentijnscholten wants to merge 9 commits intoDefectDojo:devfrom
Conversation
- Add TestDojoImporterPerformanceSmallLocations with V3_FEATURE_LOCATIONS - Update update_performance_test_counts.py to run both v2 and v3 test classes - Add --no-keepdb and EXTRA_ARGS to run-unittest.sh for test flexibility
mtesauro
previously approved these changes
Feb 28, 2026
Member
Author
|
The tests pass locally, but not GHA. Maybe let's wait for the locations code to settle down before merging this? |
Extract class_name from FAIL header in test output instead of relying on a test_class parameter. This correctly scopes method lookups to the right class when v2 and v3 share identical method names. - Add class_name field to TestCount (parsed from test output) - Scope update_test_file by class_name to avoid cross-class matching - Add process_class() helper to reduce duplication in main() - Default to running both v2 and v3 classes when no --test-class given
Upstream optimizations reduced query counts across all v3 test methods. Updated counts verified locally for both v2 and v3 test classes.
The default parameter `skip_validation = not settings.V3_FEATURE_LOCATIONS` was evaluated once at class definition time (import). This caused different query counts between local dev (V3=False at startup) and CI (V3=True at startup), because @override_settings in tests could not affect the already baked-in default. Changed to evaluate at runtime so full_clean() validation runs correctly based on the active setting.
Member
Author
|
Fixed it by making the new BaseModel respect the settings at runtime. The new full_clean stuff causes 100s of extra queries... |
Maffooch
approved these changes
Mar 9, 2026
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
TestDojoImporterPerformanceSmallLocationswithV3_FEATURE_LOCATIONSfor v3 importer performance testingupdate_performance_test_counts.pyto support multiple test classes with identical method namesclass_namefrom FAIL header to scope updates to the correct class--test-classis specifiedprocess_class()helper to reduce duplicationBaseModelWithoutTimeMeta.save()default parameterskip_validationto evaluate at runtime instead of class definition time. The old codeskip_validation: bool = not settings.V3_FEATURE_LOCATIONSbaked in the value at import, causingfull_clean()validation to be skipped when@override_settings(V3_FEATURE_LOCATIONS=True)was used in tests while the startup setting wasFalse.