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

Display message of criteria when task fails to run due to criteria not being met #3647

Closed
augustoproiete opened this issue Oct 30, 2021 · 1 comment · Fixed by #3648
Closed
Assignees
Milestone

Comments

@augustoproiete
Copy link
Member

I have something like

Task("UploadTestReport")
    .IsDependentOn("Test")
    .WithCriteria((context) => FileExists(testCoverageOutputFilePath))
    .WithCriteria(!string.IsNullOrWhiteSpace(coverallsRepoToken))
    .WithCriteria((context) => !BuildSystem.IsLocalBuild)
    .Does(() => { }

then my build failed with the message

Error: One or more errors occurred. (Could not reach target 'UploadTestReport' since it was skipped due to a criteria.)
Could not reach target 'UploadTestReport' since it was skipped due to a criteria.
Error: The process 'tools\dotnet-cake' failed with exit code 1

Is there a way how to know what exactly criteria don'twork?

Originally posted by @Marusyk in #3625

@augustoproiete augustoproiete self-assigned this Oct 30, 2021
@augustoproiete augustoproiete added this to the v2.0.0 milestone Oct 30, 2021
augustoproiete added a commit to augustoproiete-forks/cake-build--cake that referenced this issue Oct 30, 2021
devlead pushed a commit to augustoproiete-forks/cake-build--cake that referenced this issue Oct 30, 2021
@cake-build-bot
Copy link

🎉 This issue has been resolved in version v2.0.0 🎉

The release is available on:

Your GitReleaseManager bot 📦🚀

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