Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
f8f3da0
Add comprehensive test suite for PR #323
jasikpark Jan 30, 2026
2f9a183
Add GitHub Actions CI workflow for automated testing
jasikpark Jan 30, 2026
ee951c9
Remove unused imports
jasikpark Jan 30, 2026
7f5a2c0
Update .gitignore for test coverage artifacts
jasikpark Jan 30, 2026
832d093
Don't track ios/Flutter/ephemeral
jasikpark Jan 30, 2026
cacca71
Update pubspec.lock
jasikpark Jan 30, 2026
93e349f
Address CodeRabbit feedback on test files
jasikpark Jan 30, 2026
d565511
Move test documentation to main README
jasikpark Jan 30, 2026
818df32
Refactor settings screen tests to focus on UI behavior
jasikpark Jan 30, 2026
f70b1d9
Adjust assertions for clarity
jasikpark Jan 30, 2026
f6f22d0
Add golden tests for home and site detail screens
jasikpark Jan 30, 2026
94f5e9d
Fix lints in test files
jasikpark Jan 30, 2026
c574a46
Don't fail flutter analyze on info or warning lints
jasikpark Jan 30, 2026
aa80215
Disable flutter analyze in CI
jasikpark Jan 30, 2026
98d268e
Use build pipeline from smoke.yml
jasikpark Jan 30, 2026
14d7214
moar fix
jasikpark Jan 30, 2026
0a35fd7
Match naming and casing from other flutter jobs
jasikpark Jan 30, 2026
baa1894
Rename flutter test workflow file
jasikpark Jan 30, 2026
17da612
Generate artifacts for ios
jasikpark Jan 30, 2026
b3d6615
Run on macos 26
jasikpark Jan 30, 2026
8c1a4d8
Mention that this is the iOS flutter test
jasikpark Jan 30, 2026
8504054
Remove useless test
jasikpark Jan 30, 2026
0b4ab84
Re-add failing golden tests w/ explicit screen size config for iphone…
jasikpark Jan 30, 2026
7d78a36
Fix golden test pixel shifts by setting devicePixelRatio to 1.0
jasikpark Feb 2, 2026
46c49e8
Try setting screen size per-test to see if that fixes CI v.s. local i…
jasikpark Feb 2, 2026
1495ef5
Remove golden tests to make first testing PR easy to review and merge
jasikpark Feb 9, 2026
7355ee7
Revert changes to SiteDetailScreen.dart
jasikpark Feb 9, 2026
742c33f
Oops updated SiteDetailScreen.dart when it was renamed
jasikpark Feb 10, 2026
4aecd09
format
jasikpark Feb 10, 2026
e8009ce
Simplify flutter analyze recc command
jasikpark Feb 10, 2026
1c42070
Update fluttertest.yml
jasikpark Feb 10, 2026
89da846
Fix imports
jasikpark Feb 10, 2026
764e3da
Fix imports
jasikpark Feb 10, 2026
0ff8b0e
Fix tests for the rich text widget change
jasikpark Feb 10, 2026
8605c1d
Fix flutter test job title
jasikpark Feb 10, 2026
7b8fc33
Fix artifact unique names
jasikpark Feb 10, 2026
e69e0a3
Add gradle cache
jasikpark Feb 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .github/workflows/fluttertest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Flutter test
on:
push:
branches:
- main
pull_request:
paths:
- ".github/workflows/fluttercheck.yml"
- "**.dart"

jobs:
test:
name: Run flutter test
runs-on: macos-26
strategy:
matrix:
os: [android, ios]

steps:
- name: Check out code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #6.0.2
with:
show-progress: false

# TODO: remove when https://go-review.googlesource.com/c/go/+/692935 lands in mainline go
- name: Patch Go
uses: DefinedNet/patch-go@c8e4a17c75eb242d34c212419d7d3d25e8d58949
with:
patch-ref: "296be05a97eb526dc0e438b7387670d4cae4a935"

- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 #v5.2.0
with:
distribution: "zulu"
java-version: "17"
cache: "gradle"

- name: Install flutter
uses: subosito/flutter-action@fd55f4c5af5b953cc57a2be44cb082c8f6635e8e #v2.21.0
with:
flutter-version: "3.38.9"
cache: true

- name: install dependencies
env:
TOKEN: ${{ secrets.MACHINE_USER_PAT }}
run: |
go install golang.org/x/mobile/cmd/gomobile@latest
gomobile init
flutter pub get
touch env.sh

- name: generate artifacts
run: ./gen-artifacts.sh ${{ matrix.os }}

- name: Run tests
run: flutter test --coverage

- name: Upload coverage artifacts
uses: actions/upload-artifact@v4
with:
name: coverage-report-${{ matrix.os }}
path: coverage/lcov.info
if: always()
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ android/app/.cxx
# Web related
lib/generated_plugin_registrant.dart

# Test coverage
coverage/
test/.test_coverage.dart
*.coverage

# Exceptions to above rules.
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
/nebula/local.settings
Expand Down
41 changes: 37 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Ensure your path is set up correctly to execute flutter

Run `flutter doctor` and fix everything it complains before proceeding

*NOTE* on iOS, always open `Runner.xcworkspace` and NOT the `Runner.xccodeproj`
_NOTE_ on iOS, always open `Runner.xcworkspace` and NOT the `Runner.xccodeproj`

### Before first compile

Expand All @@ -30,17 +30,50 @@ Run `flutter doctor` and fix everything it complains before proceeding

If you are having issues with iOS pods, try blowing it all away! `cd ios && rm -rf Pods/ Podfile.lock && pod install --repo-update`

## Testing

Run all tests:

```sh
flutter test
```

Run specific test file:

```sh
flutter test test/screens/settings_screen_test.dart
```

Generate coverage report:

```sh
flutter test --coverage
```

Run golden tests (update with `--update-goldens` flag):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably should remove this since we aren't doing goldens yet


```sh
flutter test test/screens/*_golden_test.dart
```

## Linting

```sh
flutter analyze
```

# Formatting

`dart format` can be used to format the code in `lib` and `test`. We use a line-length of 120 characters.
`dart format` can be used to format the code in `lib` and `test`. We use a line-length of 120 characters.

Use:

```sh
dart format lib/ test/ -l 120
```

In Android Studio, set the line length using Preferences -> Editor -> Code Style -> Dart -> Line length, set it to 120. Enable auto-format with Preferences -> Languages & Frameworks -> Flutter -> Format code on save.
In Android Studio, set the line length using Preferences -> Editor -> Code Style -> Dart -> Line length, set it to 120. Enable auto-format with Preferences -> Languages & Frameworks -> Flutter -> Format code on save.

`./swift-format.sh` can be used to format Swift code in the repo.

Once `swift-format` supports ignoring directories (<https://github.com/swiftlang/swift-format/issues/870>), we can move to a method of running it more like what <https://calebhearth.com/swift-format-github-action> describes.
Once `swift-format` supports ignoring directories (<https://github.com/swiftlang/swift-format/issues/870>), we can move to a method of running it more like what <https://calebhearth.com/swift-format-github-action> describes.
1 change: 1 addition & 0 deletions ios/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Flutter/app.flx
Flutter/app.zip
Flutter/flutter_assets/
Flutter/flutter_export_environment.sh
Flutter/ephemeral
ServiceDefinitions.json
Runner/GeneratedPluginRegistrant.*

Expand Down
Loading
Loading