Code Monkey home page Code Monkey logo

sweet-junit-runner's People

Contributors

codepfleger avatar dependabot[bot] avatar ehmkah avatar jlupi avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

baso10

sweet-junit-runner's Issues

Conditional test execution

Motivation

IntegrationTest maintenance is difficult, because they depend on the systems they integrate.

Failures of the system that is integrated causes IntegrationTests to fail. This becomes an issue if there are dozens of tests in the project that depend on multiple systems, because each failing Tests must be checked if the failure is caused by the integrated system, or if there was a bug introduced in the previous day.

To solve this problem it should be possible to define a Condition that will be executed before any test is started.
The test that has a Condition defined will be executed only if the Condition execution was successful.
If the condition fails the user should be notified about that (a separate ConditionTest would be failing).

Only classes annotated with '@IntegrationTEST' can define one or more Conditions.

Implementation proposal

@IntegrationTest(conditions = {DatabaseCondition.class, SubsystemCondition.class})
public BookingServiceIntegrationTest {
   ...
}
@IntegrationTest(SubsystemCondition.class)
public PaymentServiceIntegrationTest {
   ...
}

public class DatabaseCondition implements Condition {
 ...
}

public class SubsystemCondition implements Condition {
 ...
}

public interface Condition {
    Status checkCondition();
}

If the DatabaseCondition fails then

  • BookingServiceIntegrationTest will not be executed
  • PaymentServiceIntegrationTest will be executed
  • ConditionTest will fail with the explanation and list of tests that were excluded.

If the SubsystemCondition fails then

  • BookingServiceIntegrationTest will not be executed
  • PaymentServiceIntegrationTest will not be executed
  • ConditionTest will fail with the explanation and list of tests that were excluded.

Loading/excluding test classes based on naming pattern

At the moment sweet junit runner loads annotated with '@IntegrationTEST' or '@suitetest'.

It should be also possible to load or exclude classes based on a naming pattern, for example:

  • *IntegrationTest -> all classes ending with IntegrationTest
  • *Test -> all classes ending with Test
  • org.package.*Test -> all classes ending with with Test from package org.package
  • org.package.**Test -> all classes ending with Test located in package or subpackages of org.package

There should be a mechanism that checks if a loaded class is a JUnit Test class.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.