Skip to content

Transpiling wrongly includes standard library tests in user's program test execution #5269

Description

@volodya-lombrozo

Running eoc test also executes tests from the EO standard library (string, while, tuple, seq, ss.list, etc.), not just tests belonging to the user's own EO programs.

Root cause

Transpiling.javaGenerated calls JavaPlaced.exec(clazz, transpileTests) for every XMIR object returned by scopedTojos().withXmir(), which includes both the user's own programs and all objects pulled from the EO runtime into .eoc/2-pull/. When a pulled object contains +tests methods, JavaPlaced.placeJavaTests writes a *Test.java into .eoc/generated-test-sources, which Maven Surefire then picks up and runs.

The eo-foreign.json catalog already distinguishes pulled objects from the user's own via the discovered-at attribute. TjsForeign.dependencies() also identifies them as objects with a version but no jar.

Steps to reproduce

  1. Clone eo3-programs.
  2. Run make.
  3. Observe that org.eolang.EOstringTest, org.eolang.EOwhileTest, org.eolang.EOtupleTest, and ~30 more EO runtime test classes are compiled and executed.

Expected behaviour

Only tests for the user's own EO objects should be compiled and executed.

Relevant classes to investigate: Transpiling.java (javaGenerated, ~line 333), JavaPlaced.java (placeJavaTests), TjsForeign.java (withXmir() vs dependencies()).

Metadata

Metadata

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions