Why is my build status green, even though a test failed? - appveyor

I have a GitHub project that requires a successful appveyor build to complete a Pull Request. I recently added a test script to run some tests and upload the test results as an XML file. This works fine—I can see the test results, including details about failed tests.
However, when a PR triggers an appveyor build, and a test fails, the build status is still green, and the GitHub PR check is satisfied.
How can I configure it so that a failed test will fail the build, or at least fail the GitHub PR?
Example PR with green check: here
The "details" link takes you to the build, which shows as green, despite the red failed test: here

AppVeyor build would fail if that script fail (return code not 0), but because last command is happy, it returns 0. More details with workarounds here.

Related

How to block merge request on GitHub if a build fails on Jenkins

The idea is that I want to block pull requests on GitHub if a build fails on Jenkins so that potential bad code doesn't get merged
I had originally found a plugin called Pipeline GitHub Notify Step: https://www.jenkins.io/doc/pipeline/steps/pipeline-githubnotify-step/ that uses
githubNotify
but then I found out from this link https://plugins.jenkins.io/pipeline-githubnotify-step/ that we should use the github-checks-plugin instead of the Pipeline GitHub Notify. I don't know if its because its depreciated or they just added similar features to the github-checks-plugin but I decided to just install the GitHub Checks Plugin. Afterwards I opened a PR on GitHub with code I knew would fail the build then ran a test build on Jenkins with the impression that GitHub would block my PR due to the bad build but it didn't I went under settings->branch and enabled Require status checks to pass before merging but it didn't block my PR because of the failed build. In fact it still doesn't even notice the failed build. Maybe I'm missing another plugin or perhaps there was something I forgot to enable.

Azure DevOps - Can't link automated tests for Azure DevOps, outcome always shows: "In progress" instead "Failed" or "Passed"

I'm new on DevOps Azure. I'm trying to link my automated tests for Azure DevOps platform, but outcome is always "In progress". I don't get failed or passed for any test. I created my tests in Visual Studio C#.
I created app and CheckIn it in Visual Studio and it's showed in Repos File, also my test folder is shown too. If I do changes in my code it's updated in Repos. So it is fine.
Then, I created Pipeline:TestMirjana-.NET Desktop-CI
and build is successful for this one. Than, I created Release linked for this pipeline:
and it is successful too.
I linked my test case for Visual Studio:
also linked Test Plan Settings for these pipeline and release
but when I run my test case Outcome is always "In progress", no other results shown (not failed or passed)
validation is good
but Outcome is always None
.
So, I'm not sure why it's not working properly.
Maybe I didn't link something properly, can you please support?
Many thanks in advance.
The 'In Progress' result means it has some automation associated but there are no incoming results (having the required test configuration).
Try to run the vstest task in the Release pipeline (instead of the build pipeline) and use "Select tests using=Test plan" and pick the Test plan where you expect to see the results from automated tests. It works for me.

Travis CI build status failed. What can I do?

I am new in project continuous deployment. I only add my project in Travis CI and add the status logo in my github repo README.md. My project is created using php,html,javascript,bootstrap. And, my project is also connected with mysql database.
Now, what can I do so that it results successful build status.
Edit 1
As I new I don't know where the error message stored by travis ci. But, I can see a job log.
The job log is where you can find out what went wrong. Simply read the logs generated by travis, i.e. here: https://travis-ci.org/al2helal/HandicraftStore/builds/373415975
The error message you're getting is:
The command "phpunit" exited with 2.
Since you haven't defined what you want Travis to do in your .travis.yml, but only configured the language (php), Travis runs the default set of tests for the configured language. In your case it runs phpunit.
However, you haven't written any tests nor you have configured phpunit, so it only displays a help message and exits with an error code.
Before you deploy your automatically anywhere you should run tests that confirm your application is working as expected. Start with writing some.
Next, you'll need to configure Travis to run those tests and configure deployment if all tests pass.
Since you don't seem to know anything about Travis CI, the best place to start is just go through their docs: https://docs.travis-ci.com/

Set warning result (or partial failure) on TeamCity build

In my TeamCity instance I have a build that builds, packages and publushes a NuGet package from source.
This particular package has version hardcoded in build parameters and isn't being incremented on each build.
On the final step of the build, actual publish, in case I am trying to publish a package with the version that is already published, I get an error (NuGet Publish type step returns 1).
This return code marks entire build as failed, since there is a general condition to fail a build where any steps return anything other then 0.
I would like to have a third state of the build - partially successful, to indicate that even though everything went fine, the publish didn't happen. Is this possible via some trick in configuration? Any type of result would be sufficient, as long as it is not marked red as failed and is not totally green that won't let me see that it didn't publish.
There's no "warning" result for a build config in TeamCity.
My suggestion would be that you move the Package/Publish steps into a separate build config that is triggered by a finish build trigger (success only) on your Build config. That way the build config can succeed, and the Package config may fail independently - you will see the results of both which should give you what you want.
Alternatively you can query your Nuget server if the package with the version you are about to produce already exists and do nothing in this case (or handle it differently). That should be doable with a little Powershell.

Teamcity constantly rebuilding a pull request even though the last build failed and there have been no further commits

I have TeamCity set up to build Github pull requests as per these instructions: http://blog.jetbrains.com/teamcity/2013/02/automatically-building-pull-requests-from-github-with-teamcity/
I have added a VCS build trigger so that TeamCity polls Github looking for changes. This has no special settings enabled.
My build involves a shell script to set up dependencies and an Ant script to run PHPUnit. Right now, the Ant script fails (tests don't pass) with exit code 1. The build shows as a fail, and that should be that. However, every time the VCS build trigger looks for changes, it seems to find some, even though there have been no more commits. It then runs yet another build of the same merge commit and keeps repeating the build endlessly.
Why is it constantly thinking that there are changes when there are not?