question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

runAffectedUnitTests -Paffected_module_detector.enable fails on CI only

See original GitHub issue

Hey, this was mentioned before but in my case it’s only failing on CI When I run ./gradlew runAffectedUnitTests -Paffected_module_detector.enable on Bitrise it fails in my project with error:

* What went wrong:
Could not evaluate onlyIf predicate for task ':module:testDebugUnitTest'.
> Nonzero exit value running git command.

the task is working fine locally My git project is setup on CI and i do git clone before invoking this command

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
shobande-femicommented, Jan 7, 2022

Can you post the out of the log file produced by the plugin?

I struggled with this issue over the past couple of days. In my case, the specifiedBranch was absent from the working tree. (I use Github Actions and it clones the repo in some sort of minimalist fashion).

My solution was to run git fetch origin develop:develop right before runAffectedUnitTests

Note: in this case develop is the specifiedBranch. Replace with whatever branch you specified.

0reactions
joshafeinbergcommented, Apr 13, 2022

Hello, I think @shobande-femi pointed out what is probably going wrong. You need to make sure that your CI has access to the git tree that it needs. You can find a log with a more detailed error in your logFolder/logFilename

As this hasn’t been updated in a few months I am going to close, please reopen or file a new ticket if you are still having issues

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting Continuous Integration, or How to Debug ...
If you're using a Continuous Integration server, sooner or later a build will fail on the CI, but pass on your development machine....
Read more >
Unit test reports - GitLab Docs
It is very common that a CI/CD pipeline contains a test job that verifies your code. If the tests fail, the pipeline fails...
Read more >
Grails Spock unit tests pass locally but fail in CI environment
I have a set of Spock based unit tests that are passing locally but failing with the two following exceptions being logged on...
Read more >
Fixing Tests in CI/CD: Why are Your Tests Failing?
There are multiple reasons to take failing tests seriously. First, failed tests can block the delivery of new releases, because the CI/CD ...
Read more >
Foresight Blog | How to Debug Tests in the CI Pipeline
The main reasons are listed below. Test Failures*:. Failures of unit tests, integration tests, functional tests, or performance tests can cause build failures....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found