Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ruinshe opened this issue Dec 30, 2019 · 3 comments
Open

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

ruinshe opened this issue Dec 30, 2019 · 3 comments

Comments

@ruinshe
Copy link

ruinshe commented Dec 30, 2019

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
Copy link

btbuxton commented Apr 2, 2020

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.

dtee added a commit to dtee/rules_groovy that referenced this issue Aug 26, 2020
dtee added a commit to dtee/rules_groovy that referenced this issue Aug 27, 2020
dtee added a commit to dtee/rules_groovy that referenced this issue Aug 27, 2020
dtee added a commit to dtee/rules_groovy that referenced this issue Aug 28, 2020
@leigh-johnson
Copy link

👋 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
Copy link

spoorvi commented Jan 13, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants