Improve test coverage for Instrument, logger, validators and monitor#7966
Draft
jenshnielsen wants to merge 6 commits intomicrosoft:mainfrom
Draft
Improve test coverage for Instrument, logger, validators and monitor#7966jenshnielsen wants to merge 6 commits intomicrosoft:mainfrom
jenshnielsen wants to merge 6 commits intomicrosoft:mainfrom
Conversation
63ee5d2 to
b802abd
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7966 +/- ##
==========================================
+ Coverage 69.97% 70.55% +0.57%
==========================================
Files 333 333
Lines 32245 32245
==========================================
+ Hits 22562 22749 +187
+ Misses 9683 9496 -187 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…modules Add 128 new tests across 12 new test files targeting modules that previously had 0% or very low test coverage (excluding instrument_drivers). New test files: - tests/utils/test_types.py: numpy type tuple definitions and composition - tests/utils/test_abstractmethod.py: qcodes_abstractmethod decorator - tests/utils/test_deprecate.py: QCoDeSDeprecationWarning class - tests/utils/test_deep_update_utils.py: recursive dict merging - tests/utils/test_path_helpers.py: QCoDeS path resolution utilities - tests/utils/test_numpy_utils.py: ragged array conversion - tests/dataset/test_snapshot_utils.py: dataset snapshot diffing - tests/dataset/test_json_exporter.py: JSON linear/heatmap export - tests/dataset/test_export_config.py: export config get/set functions - tests/dataset/test_rundescribertypes.py: TypedDict versioned schemas - tests/dataset/test_sqlite_settings_extended.py: SQLite settings/limits - tests/test_metadatable_base.py: Metadatable and MetadatableWithName Non-driver test coverage: 64.7% -> 65.4% Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add 207 new tests across 4 test files targeting modules with coverage between 43-56% (excluding instrument_drivers). New test files: - tests/test_logger_extended.py (28 tests): formatters, level name/code conversion, log file generation, LogCapture class, log_to_dataframe, logfile_to_dataframe, time_difference with comma separators - tests/test_config_extended.py (40 tests): DotDict dotted key access, nested set/get/contains/del, Config describe/add/getitem/save/load, update() recursive merge, schema validation edge cases - tests/test_monitor_extended.py (12 tests): _get_metadata with/without timestamps, unbound parameters, use_root_instrument flag, Monitor.show - tests/validators/test_validators_extended.py (127 tests): validate_all, range_str branches, base Validator, Nothing/Bool/Strings/Enum/OnOff/ Multiples/PermissiveMultiples/MultiType/MultiTypeOr/MultiTypeAnd/ Arrays/Lists/Sequence/Callable/Dict edge cases and error paths Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add 217 new tests across 7 test files targeting the largest remaining coverage gaps in non-driver modules. Parameters tests (71 tests): - tests/parameter/test_command_extended.py (17 tests): all call_by_str and call_cmd method combinations, arg count validation, NoCommandError - tests/parameter/test_function_extended.py (16 tests): validation, name properties, parsers, callable/string cmd, get_attrs - tests/parameter/test_grouped_parameter_extended.py (22 tests): DelegateGroup set/get with custom setter/getter, source_parameters, GroupedParameter repr and properties - tests/parameter/test_combined_parameter_extended.py (16 tests): combine(), aggregator, iter/len, snapshot_base, units deprecation Instrument core tests (146 tests): - tests/test_instrument_extended.py: write_raw/ask_raw NotImplementedError, close_all, find_instrument, exist/is_valid, repr, label, add_function, add_submodule, get_component, print_readable_snapshot, invalidate_cache, parent/ancestors/root_instrument, find_or_create_instrument - tests/test_channel_extended.py: InstrumentModule proxy methods, ChannelTuple operations (reversed/contains/add/index/count/get_by_name), ChannelList mutations and lock behavior, ChannelTupleValidator - tests/test_station_extended.py: snapshot_base, add/remove/get component, close_all_registered_instruments, Station.default handling Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
b802abd to
76f78ce
Compare
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.
On top of #7961 to be merged first