bazel-contrib / bazel-contrib/rules_jvm

Gazelle: Have way to turn off the `java_binary` generation in the java tests area

Open
#377 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
54
Forks
98
Avg merge
6d 2h
Merged PRs (30d)
7

Description

This is an odd edge case from a client using a great number of GRPC services, and then trying to write tests around them. The general form of the test is:

```java

public class ApplicationTest {

@Test
public void testLifecycle() throws Exception {
final TestApplication application = new TestApplication();
application.start();
application.stop();
// Test using application here.
}

public static class TestApplication extends RealApplication {
public static void main(String[] args) throws Exception {
main(TestApplication.class, args);
}
}
}
````

When run through gazelle, it generates both a `java_test_suite` for the `ApplicationTest` and a `java_binary` for the `ApplicationTest.TestApplication`. I would like to be able to turn off the latter.

Contributor guide

Open the contributing guide

Research direction

The issue names no source file or test. Start by tracing Gazelle's Java test generation for nested classes and how java_binary targets are selected; done means providing a way to suppress the generated ApplicationTest.TestApplication binary while retaining the java_test_suite.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.