feat: expand integration tests with new input types and mode transitions#2274
Merged
openminddev merged 15 commits intoOpenMind:mainfrom Feb 15, 2026
Merged
Conversation
Add ASR, battery, odometry, GPS mock inputs and test cases. Add mode transition integration test verifying input-triggered transitions through the full cortex runtime pipeline.
Replace no-op transition callback with real _on_mode_transition. Only mock _start_orchestrators to prevent infinite loops. This tests the actual transition: stop orchestrators, reinitialize mode components, and verify new config is loaded.
Add three new integration test scenarios for mode transitions: - Negative case: verify no transition when input lacks trigger keywords - Time-based: verify timeout-triggered mode transition - Cooldown: verify cooldown prevents repeated transitions Also fix missing timeout_seconds in build_multi_mode_config.
Filter cooldown and time-based configs in discover_mode_transition_test_cases() instead of skipping them inside test_mode_transition(). Discovery should only return configs that will actually be run.
Keywords are checked against the fused prompt (raw_response), not the LLM output. Original keywords included words not present in the prompt (e.g. "forecast", "temperature", "power", "location"). Replaced with keywords verified to exist in system_prompt or mock input output.
- Move `import json` to top-level (maintainer convention) - Remove unused MockTextProvider.text_count, remaining_texts properties - Remove unused MockStateProvider.reset_all() method - Remove unused load_test_texts() wrapper function - Remove redundant section comments in mock_state_provider.py
The -k flag filters by test ID, not file name. Parametrized test IDs use numeric indices (test_case_path0, test_case_path1) so -k "asr" or -k "battery" would match nothing.
- Fix typo: mock_confige_provider -> mock_config_provider - Extract normalize_expected_value, _detect_input_type, _extract_emotion to module-level to eliminate duplicate definitions - Remove dead code: pass inside try/except that can never raise - Collapse 3 identical rating_description branches into one - Add GPS-only case to get_movement_types_for_config - Fix mutable default argument (= [] -> = None) in mock_llm_ask - Replace if/elif chain with dict-based class restoration in input_registry
Match upstream convention where empty config objects are omitted from agent_inputs in JSON5 config files.
… conversation provider mock - Fix load_test_state_data to collect all entries before loading, preventing data overwrite when multiple files are specified - Extract _setup_mode_transition_mocks and _cleanup_mode_transition_test helpers to eliminate repeated setup/teardown code - Add _MockConversationProvider to MockGoogleASR to match upstream formatted_latest_buffer behavior (store_user_message call) - Remove unused battery_full.json (no test uses it, battery mock only reports for low levels)
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
|
Great PR! Thank you. |
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
New Test Cases
File Structure