It's not the same without you
Join the community to find out what other Atlassian users are discussing, debating and creating.
Hi all,
I have a dotnet core app i am trying to run tests against, to discover my tests i am running the find command in bash. When doing this if the tests fail, the build still passes. Does anyone have any ideas on how to get it failing or any workarounds
Thanks
Jordan
fail_erm_wut.PNG
I Solved the issue. if anyone else is having the same issue you can use or do do something similar to this
bitbucket-pipelines.yml
image: microsoft/dotnet:onbuild pipelines: default: - step: script: # Modify the commands below to build your repository. - dotnet restore - dotnet build *\\**\\project.json - chmod u+x Build.sh - ./Build.sh
then create a build script containing
Build.sh
#!/bin/bash TESTS=`find "tests" -name 'project.json'` for FILE in $TESTS; do COMMAND="dotnet test $FILE" $COMMAND done
this will find any project that contains the word tests and runs dotnet test against the project. if the tests fail the build will fail, if the tests pass the build will pass. its pretty dumb search atm but works for me. tweak to your needs
Nice job!
I'm just going to add some additional information for anyone looking into a similar problem: Pipelines determines the status of your build by reading the exit code of your bash commands. The find command here had wrapped the execution of the dotnet tests, but didn't seem to be propagating the exit code from the tests. Instead it was returning that it successfully completed the "find". The solution here (and in other similar problems) will be to try and find a way to ensure that Pipelines can see the exit codes of your commands.
This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.
Read moreBitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda ...
Connect with like-minded Atlassian users at free events near you!
Find a groupConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.
Start an AUGYou're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.