Skip to content

Commit 8a9a719

Browse files
chore: Update GEMINI.md with test guides (#4160)
Per recent experience, add more examples and guides for testing. Also add guides for creating PRs. --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent 67a2ecb commit 8a9a719

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

GEMINI.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ mvn fmt:format
6565

6666
The repository employs a multi-layered testing strategy to ensure the quality and correctness of the generated code:
6767

68-
* **Unit Tests:** Traditional unit tests for individual classes and methods.
69-
* **Golden Unit Tests:** These tests generate code from test protos and compare the output to "golden" files, which are pre-approved versions of the generated code. These test cases exist inside the `gapic-generator-java` module.
68+
* **Unit Tests:** Traditional unit tests for individual classes and methods. See [unit testing best practices](https://engdoc.corp.google.com/eng/doc/devguide/testing/unit/best-practices.md?cl=head&polyglot=java).
69+
* **Golden Unit Tests:** These tests generate code from test protos and compare the output to "golden" files, which are pre-approved versions of the generated code. These test cases exist inside the `gapic-generator-java` module. See [GrpcServiceStubClassComposerTest](https://github.com/googleapis/sdk-platform-java/blob/main/gapic-generator-java/src/test/java/com/google/api/generator/gapic/composer/grpc/GrpcServiceStubClassComposerTest.java) for an example of golden unit tests. The steps for golden unit tests include creating a test proto, loading the test proto, generating from the test proto, and comparing the result with a golden file.
7070
* **Showcase Integration Tests:** These tests run the generated Showcase client against a local Showcase server to verify end-to-end functionality. This is the preferred way of testing integration tests.
7171
* **Golden Integration Tests:** These tests generate full client libraries for real Google Cloud APIs and compare them to golden versions. This is an older test strategy and showcase testing is preferred.
7272

@@ -144,6 +144,6 @@ Showcase integration tests are run against a local server that implements the Sh
144144
specification. The format is `<type>: <description>`. The type should be one of the following: fix, feat,
145145
build, chore, docs, test, or refactor.
146146
- **Issues:** All significant changes should start with a GitHub issue.
147-
- **Pull Requests:** All code changes must be submitted via a pull request and require review.
147+
- **Pull Requests:** All code changes must be submitted via a pull request and require review. Before creating a PR, always pull latest from main, merge main to local branch and resolve any conflicts.
148148
- **Testing:** All new logic should be accompanied by tests.
149149
- For more details, see `CONTRIBUTING.md`.

0 commit comments

Comments
 (0)