https://github.com/bitrise-steplib/bitrise-step-flutter-test
https://github.com/bitrise-steplib/bitrise-step-flutter-test
bitrise bitrise-step ci production-code
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/bitrise-steplib/bitrise-step-flutter-test
- Owner: bitrise-steplib
- License: mit
- Created: 2018-12-12T16:02:51.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-10-11T10:34:26.000Z (over 2 years ago)
- Last Synced: 2024-06-21T18:44:43.460Z (almost 2 years ago)
- Topics: bitrise, bitrise-step, ci, production-code
- Language: Go
- Homepage:
- Size: 229 KB
- Stars: 1
- Watchers: 9
- Forks: 10
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Flutter Test
[](https://github.com/bitrise-steplib/bitrise-step-flutter-test/releases)
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`.
### Configuring the Step
1. Provide your project's root directory in the **Project Location** field.
2. 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.
3. You can append additional flags to the default `flutter test` command in the **Additional parameters** field.
4. Select 'yes' in the **Generate code coverage files** input to get detailed analysis of your code.
### Troubleshooting
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.
### Useful links
- [Getting started with Flutter](https://devcenter.bitrise.io/getting-started/getting-started-with-flutter-apps/)
- [About testing](https://devcenter.bitrise.io/testing/testing-index/)
### Related Steps
- [Flutter Build](https://www.bitrise.io/integrations/steps/flutter-build)
- [Flutter Analyze](https://www.bitrise.io/integrations/steps/flutter-analyze)
## 🧩 Get started
Add this step directly to your workflow in the [Bitrise Workflow Editor](https://devcenter.bitrise.io/steps-and-workflows/steps-and-workflows-index/).
You can also run this step directly with [Bitrise CLI](https://github.com/bitrise-io/bitrise).
## ⚙️ Configuration
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. |
## 🙋 Contributing
We welcome [pull requests](https://github.com/bitrise-steplib/bitrise-step-flutter-test/pulls) and [issues](https://github.com/bitrise-steplib/bitrise-step-flutter-test/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](https://devcenter.bitrise.io/bitrise-cli/run-your-first-build/).
Learn more about developing steps:
- [Create your own step](https://devcenter.bitrise.io/contributors/create-your-own-step/)
- [Testing your Step](https://devcenter.bitrise.io/contributors/testing-and-versioning-your-steps/)