Commit fe09d6a
authored
Implement ensemble test framework (#2258)
* Enhance ensemble test framework with new features and improvements
- Updated .gitignore to include IntelliJ/Android Studio module files and runtime-generated GetStorage files.
- Added new scripts in melos.yaml for running Ensemble YAML tests and generating test schemas.
- Introduced a reset method in Ensemble class to clear singleton state between tests.
- Implemented a new ensemble_test_runner package with a CLI for running declarative YAML tests.
- Added extensive documentation for the new test runner, including a step vocabulary and JSON schema for test files.
- Developed assertion engine and extended step handlers to support a wider range of test actions and assertions.
This commit lays the groundwork for a more robust testing framework for Ensemble applications.
* Update README and schema descriptions to reflect app-local test paths; refactor test discovery and execution to support new directory structure. Add new test cases for helloApp and remove legacy tests. Enhance YAML test app patcher for dynamic test directory resolution.
* Update schema references and regenerate ensemble_tests_schema.json for app-local tests. Modify documentation and YAML files to reflect new schema path and ensure consistency across the project.
* Remove generated Flutter environment files to clean up the project structure.
* Enhance YAML test app patcher to validate test directory configuration and presence of test files. Add error handling for missing configuration and implement tests to verify directory resolution and test file detection.
* Implement error handling for missing declarative tests in CLI and enhance output extraction for known failures. Update tests to verify new functionality.
* Remove additional generated Flutter environment files to further clean up the project structure.
* Enhance ensemble test runner CLI with validation and reporting features. Add `--doctor` command for setup validation, implement JSON reporting options, and improve error messages for widget visibility and API calls. Update documentation with usage examples and clarify test directory requirements.
* Enhance ensemble test runner with new features for test authoring and validation. Add commands for app inspection, test scaffolding, and improved reporting options including JUnit format. Update README and documentation to reflect new functionalities and usage examples. Modify schema to include additional metadata fields for tests.
* Update ensemble dependency to version v1.2.46 in pubspec.yaml
* Implement timeout feature for ensemble test runner CLI. Add `--timeout` argument to specify test suite duration, with default set to 10 minutes. Update README with usage examples and modify CLI output handling to accommodate timeout settings.
* Add agent debug logging functionality to ensemble test runner
Introduce a new `agentDebugLog` function for logging debug information during test execution. This includes logging key events such as test entry, execution plan readiness, configuration building, and widget pumping. Update relevant files to integrate logging at various stages of the test harness and runner processes, enhancing traceability and debugging capabilities.
* Enhance local definition provider with detailed agent logging
Add comprehensive logging throughout the LocalDefinitionProvider class to track the loading of app configurations, themes, widgets, scripts, and actions. This includes logging before and after significant operations to improve traceability and debugging capabilities. Update the ensemble test harness to log the state before and after updating the app bundle, ensuring better visibility during test execution.
* Add agent debug logging to CLI test execution
Integrate additional logging within the `runEnsembleYamlTestsCli` function to capture key events during the CLI startup and before the Flutter test process. This enhancement improves traceability and debugging capabilities by logging the current working directory and arguments passed to the CLI.
* Add agent debug logging throughout assertion engine, entry point, and test reporter
Integrate detailed logging using the `agentDebugLog` function in the AssertionEngine, EnsembleTestEntry, and TestReporter classes. This enhancement captures key events and state information during test execution, improving traceability and debugging capabilities across the test runner's workflow.
* Refactor local provider and test runner by removing agent debug logging
Eliminate the `agentDebugLog` function calls from the LocalDefinitionProvider, AssertionEngine, and EnsembleTestRunner classes to streamline the codebase. This cleanup enhances readability and maintainability by removing unnecessary logging statements while retaining core functionality. Additionally, update the test harness to mock various method channels for improved testing capabilities.
* Update ensemble test harness to allow loading of app bundle through existing config path. This change preserves test-installed API providers and avoids unnecessary initialization of real providers, enhancing the test execution environment.
* Refactor LocalDefinitionProvider to use rootBundle for asset loading
Replace custom asset loading method with rootBundle.loadString for improved consistency and performance in loading local assets. This change enhances the readability of the code and aligns with best practices for asset management in Flutter applications.
* Refactor LocalDefinitionProvider to utilize a centralized asset loading method
Replace direct calls to rootBundle.loadString with a new _loadLocalAssetString method for improved consistency and maintainability in loading local assets. This change enhances code readability and aligns with best practices for asset management in Flutter applications.
* Add temporary storage path for tests in EnsembleTestHarness
Introduce a static variable for a temporary storage path in the EnsembleTestHarness class, enhancing the test environment by directing certain method channel calls to this path instead of the current directory. This change improves test isolation and management of temporary files during test execution.69 files changed
Lines changed: 16390 additions & 65 deletions
File tree
- modules
- ensemble/lib
- framework/definition_providers
- firebase_analytics/ios/Flutter
- packages/ensemble_test_runner
- assets/schema
- bin
- docs
- lib
- actions
- assertions
- cli
- discovery
- entry
- inspect
- mocks
- models
- parser
- reporters
- runner
- schema
- validation
- vocabulary
- test
- tool
- starter
- ensemble/apps/helloApp
- screens
- tests
- macos/Flutter/ephemeral
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
14 | 17 | | |
15 | 18 | | |
16 | 19 | | |
| |||
31 | 34 | | |
32 | 35 | | |
33 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
34 | 45 | | |
35 | 46 | | |
36 | | - | |
| 47 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
18 | 33 | | |
19 | 34 | | |
20 | 35 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
101 | 106 | | |
102 | 107 | | |
103 | 108 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
| 162 | + | |
162 | 163 | | |
163 | 164 | | |
164 | 165 | | |
| |||
195 | 196 | | |
196 | 197 | | |
197 | 198 | | |
198 | | - | |
| 199 | + | |
199 | 200 | | |
200 | 201 | | |
201 | 202 | | |
| |||
245 | 246 | | |
246 | 247 | | |
247 | 248 | | |
| 249 | + | |
248 | 250 | | |
249 | 251 | | |
250 | 252 | | |
| |||
Lines changed: 11 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | 1 | | |
3 | 2 | | |
4 | 3 | | |
| |||
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
16 | | - | |
17 | 15 | | |
18 | 16 | | |
19 | 17 | | |
| |||
43 | 41 | | |
44 | 42 | | |
45 | 43 | | |
46 | | - | |
47 | | - | |
| 44 | + | |
48 | 45 | | |
49 | 46 | | |
50 | 47 | | |
| |||
55 | 52 | | |
56 | 53 | | |
57 | 54 | | |
58 | | - | |
| 55 | + | |
59 | 56 | | |
60 | 57 | | |
61 | 58 | | |
| |||
75 | 72 | | |
76 | 73 | | |
77 | 74 | | |
78 | | - | |
| 75 | + | |
79 | 76 | | |
80 | 77 | | |
81 | 78 | | |
| |||
92 | 89 | | |
93 | 90 | | |
94 | 91 | | |
95 | | - | |
| 92 | + | |
96 | 93 | | |
97 | 94 | | |
98 | 95 | | |
| |||
130 | 127 | | |
131 | 128 | | |
132 | 129 | | |
133 | | - | |
134 | | - | |
| 130 | + | |
| 131 | + | |
135 | 132 | | |
136 | 133 | | |
137 | 134 | | |
| |||
209 | 206 | | |
210 | 207 | | |
211 | 208 | | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
Lines changed: 0 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | 1 | | |
4 | 2 | | |
5 | 3 | | |
6 | 4 | | |
7 | 5 | | |
8 | 6 | | |
9 | 7 | | |
10 | | - | |
11 | 8 | | |
12 | 9 | | |
13 | 10 | | |
| |||
Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 0 additions & 13 deletions
This file was deleted.
0 commit comments