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

[Bug]: workflow test fails due to import in .proto file #223

Open
1 task
nico-i opened this issue May 29, 2024 · 2 comments · May be fixed by stepci/runner#125 or stepci/cool-grpc#14
Open
1 task

[Bug]: workflow test fails due to import in .proto file #223

nico-i opened this issue May 29, 2024 · 2 comments · May be fixed by stepci/runner#125 or stepci/cool-grpc#14
Labels
bug Something isn't working

Comments

@nico-i
Copy link

nico-i commented May 29, 2024

What happened?

Workflows fail due to unresolved imports.

What did you expect to happen?

To have a documentation guide on how to handle imports or for imports to be automatically resolved.

Version

2.8.1

Environment

Node v20.11.0

How can we reproduce this bug?

Example proto file:

syntax = "proto3";

package caption_service.v1;

import "google/api/annotations.proto";
import "messages/image_dto/v1/image_dto.proto";

// Request to get caption for an image
message GetCaptionRequest {
	shared.messages.image_dto.v1.ImageDto image = 1;
}

// Response containing caption for an image
message GetCaptionResponse {
    string caption = 1;
}

// Service to handle all image captioning operations
service CaptionService {
    // Get caption for an image
	rpc get_caption(GetCaptionRequest) returns (GetCaptionResponse) {
		option (google.api.http) = {
			post: "/v1/caption"
			body: "*"
		};
	}
}

Example workflow file:

version: "1.1"
name: Caption workflow
env:
  host: localhost:9091
tests:
  caption:
    name: Get caption of test image
    steps:
      - name: Get caption
        grpc:
          proto:
            - ../../shared/proto/services/caption_service/v1/caption_service.proto
          host: ${{env.host}}
          service: caption_service.v1.CaptionService
          method: get_caption
          data:
            image:
              path: "test/img.jpg"

I use buf for code gen and dep management. This is my buf.yaml, which also specifies the base path for all proto files:

version: v2
modules:
  - path: shared/proto
lint:
  use:
    - DEFAULT
breaking:
  use:
    - FILE
deps:
  - buf.build/googleapis/googleapis

Relevant log output

Error message when running stepci run workflow.yaml

 FAIL  Get caption of test image ⏲ 0.003s ⬆ 0 bytes ⬇ 0 bytes

Summary

  ✕ Get caption of test image failed after 0.003s

⚠︎ caption › Get caption of test image

ENOENT: no such file or directory, open 'shared/proto/services/caption_service/v1/google/api/annotations.proto'

Would you be interested in working on a bugfix for this issue?

  • Yes! Assign me
@nico-i nico-i added the bug Something isn't working label May 29, 2024
@mishushakov
Copy link
Member

Are you on windows by chance?

@nico-i
Copy link
Author

nico-i commented Jul 29, 2024

Are you on windows by chance?

No, MacOS Sonoma (14.5 (23F79)).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants