Giter Site home page Giter Site logo

experimental-bazel-testrunner-issue's Introduction

Classpath Issue w/ bazel --experimental_testrunner

This repo illustrates a possible issue w/ the bazel experimental test runner.

ParameterizedTest.java uses the Parameterized runner, which creates a new instance of the test class with different parameters for each result returned from a method annotated with @Parameters. The Parameterized runner works with both JUnit 4.11 and 4.12, but appears to have gotten more flexible in 4.12 -- allowed @Parameters method APIs were extended to allow Object[][] in addition to Iterable<Object[]>. (sources: JUnit 4.11, JUnit 4.12)

The experimental test runner appears, based on code and comments, to be trying to isolate the tests from the bazel runner by creating a separate classloader, but the it seems like classloader being created still depends on the system classloader as its parent, and so JUnit from the system classloader is resolved from the tests as well.

Examples:

Run the regular test runner:

./regular.sh

You'll see in the output that the system classloader and the classloaders used by all the classes in the test's list are the same.

Run the experimental test runner:

./experimental.sh

and you'll see in the output that the JUnit classes resolved from ParameterizedTest were loaded by the system classloader, but the test class itself was resolved from the URLClassLoader set up in the experimental runner.

experimental-bazel-testrunner-issue's People

Contributors

roblg avatar

Watchers

 avatar  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.