Skip to content

Commit

Permalink
impl: move testdata
Browse files Browse the repository at this point in the history
Move all testdata to one location.
  • Loading branch information
julieqiu committed Nov 3, 2024
1 parent 382af5f commit 8e3cd93
Show file tree
Hide file tree
Showing 25 changed files with 18 additions and 1,205 deletions.
10 changes: 5 additions & 5 deletions generator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ go run ./devtools/cmd/generate -language=rust
Alternatively, you can run the protoc command directly:

```bash
go install github.com/googleapis/google-cloud-rust/generator/cmd/protoc-gen-gclient
protoc -I cmd/protoc-gen-gclient/testdata/smprotos \
-I /path/to/googleapis \
go install ./cmd/protoc-gen-gclient

protoc -I testdata/googleapis \
--gclient_out=. \
--gclient_opt=capture-input=true,language=rust \
cmd/protoc-gen-gclient/testdata/smprotos/resources.proto \
cmd/protoc-gen-gclient/testdata/smprotos/service.proto
testdata/googleapis/google/cloud/secretmanager/v1/resources.proto \
testdata/googleapis/google/cloud/secretmanager/v1/service.proto
```

or to playback an old input without the need for `protoc`:
Expand Down
8 changes: 7 additions & 1 deletion generator/cmd/openapi/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,13 @@ func TestMain(m *testing.M) {
}

func TestRun_Rust(t *testing.T) {
if err := run("testdata/secretmanager_openapi_v1.json", "rust", "testdata/rust/golden", "../../templates"); err != nil {
const (
inputPath = "../../testdata/openapi/secretmanager_openapi_v1.json"
language = "rust"
outDir = "../../testdata/rust/openapi/golden"
templateDir = "../../templates"
)
if err := run(inputPath, language, outDir, templateDir); err != nil {
t.Fatal(err)
}
}
2 changes: 1 addition & 1 deletion generator/cmd/protoc-gen-gclient/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func TestMain(m *testing.M) {
}

func TestRun_Rust(t *testing.T) {
if err := run("testdata/rust/rust.bin", "testdata/rust/golden", "../../templates"); err != nil {
if err := run("../../testdata/rust/gclient/rust.bin", "../../testdata/rust/gclient/golden", "../../templates"); err != nil {
t.Fatal(err)
}
}
97 changes: 0 additions & 97 deletions generator/cmd/protoc-gen-gclient/testdata/rust/golden/lib.rs

This file was deleted.

Loading

0 comments on commit 8e3cd93

Please sign in to comment.