pro icon indicating copy to clipboard operation
pro copied to clipboard

Module not found during test when requiring a module with no test

Open pacien opened this issue 6 years ago • 1 comments

Given a module a requiring a module b, with the former having a test but not the latter, tests ran by the tester plugin fail with a java.lang.module.FindException: Module b not found, required by a.

A workaround for this is to create an empty test module for b in such a way that the target "exploded" and "merged" test folders are properly generated.

Non-working tree:

├── build.pro
├── src
│   ├── main
│   │   └── java
│   │       ├── a
│   │       │   └── module-info.java
│   │       └── b
│   │           └── module-info.java
│   └── test
│       └── java
│           └── a
│               └── module-info.java
└── target
    ├── main
    │   └── exploded
    │       ├── a
    │       │   └── module-info.class
    │       └── b
    │           └── module-info.class
    └── test
        ├── exploded
        │   └── a
        │       └── module-info.class
        └── merged
            └── a
                └── module-info.java

Working tree:

├── build.pro
├── src
│   ├── main
│   │   └── java
│   │       ├── a
│   │       │   └── module-info.java
│   │       └── b
│   │           └── module-info.java
│   └── test
│       └── java
│           ├── a
│           │   └── module-info.java
│           └── b
│               └── module-info.java
└── target
    ├── main
    │   └── exploded
    │       ├── a
    │       │   └── module-info.class
    │       └── b
    │           └── module-info.class
    └── test
        ├── exploded
        │   ├── a
        │   │   └── module-info.class
        │   └── b
        │       └── module-info.class
        └── merged
            ├── a
            │   └── module-info.java
            └── b
                └── module-info.java

pacien avatar Oct 13 '18 01:10 pacien

Seen to be a bug when we analyze the module graph from merged, the source module should be used as a backup (the one from main/java)

forax avatar Oct 13 '18 09:10 forax