Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shouldn't it rather be failOnPassedOrSkippedAfterRetry? #130

Open
ivans083 opened this issue Apr 12, 2022 · 2 comments
Open

Shouldn't it rather be failOnPassedOrSkippedAfterRetry? #130

ivans083 opened this issue Apr 12, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@ivans083
Copy link

If a test is set to be skipped on it's body if certain condition meets, a retried test that is later skipped will fail the build even if failOnPassedAfterRetry = false.
We could either fix and call it failOnPassedOrSkippedAfterRetry
Or add failOnSkippedAfterRetry option in configuration

@buitcj
Copy link

buitcj commented Aug 17, 2023

I also would love this

@pshevche
Copy link
Member

pshevche commented Apr 2, 2024

@ivans083 , @buitcj , if this is still relevant, could you please describe your use case better (maybe give us an example of such a volatile precondition)? From my point of view, failing the build in this case makes sense since there are failing tests that did not succeed. I'd also expect the condition to have a stable value and skip the test on every run.

For future reference, this could be used as a reproducer:

package org.example;

import org.junit.jupiter.api.Test;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;

import static org.junit.jupiter.api.Assertions.fail;
import static org.junit.jupiter.api.Assumptions.assumeFalse;

class LibraryTest {
    private static final Path MARKER = Paths.get("build/flag");

    @Test
    void someLibraryMethodReturnsTrue() throws IOException {
        assumeFalse(Files.exists(MARKER));

        Files.createFile(MARKER);
        fail("test goes boom!");
    }
}

@pshevche pshevche added the enhancement New feature or request label Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants