-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cli): improving relative file detection for protobuf (#3091)
* fix(cli): improving relative file detection for protobuf * Update tests and validation * fixing typo * Fixed e2e test * Update test * Fixing test file
- Loading branch information
1 parent
cd6fb6d
commit 4fd1c42
Showing
5 changed files
with
157 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
testing/cli-e2etest/testscenarios/test/resources/api-with-comment.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// This is a comment | ||
syntax = "proto3"; | ||
|
||
option java_multiple_files = true; | ||
option java_outer_classname = "PokeshopProto"; | ||
option objc_class_prefix = "PKS"; | ||
|
||
package pokeshop; | ||
|
||
service Pokeshop { | ||
rpc getPokemonList (GetPokemonRequest) returns (GetPokemonListResponse) {} | ||
rpc createPokemon (Pokemon) returns (Pokemon) {} | ||
rpc importPokemon (ImportPokemonRequest) returns (ImportPokemonRequest) {} | ||
} | ||
|
||
message ImportPokemonRequest { | ||
int32 id = 1; | ||
optional bool isFixed = 2; | ||
} | ||
|
||
message GetPokemonRequest { | ||
optional int32 skip = 1; | ||
optional int32 take = 2; | ||
optional bool isFixed = 3; | ||
} | ||
|
||
message GetPokemonListResponse { | ||
repeated Pokemon items = 1; | ||
int32 totalCount = 2; | ||
} | ||
|
||
message Pokemon { | ||
optional int32 id = 1; | ||
string name = 2; | ||
string type = 3; | ||
bool isFeatured = 4; | ||
optional string imageUrl = 5; | ||
} |
60 changes: 60 additions & 0 deletions
60
...cli-e2etest/testscenarios/test/resources/grpc-trigger-embedded-protobuf-with-comment.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
type: Test | ||
spec: | ||
id: create-pokemon-embedded | ||
name: "Create Pokemon" | ||
description: Create a single pokemon on Pokeshop | ||
trigger: | ||
type: grpc | ||
grpc: | ||
protobufFile: | | ||
// This is a comment | ||
syntax = "proto3"; | ||
option java_multiple_files = true; | ||
option java_outer_classname = "PokeshopProto"; | ||
option objc_class_prefix = "PKS"; | ||
package pokeshop; | ||
service Pokeshop { | ||
rpc getPokemonList (GetPokemonRequest) returns (GetPokemonListResponse) {} | ||
rpc createPokemon (Pokemon) returns (Pokemon) {} | ||
rpc importPokemon (ImportPokemonRequest) returns (ImportPokemonRequest) {} | ||
} | ||
message ImportPokemonRequest { | ||
int32 id = 1; | ||
optional bool isFixed = 2; | ||
} | ||
message GetPokemonRequest { | ||
optional int32 skip = 1; | ||
optional int32 take = 2; | ||
optional bool isFixed = 3; | ||
} | ||
message GetPokemonListResponse { | ||
repeated Pokemon items = 1; | ||
int32 totalCount = 2; | ||
} | ||
message Pokemon { | ||
optional int32 id = 1; | ||
string name = 2; | ||
string type = 3; | ||
bool isFeatured = 4; | ||
optional string imageUrl = 5; | ||
} | ||
address: demo-rpc:8082 | ||
method: pokeshop.Pokeshop.createPokemon | ||
request: |- | ||
{ | ||
"name": "Pikachu", | ||
"type": "eletric", | ||
"isFeatured": true | ||
} | ||
specs: | ||
- name: It calls Pokeshop correctly | ||
selector: span[tracetest.span.type="rpc" name="pokeshop.Pokeshop/createPokemon" rpc.system="grpc" rpc.method="createPokemon" rpc.service="pokeshop.Pokeshop"] | ||
assertions: | ||
- attr:rpc.grpc.status_code = 0 |