Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 4 additions & 1 deletion .github/workflows/shorebird_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,16 @@ jobs:

- name: 🐦 Run Flutter Tools Tests
# TODO(eseidel): Find a nice way to run this on windows.
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' }}
# TODO(eseidel): We can't run all flutter_tools tests until we make
# our changes not throw exceptions on missing shorebird.yaml.
# https://github.com/shorebirdtech/shorebird/issues/2392
run: ../../bin/flutter test test/general.shard/shorebird
working-directory: packages/flutter_tools

- name: 🐦 Run Shorebird Tests
# TODO(felangel): These tests have a dependency on pkg:flutter_flavorizr which
# requires XCode -- therefore they don't work on Windows.
if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' }}
run: dart test
working-directory: packages/shorebird_tests
20 changes: 16 additions & 4 deletions packages/shorebird_tests/test/shorebird_tests.dart
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,23 @@ extension ShorebirdProjectDirectoryOnDirectory on Directory {
path.join(this.path, 'android', 'app', 'build.gradle'),
);

Future<void> addPubDependency(String name, {bool dev = false}) {
return _runFlutterCommand(
Future<void> addPubDependency(String name, {bool dev = false}) async {
final result = await _runFlutterCommand(
['pub', 'add', if (dev) '--dev', name],
workingDirectory: this,
);
if (result.exitCode != 0) {
throw Exception(
'Failed to run `flutter pub add $name`: ${result.stderr}');
}
}

Future<void> addProjectFlavors() async {
await addPubDependency('flutter_flavorizr', dev: true);
await addPubDependency(
// TODO(felangel): revert to using published version once 3.29.0 support is released.
// https://github.com/AngeloAvv/flutter_flavorizr/pull/291
'dev:flutter_flavorizr:{"git":{"url":"https://github.com/wjlee611/flutter_flavorizr.git","ref":"chore/temp-migrate-3-29","path":"."}}',
);

await File(
path.join(
Expand Down Expand Up @@ -153,10 +161,14 @@ flavors:
bundleId: "com.example.shorebird_test.global"
''');

await _runFlutterCommand(
final result = await _runFlutterCommand(
['pub', 'run', 'flutter_flavorizr'],
workingDirectory: this,
);
if (result.exitCode != 0) {
throw Exception(
'Failed to run `flutter pub run flutter_flavorizr`: ${result.stderr}');
}
}

void addShorebirdFlavors() {
Expand Down