Skip to content

Commit

Permalink
e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangjinwu committed Nov 12, 2023
1 parent 46dab0f commit ee192ad
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 11 deletions.
5 changes: 5 additions & 0 deletions ci/scripts/e2e-source-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ RUST_LOG="info,risingwave_stream=info,risingwave_batch=info,risingwave_storage=i
cargo make ci-start ci-1cn-1fe
python3 -m pip install requests protobuf confluent-kafka
python3 e2e_test/schema_registry/pb.py "message_queue:29092" "http://message_queue:8081" "sr_pb_test" 20
curl 'http://message_queue:8081/subjects'
curl 'http://message_queue:8081/subjects/google%2Fprotobuf%2Fsource_context.proto/versions'
curl --head 'http://message_queue:8081/subjects/google%2Fprotobuf%2Fsource_context.proto/versions'
curl --silent --head 'http://message_queue:8081/subjects/google%2Fprotobuf%2Fsource_context.proto/versions'
curl --silent --head 'http://message_queue:8081/subjects/google%2Fprotobuf%2Fsource_context.proto/versions' | grep 404
sqllogictest -p 4566 -d dev './e2e_test/schema_registry/pb.slt'

echo "--- Kill cluster"
Expand Down
2 changes: 2 additions & 0 deletions e2e_test/schema_registry/pb.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from protobuf import user_pb2
from google.protobuf.source_context_pb2 import SourceContext
import sys
from confluent_kafka import Producer
from confluent_kafka.serialization import (
Expand All @@ -21,6 +22,7 @@ def get_user(i):
address="Address_{}".format(i),
city="City_{}".format(i),
gender=user_pb2.MALE if i % 2 == 0 else user_pb2.FEMALE,
sc=SourceContext(file_name="source/context_{:03}.proto".format(i)),
)


Expand Down
8 changes: 4 additions & 4 deletions e2e_test/schema_registry/pb.slt
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ select count(*) from sr_pb_test;
----
20

query II
select min(id), max(id) from sr_pb_test;
query IIT
select min(id), max(id), max((sc).file_name) from sr_pb_test;
----
0 19
0 19 source/context_019.proto


statement ok
drop table sr_pb_test;

statement ok
drop table sr_pb_test_bk;
drop table sr_pb_test_bk;
5 changes: 4 additions & 1 deletion e2e_test/schema_registry/protobuf/user.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@ syntax = "proto3";

package test;

import "google/protobuf/source_context.proto";

message User {
int32 id = 1;
string name = 2;
string address = 3;
string city = 4;
Gender gender = 5;
google.protobuf.SourceContext sc = 6;
}

enum Gender {
MALE = 0;
FEMALE = 1;
}
}
13 changes: 7 additions & 6 deletions e2e_test/schema_registry/protobuf/user_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ee192ad

Please sign in to comment.