Skip to content

Commit fed3074

Browse files
feat(test): add very_good.yaml for config (#1636)
* feat: support CLI parameter configuration via very_good.yaml Closes #360 Co-authored-by: marcossevilla <marcossevilla@users.noreply.github.com> * fix: address review feedback on PR #1636 Co-authored-by: marcossevilla <marcossevilla@users.noreply.github.com> * chore: use checked_yaml and json_serializable * chore: simplify * refactor: add config resolver * refactor: rename from snake_case * Delete e2e/test/commands/test/very_good_config/fixture/lib/uncovered.dart * Delete e2e/test/commands/test/very_good_config/fixture/test/covered_test.dart * fix: ci * docs: update to use snake_case * chore: code review * fix: extend ensure_build timeout and format docs - Add @timeout to ensure_build_test to avoid 30s AOT compilation timeout in CI - Format site/docs/commands/test.md with prettier - Add act scripts for local CI verification * chore: remove act scripts * fix: address review feedback on PR #1636 Co-authored-by: marcossevilla <marcossevilla@users.noreply.github.com> * fix: address review feedback on PR #1636 Co-authored-by: marcossevilla <marcossevilla@users.noreply.github.com> --------- Co-authored-by: unicoderbot[bot] <269805761+unicoderbot[bot]@users.noreply.github.com> Co-authored-by: marcossevilla <marcossevilla@users.noreply.github.com> Co-authored-by: Marcos Sevilla <me@marcossevilla.dev> Co-authored-by: Marcos Sevilla <31174242+marcossevilla@users.noreply.github.com>
1 parent 0fc1106 commit fed3074

20 files changed

Lines changed: 1237 additions & 34 deletions

File tree

.github/workflows/e2e.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ jobs:
3333
- test/commands/test/compilation_error/compilation_error_test.dart
3434
- test/commands/test/no_project/no_project_test.dart
3535
- test/commands/test/spaced_golden_file_name/spaced_golden_file_name_test.dart
36+
- test/commands/test/very_good_config/very_good_config_test.dart
3637

3738
# E2E tests for the create command
3839
- test/commands/create/flutter_app/core_test.dart

.github/workflows/very_good_cli.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,14 @@ jobs:
2929
os: [ubuntu-latest, windows-latest]
3030
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/flutter_package.yml@v1
3131
with:
32+
runs_on: ${{ matrix.os }}
3233
flutter_version: "3.44.x"
34+
coverage_excludes: "**/*.{gen,g}.dart"
3335
concurrency: 1
34-
coverage_excludes: "**/*.gen.dart"
35-
run_bloc_lint: false
3636
run_skipped: true
37-
runs_on: ${{ matrix.os }}
37+
run_bloc_lint: false
38+
# The CLI's own test suite is run directly rather than through the test optimizer,
39+
# matching the CI behavior prior to adopting this shared workflow.
3840
test_optimization: false
3941

4042
pana:

analysis_options.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
include: package:very_good_analysis/analysis_options.yaml
22
analyzer:
33
exclude:
4+
- "**/*.g.dart"
45
- "**/version.dart"
56
- "bricks/**/__brick__"

build.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
targets:
2+
$default:
3+
sources:
4+
- $package$
5+
- lib/**
6+
- bin/**
7+
- test/**
8+
- pubspec.yaml
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
int untestedFunction(int value) => value * 2;
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: very_good_config_fixture
2+
description: Fixture for testing very_good.yaml configuration.
3+
version: 0.1.0+1
4+
publish_to: none
5+
6+
environment:
7+
sdk: ^3.12.0
8+
9+
dev_dependencies:
10+
test: ^1.24.3
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import 'package:test/test.dart';
2+
3+
void main() {
4+
group('very_good_config_fixture', () {
5+
// This test exists only to produce a passing coverage run so the
6+
// `min_coverage: 100` config can be evaluated against the deliberately
7+
// uncovered `lib/uncovered.dart`.
8+
test('trivially succeeds', () {
9+
expect(true, isTrue);
10+
});
11+
});
12+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
test:
2+
min_coverage: 100
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: malformed_fixture
2+
description: Fixture for testing malformed very_good.yaml.
3+
version: 0.1.0+1
4+
publish_to: none
5+
6+
environment:
7+
sdk: ^3.12.0
8+
9+
dev_dependencies:
10+
test: ^1.24.3
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
- not
2+
- a
3+
- map

0 commit comments

Comments
 (0)