How to allow build to continue running, even if one of the test_script stmt is failing?

TJ's Avatar

TJ

17 Apr, 2019 11:54 AM

Appveyor.yml has following code :

test_script:
- npm run project1
- npm run project2
- npm run project3

current issue is if project1 is failing full build will fail and it will not continue executing project2 and project3,But I want build to continue evenif project1 fails and want to see the status for other 2 as well, if project2 fails it should not stop it should continue till project3 and after that the build process should stop with the failed result.

  1. Support Staff 1 Posted by Owen McDonnell on 17 Apr, 2019 01:27 PM

    Owen McDonnell's Avatar

    Sounds like you need to separate your build into jobs via a build matrix.

    We can give guidance if necessary, but post full yaml if thats the case.

  2. 2 Posted by Tejal Tanna on 17 Apr, 2019 02:20 PM

    Tejal Tanna's Avatar

    can i give conditions [if - else], instead of job matrix ?

  3. Support Staff 3 Posted by Ilya Finkelshte... on 17 Apr, 2019 05:21 PM

    Ilya Finkelshteyn's Avatar

    Try to wrap it into PowerShell script like this:

    $success = $true
    
    cmd /c npm run project1
    if (-not $?) {$success = $?}
    
    cmd /c npm run project2
    if (-not $?) {$success = $?}
    
    cmd /c npm run project3
    if (-not $?) {$success = $?}
    
    if (-not $success) {throw "at least one step failed"}
    

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac