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

docs: Specify test running prerequisites in CONTRIBUTING.md #244

Merged
merged 3 commits into from
Apr 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 9 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ This library is generated from the protobuf source in [googleapis/google-cloudev

The `google-cloudevents-types/` directory is the generated library source code. It should not be manually modified as changes will be overwritten.

The `protoc-gen-java-snowpea/` directory defines a protoc plugin to generate tests for the library.
The `protoc-gen-java-snowpea/` directory defines a protoc plugin to generate tests for the library. Check out it's [README](protoc-gen-java-snowpea/) to learn more.

the `tools/` directory contains scripts for building the library.

Expand All @@ -43,7 +43,7 @@ the `tools/` directory contains scripts for building the library.

* (Optional) set path to `protoc` executable: `export PROTOC_PATH=<LOCAL_PATH/bin/protoc>`

* Clone the [google-cloudevents](https://github.com/googleapis/google-cloudevents) source of truth repo in the same directory as this repo.
* Clone the [google-cloudevents](https://github.com/googleapis/google-cloudevents) source of truth repo in the same parent directory as this repo.

* Set local path to `google-cloudevents`: `export DATA_SOURCE_PATH=<LOCAL_PATH/google-cloudevents>`

Expand All @@ -57,7 +57,13 @@ To build, package, and run all unit tests run the command

### Running tests

Tests are ran during the project build. To run tests independently:
Tests are run during the project build. To run tests independently:

1. Clone the [google-cloudevents](https://github.com/googleapis/google-cloudevents) source of truth repo in the same parent directory as this repo. Payload test cases are centrally maintained.

2. Optional: Set path to `google-cloudevents` for test case lookup: `export TEST_DATA_PATH=<LOCAL_PATH/google-cloudevents>`. If not set, tests will seek the cloned repository at the path `../../google-cloudevents/testdata/`. (To run tests with this default, change working directory to `tools/` or `google-cloudevent-types/`)

4. Run the tests:

```sh
mvn clean verify
Expand Down