Coder Social home page Coder Social logo

gradle-runner-junit5-kotlin's Introduction

Update

Turned out that we were excluding the wrong module. ChangingspringBootTest.exclude(mapOf("group" to "junit", "module" to "junit")) to springBootTest.exclude(mapOf("group" to "junit", "module" to "org.junit.vintage")) fixed the problem.

gradle-runner-junit5-kotlin

Since we tried to update our Gradle plugin to use Gradle 6.4 some tests that assert JUnit 5 is working have started failing.

The problem appears to be that when using the Gradle Runner to build and run a project in a test, it somehow picks junit-vintage as the test engine even though it's been excluded from the project. It can't find junit-vintage, so it falls over.

This project is a minimal implementation to demonstrate the problem.

To reproduce:

  • Check out the project and run ./gradlew test

To workaround the problem:

  • Switch to Gradle 6.3 with command ./gradlew wrapper --gradle-version 6.3
  • Run command ./gradlew test
  • (No idea why this works)

An alternative workaround:

  • Switch back to Gradle 6.4!
  • In function MyPlugin#addDependencies, comment out line springBootTest.exclude(mapOf("group" to "junit", "module" to "junit"))
  • Run command ./gradlew test
  • (The test now works because with junit 4 back on the classpath the wrongly chosen engine is now available)

gradle-runner-junit5-kotlin's People

Contributors

mikehalmamoj avatar

Watchers

 avatar

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.