-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
run "flutter test" #25
Comments
Good question, and an interesting (but still rather common!) scenario which I will add to the e2e tests and documentation. tl;dr: set What seems to be happening here is flutter tool finding its own installation and tries to run tests for its examples... Not good. The reason is that "flutter_bootstrap" is installing flutter toolchain inside your own repository (which is arguable, but without any configuration maybe not the worst thing to do). So naturally, when flutter starts at your project's directory level and tries to recurse... To fix it, the best way is to pin Flutter to a specific version. This isn't supported by Flutter core today, but it's trivial to do with git submodules. A common name for submodule (also one used by flutterw) is If you don't want to mess with submodules, it's also okay to put Flutter anywhere else outside the repo. If you're using "flutter_bootstrap" action, there's no need to preinstall flutter. Just set |
On a related note, there's already a fix in this repo's head which would eliminate the need for extra configuration. I'll need to add some tests and release 0.7.0 later this week, no environment variables will be necessary from that point on. |
Updating the plugin should resolve this problem now. |
Hi, Thanks for your fast response and sorry for my late reply. I tried it and it works partially.
But when i try to call Thanks in advance. |
Regarding E.g. my project directory structure is usually:
as for the |
My project structure is different from yours. Project Structure
Gemfile (android)source "https://rubygems.org" gem "fastlane" plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile') eval_gemfile(plugins_path) if File.exist?(plugins_path) Gemfile.lock (android)GEM remote: https://rubygems.org/ specs: CFPropertyList (3.0.4) rexml addressable (2.8.0) public_suffix (>= 2.0.2, < 5.0) artifactory (3.0.15) atomos (0.1.3) aws-eventstream (1.2.0) aws-partitions (1.507.0) aws-sdk-core (3.121.1) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.239.0) aws-sigv4 (~> 1.1) jmespath (~> 1.0) aws-sdk-kms (1.48.0) aws-sdk-core (~> 3, >= 3.120.0) aws-sigv4 (~> 1.1) aws-sdk-s3 (1.103.0) aws-sdk-core (~> 3, >= 3.120.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.4) aws-sigv4 (1.4.0) aws-eventstream (~> 1, >= 1.0.2) babosa (1.0.4) claide (1.0.3) colored (1.2) colored2 (3.1.2) commander (4.6.0) highline (~> 2.0.0) declarative (0.0.20) digest-crc (0.6.4) rake (>= 12.0.0, < 14.0.0) domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) dotenv (2.7.6) emoji_regex (3.2.2) excon (0.85.0) faraday (1.8.0) faraday-em_http (~> 1.0) faraday-em_synchrony (~> 1.0) faraday-excon (~> 1.1) faraday-httpclient (~> 1.0.1) faraday-net_http (~> 1.0) faraday-net_http_persistent (~> 1.1) faraday-patron (~> 1.0) faraday-rack (~> 1.0) multipart-post (>= 1.2, < 3) ruby2_keywords (>= 0.0.4) faraday-cookie_jar (0.0.7) faraday (>= 0.8.0) http-cookie (~> 1.0.0) faraday-em_http (1.0.0) faraday-em_synchrony (1.0.0) faraday-excon (1.1.0) faraday-httpclient (1.0.1) faraday-net_http (1.0.1) faraday-net_http_persistent (1.2.0) faraday-patron (1.0.0) faraday-rack (1.0.0) faraday_middleware (1.1.0) faraday (~> 1.0) fastimage (2.2.5) fastlane (2.195.0) CFPropertyList (>= 2.3, < 4.0.0) addressable (>= 2.8, < 3.0.0) artifactory (~> 3.0) aws-sdk-s3 (~> 1.0) babosa (>= 1.0.3, < 2.0.0) bundler (>= 1.12.0, < 3.0.0) colored commander (~> 4.6) dotenv (>= 2.1.1, < 3.0.0) emoji_regex (>= 0.1, < 4.0) excon (>= 0.71.0, < 1.0.0) faraday (~> 1.0) faraday-cookie_jar (~> 0.0.6) faraday_middleware (~> 1.0) fastimage (>= 2.1.0, < 3.0.0) gh_inspector (>= 1.1.2, < 2.0.0) google-apis-androidpublisher_v3 (~> 0.3) google-apis-playcustomapp_v1 (~> 0.1) google-cloud-storage (~> 1.31) highline (~> 2.0) json (< 3.0.0) jwt (>= 2.1.0, < 3) mini_magick (>= 4.9.4, < 5.0.0) multipart-post (~> 2.0.0) naturally (~> 2.2) optparse (~> 0.1.1) plist (>= 3.1.0, < 4.0.0) rubyzip (>= 2.0.0, < 3.0.0) security (= 0.1.3) simctl (~> 1.6.3) terminal-notifier (>= 2.0.0, < 3.0.0) terminal-table (>= 1.4.5, < 2.0.0) tty-screen (>= 0.6.3, < 1.0.0) tty-spinner (>= 0.8.0, < 1.0.0) word_wrap (~> 1.0.0) xcodeproj (>= 1.13.0, < 2.0.0) xcpretty (~> 0.3.0) xcpretty-travis-formatter (>= 0.0.3) fastlane-plugin-flutter (0.7.0) gh_inspector (1.1.3) google-apis-androidpublisher_v3 (0.11.0) google-apis-core (>= 0.4, < 2.a) google-apis-core (0.4.1) addressable (~> 2.5, >= 2.5.1) googleauth (>= 0.16.2, < 2.a) httpclient (>= 2.8.1, < 3.a) mini_mime (~> 1.0) representable (~> 3.0) retriable (>= 2.0, < 4.a) rexml webrick google-apis-iamcredentials_v1 (0.7.0) google-apis-core (>= 0.4, < 2.a) google-apis-playcustomapp_v1 (0.5.0) google-apis-core (>= 0.4, < 2.a) google-apis-storage_v1 (0.8.0) google-apis-core (>= 0.4, < 2.a) google-cloud-core (1.6.0) google-cloud-env (~> 1.0) google-cloud-errors (~> 1.0) google-cloud-env (1.5.0) faraday (>= 0.17.3, < 2.0) google-cloud-errors (1.2.0) google-cloud-storage (1.34.1) addressable (~> 2.5) digest-crc (~> 0.4) google-apis-iamcredentials_v1 (~> 0.1) google-apis-storage_v1 (~> 0.1) google-cloud-core (~> 1.6) googleauth (>= 0.16.2, < 2.a) mini_mime (~> 1.0) googleauth (0.17.1) faraday (>= 0.17.3, < 2.0) jwt (>= 1.4, < 3.0) memoist (~> 0.16) multi_json (~> 1.11) os (>= 0.9, < 2.0) signet (~> 0.15) highline (2.0.3) http-cookie (1.0.4) domain_name (~> 0.5) httpclient (2.8.3) jmespath (1.4.0) json (2.5.1) jwt (2.2.3) memoist (0.16.2) mini_magick (4.11.0) mini_mime (1.1.1) multi_json (1.15.0) multipart-post (2.0.0) nanaimo (0.3.0) naturally (2.2.1) optparse (0.1.1) os (1.1.1) plist (3.6.0) public_suffix (4.0.6) rake (13.0.6) representable (3.1.1) declarative (< 0.1.0) trailblazer-option (>= 0.1.1, < 0.2.0) uber (< 0.2.0) retriable (3.1.2) rexml (3.2.5) rouge (2.0.7) ruby2_keywords (0.0.5) rubyzip (2.3.2) security (0.1.3) signet (0.16.0) addressable (~> 2.8) faraday (>= 0.17.3, < 2.0) jwt (>= 1.5, < 3.0) multi_json (~> 1.10) simctl (1.6.8) CFPropertyList naturally terminal-notifier (2.0.0) terminal-table (1.8.0) unicode-display_width (~> 1.1, >= 1.1.1) trailblazer-option (0.1.1) tty-cursor (0.7.1) tty-screen (0.8.1) tty-spinner (0.9.3) tty-cursor (~> 0.7) uber (0.1.0) unf (0.1.4) unf_ext unf_ext (0.0.8-x64-mingw32) unicode-display_width (1.8.0) webrick (1.7.0) word_wrap (1.0.0) xcodeproj (1.21.0) CFPropertyList (>= 2.3.3, < 4.0) atomos (~> 0.1.3) claide (>= 1.0.2, < 2.0) colored2 (~> 3.1) nanaimo (~> 0.3.0) rexml (~> 3.2.4) xcpretty (0.3.0) rouge (~> 2.0.7) xcpretty-travis-formatter (1.0.1) xcpretty (~> 0.2, >= 0.0.7) PLATFORMS x64-mingw32 DEPENDENCIES fastlane fastlane-plugin-flutter BUNDLED WITH 2.2.28 running
|
The manual is legit, but my opinion is that it's heavily optimized towards very fast and easy initial setup, but not for long-term maintenance. In my case because of my background (few years of ruby + deep interest in CI) I have picked a different path, resorting to understanding how fastlane works with ios and android individually, increasing the learning curve but resulting in a more concise, easier to maintain configuration. But since this setup is so common, I can try to handle it as well (e.g. detect that current directory is named Now to the more important issue... I have compared the versions and we are using the same fastlane. It's puzzling how the behavior is so different, but two ideas:
|
I like your approach in heaving it centralized in the root directory. could you elaborate more on how I can set this up or do you know a blogpost? I am planning to build an iOS and a web application too, so I try to make it as easy to maintain as possible. Due to the fact, that I am quite new to the fastlane tool, you probably know better what is the best approach. But detecting the current directory should be sufficient. Regarding 1, no, I don't have a lane named "flutter". But I just saw, that Fastfiledefault_platform(:android) platform :android do lane :bootstrap do flutter_bootstrap( flutter_channel: 'stable', android_licenses: { 'android-sdk-license' => '24333f8a63b6825ea9c5514f83c2829b004d1fee', }, ) end end platform :android do desc "Run tests, build and deploy to Google Play" lane :test_and_deploy do |options| test_only build_flutter_app deploy_to(track: options[:track]) end desc "Run only tests" lane :test_only do bootstrap run_flutter_analyze run_flutter_tests end desc "Runs flutter analyze" lane :run_flutter_analyze do flutter(args: %w(analyze)) end desc "Runs all the tests" lane :run_flutter_tests do Dir.chdir("..") flutter(args: ["test", "--coverage"]) end desc "Build Flutter App" lane :build_flutter_app do gi = google_play_track_version_codes(track: 'internal') version_updated = gi[0].to_i + 1 puts version_updated if(FastlaneCore::Helper.operating_system == "Linux") sh("export BUILD_NUMBER = \"#{version_updated.to_s}\"") end output_file = flutter_build( debug: false, build: 'appbundle', build_number: version_updated, build_name: 'Demo Skeleton App', ) UI.success("Built #{output_file}!") end desc "Deploy to internal test on Google Play" lane :deploy_to do |options| upload_to_play_store( track: options[:track], aab: '../build/app/outputs/bundle/release/app-release.aab', release_status: 'draft', ) end end Here is the output from executing
|
Hi,
I tried running my
flutter test
suite. withflutter(args: %w(test))
and
flutter(args: %w(test ..))
But all of them failed with this strange error messages:
How can I run my tests?
The text was updated successfully, but these errors were encountered: