Skip to content

Commit

Permalink
test: add test that checks new message addition are valid
Browse files Browse the repository at this point in the history
  • Loading branch information
eliax1996 committed Nov 8, 2023
1 parent 51df4b0 commit b763750
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions tests/integration/test_dependencies_compatibility_protobuf.py
Original file line number Diff line number Diff line change
Expand Up @@ -674,23 +674,23 @@ async def test_protobuf_customer_update_when_having_references(registry_async_cl

async def test_protobuf_schema_compatibility_full_path_renaming():
dependency = """\
package "my.awesome.customer.delivery";
package "my.awesome.customer.request";
message RequestId {
string request_id = 1;
}\
"""

original_full_path = """\
import "my/awesome/customer/delivery/v1beta1/request_id.proto";
import "my/awesome/customer/request/v1beta1/request_id.proto";
message MessageRequest {
my.awesome.customer.delivery.v1beta1.RequestId request_id = 1;
my.awesome.customer.request.v1beta1.RequestId request_id = 1;
}\
"""

evolved_partial_path = """\
import "my/awesome/customer/delivery/v1beta1/request_id.proto";
import "my/awesome/customer/request/v1beta1/request_id.proto";
message MessageRequest {
awesome.customer.delivery.v1beta1.RequestId request_id = 1;
awesome.customer.request.v1beta1.RequestId request_id = 1;
}\
"""

Expand All @@ -700,23 +700,23 @@ async def test_protobuf_schema_compatibility_full_path_renaming():

async def test_protobuf_schema_compatibility_partial_path_renaming():
dependency = """\
package "my.awesome.customer.delivery";
package "my.awesome.customer.request";
message RequestId {
string request_id = 1;
}\
"""

original_partial_path = """\
import "my/awesome/customer/delivery/v1beta1/request_id.proto";
import "my/awesome/customer/request/v1beta1/request_id.proto";
message MessageRequest {
my.awesome.customer.delivery.v1beta1.RequestId request_id = 1;
my.awesome.customer.request.v1beta1.RequestId request_id = 1;
}\
"""

evolved_full_path = """\
import "my/awesome/customer/delivery/v1beta1/request_id.proto";
import "my/awesome/customer/request/v1beta1/request_id.proto";
message MessageRequest {
awesome.customer.delivery.v1beta1.RequestId request_id = 1;
awesome.customer.request.v1beta1.RequestId request_id = 1;
}\
"""

Expand All @@ -726,34 +726,34 @@ async def test_protobuf_schema_compatibility_partial_path_renaming():

async def test_protobuf_schema_compatibility_import_renaming_should_fail():
dependency = """\
package "my.awesome.customer.delivery";
package "my.awesome.customer.request";
message RequestId {
string request_id = 1;
}\
"""

updated_dependency = """\
package "awesome.customer.delivery";
package "awesome.customer.request";
message RequestId {
string request_id = 1;
}\
"""

original_partial_path = """\
import "my/awesome/customer/delivery/v1beta1/request_id.proto";
import "awesome/customer/delivery/v1beta1/request_id.proto";
import "my/awesome/customer/request/v1beta1/request_id.proto";
import "awesome/customer/request/v1beta1/request_id.proto";
message MessageRequest {
awesome.customer.delivery.v1beta1.RequestId request_id = 1;
awesome.customer.request.v1beta1.RequestId request_id = 1;
}\
"""

evolved_partial_path = """\
import "awesome/customer/delivery/v1beta1/request_id.proto";
import "my/awesome/customer/delivery/v1beta1/request_id.proto";
import "awesome/customer/request/v1beta1/request_id.proto";
import "my/awesome/customer/request/v1beta1/request_id.proto";
message MessageRequest {
awesome.customer.delivery.v1beta1.RequestId request_id = 1;
awesome.customer.request.v1beta1.RequestId request_id = 1;
}\
"""

Expand Down

0 comments on commit b763750

Please sign in to comment.