Skip to content
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

Job not fail on tests failure #14

Open
Zaszczyk opened this issue May 15, 2020 · 5 comments
Open

Job not fail on tests failure #14

Zaszczyk opened this issue May 15, 2020 · 5 comments

Comments

@Zaszczyk
Copy link

I use this plugin and it is very well. However I cannot configure or it could be a bug: the job not fail on tests failure. I have such logs:

[13:04:48]: ▸ Test [matrix-xyz] has been created in the Google Cloud.
[13:04:48]: ▸ Firebase Test Lab will execute your instrumentation test on 2 device(s).
[13:04:48]: ▸ Creating individual test executions...
[13:05:00]: ▸ ...........................................................done.
[13:05:00]: ▸ Test results will be streamed to [https://console.firebase.google.com/project/xyz/testlab/histories/bh.xyz/matrices/xyz].
[13:11:02]: ▸ 13:11:02 Test matrix status: Finished:2
[13:11:02]: ▸ Instrumentation testing complete.
[13:11:02]: ▸ More details are available at [https://console.firebase.google.com/project/xyz/testlab/histories/bh.xyz/matrices/xyz].
[13:11:04]: Test status: [{"axis_value"=>"Nexus6P-23-pl_PL-portrait", "outcome"=>"Failed", "test_details"=>"1 test cases failed, 1 passed"}, {"axis_value"=>"Pixel2-28-en_US-portrait", "outcome"=>"Failed", "test_details"=>"1 test cases failed, 1 passed"}]
[13:11:04]: Finishing...

In logs I see tests failed, but the result of job is: passed. How can I configure this plugin, to fail job when tests not passed?

My lane"

lane :firebase_instrumentation_test do

        apkPath = "path"

    firebase_test_lab_android(
      project_id: "fitqbeapp",                                    # Your Firebase project name.
      gcloud_service_key_file: "#{ENV['GCP_KEY']}",         # File path containing the gcloud auth key.
      # gcloud_components_channel: "alpha",                            # If you use gcloud component channel option (alpha/beta).
      type: "instrumentation",                                                   # Optional: Test type (robo/instrumentation).
      devices: [                                                      # Devices
        {
          model: "Nexus6P",
          version: "23",
          locale: "pl_PL",
          orientation: "portrait"
        },
        {
          model: "Pixel2",
          version: "28"
        }
      ],
      app_apk: apkPath,                                       # The path for your android app apk.
      app_test_apk: "/app-debug-androidTest.apk",       # The path for your android instrumentation test apk.
      console_log_file_name: "fastlane/console_output.log",
      timeout: "30m",

    )
  end
@Zaszczyk
Copy link
Author

I found fork, which implements job failure when tests not pass: master...dubsmash:master there are commits from Dec 24, 2019.
@cats-oss could you merge it to this repo?

@ghost
Copy link

ghost commented Nov 3, 2020

It'll be really nice to fail the lane when the tests fail to avoid parsing the output and checking for "outcome =>Failure".

Now I'm reading the JSON output manually and failing the lane in case the tests have failed.

@NinjaRat84
Copy link

I would love this feature as well, still up for merging the request?

@ziadtawfeek
Copy link

ziadtawfeek commented Apr 3, 2021

@cats-oss Thank you so much for this plugin 🙏 It has proved to be useful for me! Do you have any plans to merge this soon?

@thereallukesimpson
Copy link

Thanks for the great plugin, but it usefullness is limited when it does not trigger a failed pipeline on test failure. Is there anything I can do to help get this feature merged in?

The PR above #17 also contains the addition of the --num-unform-shards param which would also be super useful! Anyone know why it was closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants