|
3 | 3 | - [Technical Preconditions](#technical-preconditions) |
4 | 4 | * [Dependency Management](#dependency-management) |
5 | 5 | * [Generation of Localization Files in the app and ouds_core Folders](#generation-of-localization-files-in-the-app-and-ouds_core-folders) |
| 6 | +- [Running Tests](#running-tests) |
| 7 | + * [Test Suites](#test-suites) |
| 8 | + * [Run All Tests](#run-all-tests) |
| 9 | + * [Run Tests for a Specific Package](#run-tests-for-a-specific-package) |
| 10 | + * [Automated CI Tests](#automated-ci-tests) |
6 | 11 | - [Commits, Changelog, Release Notes, Versioning](#commits-changelog-release-notes-versioning) |
7 | 12 | * [Commit Guidelines](#commit-guidelines) |
8 | 13 | * [Release Notes and Changelog](#release-notes-and-changelog) |
@@ -35,6 +40,58 @@ You need to run this command because it generates the necessary localization fil |
35 | 40 | flutter gen-l10n |
36 | 41 | ``` |
37 | 42 |
|
| 43 | +## Running Tests |
| 44 | + |
| 45 | +The project uses [`flutter_test`](https://api.flutter.dev/flutter/flutter_test/flutter_test-library.html), the official Flutter testing framework (FLOSS, Apache 2.0 license), as its automated test suite. |
| 46 | + |
| 47 | +### Test Suites |
| 48 | + |
| 49 | +Tests are located in each package's `test/` directory: |
| 50 | + |
| 51 | +| Package | Test file | |
| 52 | +|---|---| |
| 53 | +| `app` | `app/test/widget_test.dart` | |
| 54 | +| `ouds_core` | `ouds_core/test/ouds_core_test.dart` | |
| 55 | +| `ouds_global_raw_tokens` | `ouds_global_raw_tokens/test/ouds_global_raw_tokens_test.dart` | |
| 56 | +| `ouds_theme_contract` | `ouds_theme_contract/test/ouds_theme_contract_test.dart` | |
| 57 | +| `ouds_theme_orange` | `ouds_theme_orange/test/ouds_theme_orange_test.dart` | |
| 58 | +| `ouds_theme_sosh` | `ouds_theme_sosh/test/ouds_theme_sosh_test.dart` | |
| 59 | +| `ouds_theme_wireframe` | `ouds_theme_wireframe/test/ouds_theme_wireframe_test.dart` | |
| 60 | + |
| 61 | +### Run All Tests |
| 62 | + |
| 63 | +From the root of the repository, run the following commands to execute tests for each package: |
| 64 | + |
| 65 | +```bash |
| 66 | +cd app && flutter test && cd .. |
| 67 | +cd ouds_core && flutter test && cd .. |
| 68 | +cd ouds_global_raw_tokens && flutter test && cd .. |
| 69 | +cd ouds_theme_contract && flutter test && cd .. |
| 70 | +cd ouds_theme_orange && flutter test && cd .. |
| 71 | +cd ouds_theme_sosh && flutter test && cd .. |
| 72 | +cd ouds_theme_wireframe && flutter test && cd .. |
| 73 | +``` |
| 74 | + |
| 75 | +### Run Tests for a Specific Package |
| 76 | + |
| 77 | +```bash |
| 78 | +cd <package_name> |
| 79 | +flutter test |
| 80 | +``` |
| 81 | + |
| 82 | +For example, to run only the `ouds_core` tests: |
| 83 | + |
| 84 | +```bash |
| 85 | +cd ouds_core |
| 86 | +flutter test |
| 87 | +``` |
| 88 | + |
| 89 | +### Automated CI Tests |
| 90 | + |
| 91 | +Tests are automatically executed on every push and pull request to `main` and `develop` branches via the GitHub Actions workflow defined in [`.github/workflows/build.yml`](./workflows/build.yml). |
| 92 | + |
| 93 | +The CI pipeline runs all test suites before any build step, ensuring no broken code is merged. |
| 94 | + |
38 | 95 | ## Commits, Changelog, Release Notes, Versioning |
39 | 96 |
|
40 | 97 | ### Commit Guidelines |
|
0 commit comments