shorebirdtech / shorebird

Code Push for Flutter and other tools for Flutter businesses.
https://shorebird.dev
Other
2.3k stars 139 forks source link

fix: flutter_tools tests don't pass in shorebirdtech/flutter #2392

Open eseidel opened 3 months ago

eseidel commented 3 months ago

To repro:

git clone https://github.com/shorebirdtech/flutter.git
cd flutter
./bin/flutter update-packages
cd packages/fluter_tools
../../bin/flutter test test/general.shard

Fails due to code in mac.dart where we throw an exception if shorebird.yaml is not found.

I suspect instead we should only throw exception on missing shorebird.yaml when some environment variable is set or flag is passed?

One way might be to check FLUTTER_STORAGE_BASE_URL == https://download.shorebird.dev, since that's a way that will work even with older versions of shorebird that happen to download a newer version of flutter (which should be a rare case).

eseidel commented 3 months ago
To run this test again: /Users/eseidel/Documents/GitHub/flutter/bin/cache/dart-sdk/bin/dart test /Users/eseidel/Documents/GitHub/flutter/packages/flutter_tools/test/general.shard/ios/ios_device_start_nonprebuilt_test.dart -p vm --plain-name 'IOSDevice.startApp for CoreDevice in debug mode succeeds'
00:14 +1829 ~3 -4: /Users/eseidel/Documents/GitHub/flutter/packages/flutter_tools/test/general.shard/ios/ios_device_start_nonprebuilt_test.dart: IOSDevice.startApp for CoreDevice in debug mode with flavor succeeds
Expected: empty
  Actual: '[shorebird] failed to generate shorebird configuration.\n'
            'Exception: shorebird.yaml not found at build/ios/archive/My Super Awesome App.xcarchive/Products/Applications/My Super Awesome App.app/Frameworks/App.framework/flutter_assets/shorebird.yaml\n'
            'Could not build the precompiled application for the device.\n'
            '\n'
            ''

#0      fail (package:matcher/src/expect/expect.dart:149:31)
#1      _expect (package:matcher/src/expect/expect.dart:144:3)
#2      expect (package:matcher/src/expect/expect.dart:56:3)
#3      main.<anonymous closure>.<anonymous closure>.<anonymous closure>.<anonymous closure> (file:///Users/eseidel/Documents/GitHub/flutter/packages/flutter_tools/test/general.shard/ios/ios_device_start_nonprebuilt_test.dart:599:11)
<asynchronous suspension>
#4      testUsingContext.<anonymous closure>.<anonymous closure>.<anonymous closure>.<anonymous closure>.<anonymous closure> (file:///Users/eseidel/Documents/GitHub/flutter/packages/flutter_tools/test/src/context.dart:151:26)
<asynchronous suspension>
#5      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
<asynchronous suspension>
#6      testUsingContext.<anonymous closure>.<anonymous closure>.<anonymous closure>.<anonymous closure> (file:///Users/eseidel/Documents/GitHub/flutter/packages/flutter_tools/test/src/context.dart:140:22)
<asynchronous suspension>

00:14 +1830 ~3 -5: /Users/eseidel/Documents/GitHub/flutter/packages/flutter_tools/test/general.shard/ios/ios_device_start_nonprebuilt_test.dart: IOSDevice.startApp for CoreDevice in debug mode with flavor succeeds [E]
  Expected: empty
    Actual: '[shorebird] failed to generate shorebird configuration.\n'
              'Exception: shorebird.yaml not found at build/ios/archive/My Super Awesome App.xcarchive/Products/Applications/My Super Awesome App.app/Frameworks/App.framework/flutter_assets/shorebird.yaml\n'
              'Could not build the precompiled application for the device.\n'
              '\n'
              ''

  package:matcher                                                       expect
  test/general.shard/ios/ios_device_start_nonprebuilt_test.dart 599:11  main.<fn>.<fn>.<fn>.<fn>
  ===== asynchronous gap ===========================
  dart:async                                                            _CustomZone.registerBinaryCallback
  test/src/context.dart 140:22                                          testUsingContext.<fn>.<fn>.<fn>.<fn>
  dart:async                                                            runZonedGuarded
  test/src/context.dart 138:11                                          testUsingContext.<fn>.<fn>.<fn>
  package:flutter_tools/src/base/context.dart 153:29                    AppContext.run.<fn>
  dart:async                                                            runZoned
  package:flutter_tools/src/base/context.dart 152:12                    AppContext.run
  test/src/context.dart 105:22                                          testUsingContext.<fn>.<fn>
  package:flutter_tools/src/context_runner.dart 82:18                   runInContext.runnerWrapper
  ===== asynchronous gap ===========================
  dart:async                                                            _CustomZone.registerUnaryCallback
  package:flutter_tools/src/context_runner.dart 81:20                   runInContext.runnerWrapper
  package:flutter_tools/src/base/context.dart 153:29                    AppContext.run.<fn>
  dart:async                                                            runZoned
  package:flutter_tools/src/base/context.dart 152:12                    AppContext.run
  package:flutter_tools/src/context_runner.dart 87:18                   runInContext
  test/src/context.dart 104:11                                          testUsingContext.<fn>
  test/src/common.dart 184:18             
quanglm23 commented 2 months ago

Is there any update for this?

eseidel commented 2 months ago

Is there any update for this?

No work has been done on this. I don't think this affects anything other than our internal testing. Are you running into this bug in some way?

quanglm23 commented 2 months ago

Is there any update for this?

No work has been done on this. I don't think this affects anything other than our internal testing. Are you running into this bug in some way?

Actually I waiting for issue #2206 It's still not working with IOS app contain "." which is blocked by this issue

eseidel commented 2 months ago

Ah, makes sense. Thanks!