Skip to content

Discover tests in suites packaged into jars, e.g. TCKs #2594

@t1

Description

@t1

As discussed in the discussions, we need a way to package a test suite into a jar and run it for several implementations. This is a common requirement when building Technology Compatibility Kits. There are generally three artifacts:

  1. api contains some interfaces and a ServiceLoader (or similar IoC mechanism) to load an implementation of the api interfaces.
  2. impl1 containing one implementation (sometimes called a reference implementation ri) of the api; includes the services files for the ServiceLoader.
  3. tck the test suite to check that an implementation of the api is compliant.

You can run the tests in the tck by adding a runtime dependency on impl1. But the tck should be usable by any other implementation as well: I want the impl1 to load the tck-jar and run it, not the other way around. The tck should be a library of tests that the implementations can include as a test dependency. The dependency should be impl1→tck not tck→impl1.

I assume that scanning all jars for tests would result in unacceptable performance, so we probably need some way to specify the jars to scan, or even better to mark a jar to be a test-suite.

I currently need this for an open source project: https://github.com/t1/smallrye-graphql It's about the TCK in the client. But I've also built a minimal, reproducible example that may be easier to play around with: https://github.com/t1/junit-tck-mre.

Deliverables

  • A mechanism to specify the jars to scan for tests
  • Update to the User Manual

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions