Skip to content

Azure DevOps builds not failing despite tests failing #31

Closed

Description

@ChrisLGardner

Expected Behavior

When a build is run via Azure DevOps I'd expect the build to fail if tests or PSSA fails. For example I have this build which failed while I was fixing various things in how it was versioning etc https://halbaradkenafin.visualstudio.com/Github/_build/results?buildId=775 and it failed correctly due to tests failing.

Current Behavior

I get builds like this one which pass despite some tests failing: https://halbaradkenafin.visualstudio.com/Github/_build/results?buildId=784

There was no real changes to the code between those two builds, I've even tried setting the ErrorActionPreference and ContinueOnError in the azure-pipelines.yml to ensure it does stop but it looks like the code isn't even getting to any of the throw statements that should cause it to stop.

Activity

  1. ChrisLGardner commented on Aug 28, 2019

    @ChrisLGardner
    ContributorAuthor

    After digging into it a bit more and trying to figure out what I might have changed which broke it, turns out that I'd set an output file for the Pester results and that's causing the build to pass even if it should fail.

    I can't see why that would make a difference since PassThru is always provided. I'll try to do some more digging and see if I can see what might be happening.

  2. ChrisLGardner commented on Aug 28, 2019

    @ChrisLGardner
    ContributorAuthor

    And after a second look at the code for this I've spotted the issue:

    This should almost certainly be adding those keys to the hashtable rather than redefining the hashtable entirely. I'll throw a pull request to fix this.

  3. devblackops commented on Sep 1, 2019

    @devblackops
    Member

    Good catch @ChrisLGardner. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions