File tree Expand file tree Collapse file tree 2 files changed +54
-0
lines changed Expand file tree Collapse file tree 2 files changed +54
-0
lines changed Original file line number Diff line number Diff line change @@ -34,9 +34,14 @@ there are no such images published at the moment.
3434See https://pkg.go.dev/github.com/googleapis/librarian/cmd/librarian for
3535additional documentation.
3636
37+ ## Running Tests
38+
39+ See [ testing.md] for more information.
40+
3741## License
3842
3943Apache 2.0 - See [ LICENSE] for more information.
4044
4145[ contributing ] : CONTRIBUTING.md
4246[ license ] : LICENSE
47+ [ testing.md ] : doc/testing.md
Original file line number Diff line number Diff line change 1+ # Testing
2+
3+ ## Unit Tests
4+
5+ These tests are designed to test the internal librarian golang logic.
6+
7+ Usage:
8+
9+ ``` bash
10+ go test ./...
11+ ```
12+
13+ ## End-to-End (e2e) Tests
14+
15+ These tests are designed to test the CLI interface for each supported Librarian command
16+ on a local system. It tests the interface with docker using a fake repo and test docker
17+ image. These tests are run as presubmits and postsubmits via GitHub actions.
18+
19+ Setup:
20+
21+ ``` bash
22+ DOCKER_BUILDKIT=1 docker build \
23+ -f ./testdata/e2e-test.Dockerfile \
24+ -t test-image:latest \
25+ .
26+ ```
27+
28+ Usage:
29+
30+ ``` bash
31+ go test -tags e2e
32+ ```
33+
34+ ## Integration Tests
35+
36+ These tests are designed to test interactions with remote systems (e.g. GitHub). These
37+ tests are ** NOT** run automatically as they create pull requests and branches.
38+
39+ Usage:
40+
41+ ``` bash
42+ TEST_GITHUB_TOKEN=< a personal access token> \
43+ TEST_GITHUB_REPO=< URL of GitHub repo> \
44+ go test ./...
45+ ```
46+
47+ Note: ` TEST_GITHUB_TOKEN ` must have write access to ` TEST_GITHUB_REPO ` .
48+
49+ Note: These tests are skipped unless these environment variables are set.
You can’t perform that action at this time.
0 commit comments