saucelabs / saucectl

A command line interface for the Sauce Labs platform.
Apache License 2.0
42 stars 16 forks source link

saucectl-report.xml is not generated in case of Success #939

Closed jarroyoesp closed 2 months ago

jarroyoesp commented 2 months ago

Current behavior

In our project, every time we create a pull request we run some Espresso tests to check our app runs fine with the new changes. We started to see that in case of success for all the tests, the report was not generated, seeing the error Failed to render junit report. error="open ./build/sauce/saucectl-report.xml: no such file or directory" without any change in our config.yml file:

EspressoError

And Archiving violations report we had this warning:

ArchivingWarning

Desired behavior

To grant backward compatibility the default value of allAttempts should be true, instead of false, this way the report will be generated in all the cases, success and failure, just as it was before.

Config to reproduce

apiVersion: v1alpha
kind: espresso
showConsoleLog: true
sauce:
  region: eu-central-1
  concurrency: 5
  retries: 2
  ....
reporters:
  junit:
    enabled: true
    filename: ./build/sauce/saucectl-report.xml
artifacts:
  download:
    when: always
    match:
      - junit.xml
      - logcat.log
    directory: ./build/sauce/
espresso:
  app: ./path/debug.apk
  testApp: ./path/androidTest.apk
suites:
.....

Workaround

If we add allAttempts: true to artifacts it works fine again in case of success or failure:

apiVersion: v1alpha
kind: espresso
showConsoleLog: true
sauce:
  region: eu-central-1
  concurrency: 5
  retries: 2
  ....
reporters:
  junit:
    enabled: true
    filename: ./build/sauce/saucectl-report.xml
artifacts:
  download:
    when: always
    allAttempts: true ### <--------------- WORKAROUND
    match:
      - junit.xml
      - logcat.log
      ....

Versions

Tested with:

alexplischke commented 2 months ago

Addressed via https://github.com/saucelabs/saucectl/pull/943. Thank you for reporting this issue!