junit5-contingent

Allows for JUnit 5 tests to be contingent on the success of other tests

Лицензия

Лицензия

Категории

Категории

JUnit Тестирование компонентов ORM Данные
Группа

Группа

com.bnorm.junit5.contingent
Идентификатор

Идентификатор

junit5-contingent
Последняя версия

Последняя версия

0.1.0
Дата

Дата

Тип

Тип

pom.sha512
Описание

Описание

junit5-contingent
Allows for JUnit 5 tests to be contingent on the success of other tests
Ссылка на сайт

Ссылка на сайт

https://github.com/bnorm/junit5-contingent
Система контроля версий

Система контроля версий

https://github.com/bnorm/junit5-contingent

Скачать junit5-contingent

Зависимости

runtime (2)

Идентификатор библиотеки Тип Версия
org.jetbrains.kotlin : kotlin-stdlib-jdk8 jar 1.3.72
org.junit.jupiter : junit-jupiter-api jar 5.6.2

Модули Проекта

Данный проект не имеет модулей.

junit5-contingent

Maven Central

Allows for JUnit 5 tests to be contingent on the success of other tests.

Why?

Unit tests can fail for all sorts of reasons. Sometimes a multitude of failures can hide the unit test failures which expose the actual bug. If unit tests, which implicitly depended on functionality tested by other unit tests, failed early with a clear message what implicit dependency failed, then it could be easier pinpoint the actual problem. That's the problem this library is attempting to solve.

Also, I wanted to see if it could be done using JUnit 5 extensions. Yeah, mainly this reason.

Example

In the following example, tests required1 and required2 will be executed first. If none of them fail, then tests dependent1 and dependent2 will be allowed to run.

@ContingentExtension
class ContingentTests {
    @Test @Tag("required")
    public void required1() {}

    @Test @Tag("required")
    public void required2() {}

    @Test @Contingent("required")
    public void dependent1() {}

    @Test @Contingent("required")
    public void dependent2() {}
}

What's Next?

  • API: I'm not happy with the use of Tags to mark required tests. I don't like having to match raw strings for creating this link. The whole API layer could be greatly improved.

  • Cross-Class Linking: Right now unit tests are only linked if they exist in the same class. It would be great if they could be linked for all discovered unit tests.

Версии библиотеки

Версия
0.1.0