Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

TFS Build Fails but no Buildmaster shows complete and continues



  • We have BuildMaster set up to build automatically from TFS on check-in, and this works great most of the time. Just recently we were testing some application moves into Build Master and the programmer failed to include some items in the project on the migration.

    The automatic build from BuildMaster showed [Completed] and the log shows the TFS build completed, but looking at the Build Controller in TFS it is very clear that the build did not complete!

    The error in the TFS Build Controller is simply that a referenced DLL is missing on the Build Server, in this case OpenXML, because the developer failed to include it. Of course, the developer assumed it was working based on the Success in BuildMaster.

    Shouldn't this error carry across and fail the build/promotion?

    Image Text

    Image Text

    Product: BuildMaster
    Version: 4.8.4



  • Sorry, in the screenshot the 12:52 should probably be highlighted. The answer is still the same, the Build Controller failed and Buildmaster succeeded.



  • There are several ways to set-up a BuildMaster / TFS integration, and I'm not entirely sure from the screenshots how you have it set up.

    But, if you're importing a build or using the actions, then you can choose a specific build, the "last completed" or the "last successful". The "last completed" may not necessarily be successful; if you want that, choose "last successful".



  • Hello Alana,

    Automated Build

    It monitors the Source Path in TFS and creates an automatic Build in the Building environment.

    The only drop-down here is: Release Filter, which is set to Newest Active Release

    Deployments:

    Building
    -> Create TFS Build
    -> Create Artifact from TFS Build utput
    -> Deploy BuildArtifact
    -> Create Website Artifact
    -> Attach Artifact Comparison Report
    [Duplicate for Release Artifact]

    The other two Deployments are simply pushes to the Test and Prod servers depending on Artifact and cleans up the artifact release directory.

    The logging from Buildmaster states:
    Build number "152" created for definition "GeneralJournal - Testing".
    Waiting for build completion...
    TFS Build status reported: InProgress
    TFS Build status reported: InProgress
    TFS Build status reported: InProgress
    TFS Build status reported: InProgress
    TFS Build status reported: Completed
    Execution complete. Finalizing...

    The logging in TFS for this build states
    GeneralJournal - Testing_20150924.4 - Build Failed

    I'm not sure why BuildMaster did not detect this failure. If this is not enough information please let me know exactly what you need from me to assist.



  • Ah, I see, interesting use case.

    I assume you did "Wait For completion"?

    If so, can you look in the logs of the Create TFS BUILD action, to see where the wait for status is logged? What is the text of what's being logged? Do you see the failure reported there?

    https://github.com/Inedo/bmx-tfs/blob/master/Actions/CreateTfsBuildAction.cs#L64



  • Hello again,

    Yeah, the use is based on conversation with Inedo about deploying TFS web applications, you can see more for these specific builds here: Inedo Support 3638 - simplified as they do not include some of the other actions, but more or less how I am using it in this specific case.

    Wait for Completion is indeed checked, and advanced Execution options are all unchecked.

    The build status should have been in my last message, but here is a view:

    View of Build

    Build Log



  • I dug a tiny bit further than I probably should based on your GitHub link. Please let me know if this helps, I may be way off base.

    As you see the TFS Build Status is using Microsoft.TeamFoundation.Build.Client.QueueStatus Enumeration

    This refers to the Queue itself, the only available returns for this are:

    • All
    • Canceled
    • Completed
    • InProgress
    • None
    • Postponed
    • Queued
    • Retry

    Which are specifically related to the status of the Queue itself and not of the build IIRC. I may be wrong as this is not my area of expertise. In this code, should you instead wait for completion of the Queue and then GetBuild to return an IBuildDetail at which point you should check the CompilationStatus property returning a BuildPhaseStatus enumeration which has the following:

    • Failed
    • Succeeded
    • Unknown

    Or the Status property of IBuildDetail which pulls the overall status of the build and the various steps:

    • All
    • Failed
    • InProgress
    • None
    • NotStarted
    • PartiallySucceeded
    • Stopped
    • Succeeded


  • So I wanted to respond on here, I wasn't quite sure what to do with the information but I wanted to proceed. What I did was the following:

    1. Forked the GitHub repository
    2. Modified the TfsBuildActionEditor to have a Checkbox for [Validate Build Status]
    3. Modified the TfsBuildAction to use this and created a ValidateBuild function

    If the Check is selected it sends an error and pulls the Build Errors from the Build Details and displays them. I am not sure if this is something you wished to add so I did not submit a pull request. I could do so, but this can be considered answered.

    The whole point being that we didn't believe that "Create TFS Build" goal was met during a build failure, and there should be a way of validating that this actually did occur. If a build controller fails then a build was not created, or was partially created, and thus the Action needed to be able to reflect that.

    This also helps keep the CI running smoothly since it now becomes very apparent why a build broke and does not actually break test.

    Hope this helps anyone else who hits that! Consider this closed.



Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation