Skip to content

convert partests that only need the reference compiler to be run by JUnit instead #295

Closed
@SethTisue

Description

@SethTisue

currently our suite of partests is just a big bag of tests, some of which are only testing the standard library and don't need to be compiled with a freshly built compiler.

segregating library tests from compiler tests would be a win, all by itself, for organization, modularity, and maintainability.

but if we went on and changed the library tests to run without any involvement from partest at all, but by JUnit instead, there would be a number of further benefits:

  • the tests would run faster — the aggregate effect could make PR validation noticeably faster
  • the sources for these tests would become normal test sources in the sbt project and get various benefits from this such as all being compiled together in a warm compiler+JVM
  • the test names would become tab-completable in sbt and individually runnable in JUnit-aware IDEs
  • contributors would have less need to learn weird partest arcana (there is a lot to learn about how to run partests, how to write them, how to interpret failures, etc)

of course we already know about these benefits and that's why we prefer to write new tests in JUnit. but hand-translating existing partests to JUnit, one at a time, is too much work, so it doesn't happen that often.

we can minimize the changes needed to existing partests by writing a (hopefully fairly small) amount of new JUnit-based code to duplicate partest's .check file functionality. hopefully, then, moving a test out of partest will only require small hand changes such as:

  • adding a package declaration at the top
  • giving the test a unique name
  • perhaps adding the test to an (automatically updated?) registry so its existence wouldn't need to be discovered dynamically (apparently the Dotty folks have something like this?)

if it were that easy, getting large numbers of tests out of partest's clutches would actually become doable.

@vpetro wrote wip code for this today at a Lightbend engineering retreat, with help from @dwijnand and myself; we aim to produce at least a WIP PR on this soon.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions