bazelbuild / rules_groovy

Groovy rules for Bazel
Apache License 2.0
11 stars 28 forks source link

groovy_test sources must be under src/test/java or src/test/groovy #51

Open ruinshe opened 4 years ago

ruinshe commented 4 years ago

I met this error message when I add a target without in src/test/groovy folder, because of I may have another folder named src/integration/groovy or even groovytests folder.

I think it may be a too strict constraint for a common language build rule, at least support modifying the groovy source root for the groovy_test targets may help.

My project structure:

.
├── BUILD.bazel
├── WORKSPACE.bazel
└── src
    ├── integration
    │   └── groovy
    │       └── ...
    ├── main
    │   └── kotlin
    │       └── ...
    └── test
        └── groovy
            └── ...
btbuxton commented 4 years ago

I ran into this issue as well. It also requires the src/main/groovy and src/test/groovy under the same directory as WORKSPACE. This doesn't work for monorepos with multiple projects. For example, if I my groovy project is in another project directory with its BUILD file, it complains with a failure.

.
|-- WORKSPACE.bazel
|-- project1
      |-- src/main/groovy
      |-- src/test/groovy

This directory structure is not allowed.

leigh-johnson commented 3 years ago

👋 I'm running into this issue in a monorepo for shared Jenkins libraries as well. My desired directory structure for ref:

├── src
│   └── com
│       └── companyName
│           └── packageName
│               ├── lib
│               └── model
├── test
│   └── com
│       └── companyName
│           └── packageName
│               ├── fixtures
│               └── groovy
│                   ├── specs
│                   └── testSupport
└── vars

Happy to send a patch supporting the cases described in this issue. @ekuefler @nlopezgi @philwo Would one of y'all be available to review, or can you route me to a Bazel test/infra PM? Thank you!

spoorvi commented 1 year ago

I am facing this issue as well, my project structure is as follows, is there any update on this issue ?

|-- WORKSPACE.bazel |-- project1 |--BUILD |-- src/main/java |-- src/test/groovy