Performs any test in a Flutter project.
Description
If you have tests in your repository, and selected yes
when prompted during app creation, the primary Workflow will include the Flutter Test Step by default.
If you add tests to your app later, add the Flutter Test Step to your Workflow manually. The Step runs the flutter test
command with the specified flags. To check the available flags, open a command line interface on your own machine and run flutter test --help
.
- Provide your project's root directory in the Project Location field.
- The Step's test result directory is the root directory for all test results created by the Bitrise CLI. This input gets filled out automatically.
- You can append additional flags to the default
flutter test
command in the Additional parameters field. - Select 'yes' in the Generate code coverage files input to get detailed analysis of your code.
Make sure the Project Location input of the Flutter Test Step is correct. The default value is the Environment Variable (Env Var) created for your Flutter project’s location.
Add this step directly to your workflow in the Bitrise Workflow Editor.
You can also run this step directly with Bitrise CLI.
Inputs
Key | Description | Flags | Default |
---|---|---|---|
project_location |
The root dir of your Flutter project. | required | $BITRISE_SOURCE_DIR |
bitrise_test_result_dir |
Root directory for all test results created by the Bitrise CLI | required | $BITRISE_TEST_RESULT_DIR |
generate_code_coverage_files |
In case of generate_code_coverage_files: "yes" flutter test gets --coverage passed |
required | false |
additional_params |
The flags from this input field are appended to the flutter test command. |
||
tests_path_pattern |
The pattern from this input field is expanded and fed to the flutter test command. Both * and ** glob patterns are supported. For example, lib/**/*_test.dart . |
Outputs
Environment Variable | Description |
---|---|
BITRISE_FLUTTER_COVERAGE_PATH |
The path of the generated code coverage lcov.info file. |
BITRISE_FLUTTER_TESTRESULT_PATH |
The path of the json file that was generated by the flutter test command. |
We welcome pull requests and issues against this repository.
For pull requests, work on your changes in a forked repository and use the Bitrise CLI to run step tests locally.
Learn more about developing steps: