Fastlane scan: different output locally and on Bitrise

Hi!

I use fastlane scan to run my tests. I have a test that is randomly failing. Of course when I run it locally it always passes :slight_smile:
Then thing is that fastlane locally prints this kind of output

✗ TalkDownloader_will_parse_and_save_talks
expected to be nil, got <object_description>

However on Bitrise, fastlane produces different output, without crucial information on why test failed

Failing tests:
[22:49:24]: ▸ TalkDownloaderSpec.TalkDownloader_will_parse_and_save_talks
[22:49:24]: ▸ ** TEST FAILED **

Output from latest version of fastlane-step (2.3.12).
So I am wondering, is it my setup? Or bug in the step? Or maybe it’s problem with my configuration?
I didn’t spot any specific inputs for step.

And this is how fastlane step is configured in my bitrise.yml

  fastlane-test:
    steps:
    - fastlane:
        inputs:
        - lane: tests

EDIT
After finding this issue: iOS tests failed randomly/exit status 65
I added - deploy-tests-log as a next step after fastlane-test, deploy-tests-log is configured as follows:

  deploy-tests-log:
    steps:
      - deploy-to-bitrise-io:
          inputs:
            - deploy_path: ~/Library/Logs/scan/AppName-AppName.log

But I get Issue with input: DeployPath - path not exist at: ~/Library/Logs/scan/AppName-AppName.log

Hi @pikor,

The fastlane step indeed moves the logs from the default dir, into the $BITRISE_DEPLOY_DIR directory.

The Deploy to Bitrise.io step is configured to deploy all files from the $BITRISE_DEPLOY_DIR directory.

So, ideally / by default, those log files should be attached to the build, unless you change the config/path to deploy of the Deploy to Bitrise.io step.

Can you please try to remove the deploy_path config of the deploy-to-bitrise-io step, to reset it back to its default value ($BITRISE_DEPLOY_DIR)?

If that wouldn’t help, please also copy paste the new build’s bitrise.io URL so that we can check the full logs! :slight_smile:

The fastlane step indeed moves the logs from the default dir, into the $BITRISE_DEPLOY_DIR directory.

Ahh! Okay, so now my bitrise.yml looks as follows:

   feature:
     before_run:
        - cache-pull
        - bootstrap
        - fastlane-test
        - deploy-tests-log

  deploy-tests-log:
    steps:
      - deploy-to-bitrise-io:

but after successful build, this is what I see

Deploying the content of the Deploy directory separately
List of files to deploy
Deploying files
Success
You can find the Artifact on Bitrise, on the Build's page: https://www.bitrise.io/build/295e07ce22c24c5f

But apps & artifacts tab shows No apps generated...

Could you please clarify this a bit? I checked the build’s log, but it seems it’s successful, and no app is deployed because none are generated, you just run tests with fastlane… Did I miss something? :thinking:

Or do you mean the fastlane logs are not attached to the build? If you mean that, I just checked the step’s code again and it only moves the additional fastlane log files into the deploy dir if fastlane fails: https://github.com/bitrise-io/steps-fastlane/blob/ae39dbb65a36320446593e1e2f104b93b62bf09c/main.go#L311 - but it does not if fastlane is successful, which it was in the build you linked here (Fastlane scan: different output locally and on Bitrise).

I checked the build’s log, but it seems it’s successful, and no app is deployed because none are generated, you just run tests with fastlane… Did I miss something?

No, for builds on task/* branches, apps are not generated.

and it only moves the additional fastlane log files into the deploy dir if fastlane fails:(…) - but it does not if fastlane is successful

Ahh. That makes sense! Although if you take a look at this build https://www.bitrise.io/build/f6560b4e430e5e49, test failed but also Apps & Artifacts doesn’t contain any logs.

Checked the log and it seems you changed the Deploy to Bitrise.io step’s deploy path input. Instead of the default $BITRISE_DEPLOY_DIR it’s set to a specific path, from the log:

+------------------------------------------------------------------------------+
| (0) deploy-to-bitrise-io                                                     |
+------------------------------------------------------------------------------+
| id: deploy-to-bitrise-io                                                     |
| version: 1.3.10                                                              |
| collection: https://github.com/bitrise-io/bitrise-steplib.git                |
| toolkit: go                                                                  |
| time: 2018-03-27T14:48:09-07:00                                              |
+------------------------------------------------------------------------------+
|                                                                              |
...
- DeployPath: REDACTED.app.dSYM.zip
...

Depending on what you want to do, it might be a good idea to add a second Deploy to Bitrise.io step (you can add as many as you like :wink: ) and just keep that on its default, so that it attaches the files from the $BITRISE_DEPLOY_DIR while you use the other Deploy to Bitrise.io step to attach the dSYM or any other artifact which is not in the $BITRISE_DEPLOY_DIR.

Ahh, now it works great! Thanks for helping me!

1 Like

Any time! :wink:

This topic was automatically closed after 14 days. New replies are no longer allowed.