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

sed: /go/src/grpc/file_2.pb.go: No such file or directory #81

Open
sonalibishwas opened this issue Jul 12, 2021 · 4 comments
Open

sed: /go/src/grpc/file_2.pb.go: No such file or directory #81

sonalibishwas opened this issue Jul 12, 2021 · 4 comments

Comments

@sonalibishwas
Copy link

We use gripmock with multiple package import in our project's integration tests.

We had two proto files under v1_0_0 folder -
file_1.proto and file_2.proto
and this is how we were using to bring up gripmock

gripmock --stub=/drone/src/integration-tests/docker-mock/gripmock/mappings --imports=/proto /proto/v1_0_0/file_1.proto /proto/v1_0_0/file_2.proto

It use to work fine until we have a change in our proto folder structure -
file_1.proto went under v1_1_0 folder

v1_1_0/file_1.proto

and file_2 is under v1_0_0 folder
v1_0_0/file_2.proto

So, we changed the gripmock statement to following -
gripmock --stub=/drone/src/integration-tests/docker-mock/gripmock/mappings --imports=/proto /proto/v1_1_0/file_1.proto /proto/v1_0_0/file_2.proto

Since then we are unable to bring up gripmock docker container and it throws following error -

cp -r /drone/src/components/xyz/idl/abc/protobuf/grpc/* /proto

  • mkdir /stub
  • cp -r /drone/src/integration-tests/docker-mock/gripmock/mappings/* /stub
  • gripmock --stub=/drone/src/integration-tests/docker-mock/gripmock/mappings --imports=/proto /proto/v1_1_0/file_1.proto /proto/v1_0_0/file_2.proto
    Starting GripMock
    Serving stub admin on http://:4771
    2021/07/09 20:41:29 WARNING: Missing 'go_package' option in "file_1.proto",
    please specify it with the full Go package path as
    a future release of protoc-gen-go will require this be specified.
    See https://developers.google.com/protocol-buffers/docs/reference/go-generated#package for more information.

2021/07/09 20:41:29 WARNING: Missing 'go_package' option in "v1_0_0/file_2.proto",
please specify it with the full Go package path as
a future release of protoc-gen-go will require this be specified.
See https://developers.google.com/protocol-buffers/docs/reference/go-generated#package for more information.

WARNING: Package "github.com/golang/protobuf/protoc-gen-go/generator" is deprecated.
A future release of golang/protobuf will delete this package,
which has long been excluded from the compatibility promise.

sed: /go/src/grpc/file_2.pb.go: No such file or directory
2021/07/09 20:41:29 Fail on sed

This is how our complete gripmock docker container definition looks like -

  • name: abc_service_gripmock
    image: tkpd/gripmock:latest
    commands:
    - cp -r /drone/src/components/xyz/idl/abc/protobuf/grpc/* /proto
    - mkdir /stub
    - cp -r /drone/src/integration-tests/docker-mock/gripmock/mappings/* /stub
    - gripmock --stub=/drone/src/integration-tests/docker-mock/gripmock/mappings --imports=/proto /proto/v1_1_0/file_1.proto /proto/v1_0_0/file_2.proto

Why is it trying to find a go package? We never had auto generated go packages in our project before folder structure change as well and it was working fine.
Could you please help?

@jekiapp
Copy link
Contributor

jekiapp commented Jul 28, 2021

I see the issue is not related with the gripmock, instead the way you define your .proto file. It explicitly said Missing 'go_package' option in "file_1.proto".

You probably found inspiration from this example file . It define the go_package option.
since the frist scenario, both .proto files placed under the same folder thus it detected as the same package, then the second scenario you put it in another folder.

@sonalibishwas
Copy link
Author

sonalibishwas commented Jul 28, 2021 via email

@jekiapp
Copy link
Contributor

jekiapp commented Jul 28, 2021 via email

@jekiapp
Copy link
Contributor

jekiapp commented Aug 2, 2021

it actually related with #65

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants