vendredi 20 mars 2020

Spock ignore test if a "setup test" fail

I'm writing a kind of integration test. I need to test if the tested environments are actually running.

pseudocode:

def "setup test"() {
    expect:
    service1.isRunning()
    service2.isRunning()
}

def "test1"() {
    expect:
    service1.something() == 1
    service2.something() == 2
}

def "test2"() {
    // ...
}

Basically, I don't even want to see the results of "test1" and "test2" if the "setup test" fails (They will surely fail too!). How can I achieve this? I've tried @IgnoreIf, but it seems to be a solution only for conditions that we can provide from outside of the test.

Aucun commentaire:

Enregistrer un commentaire