Skip to content

Commit d58a26d

Browse files
authored
First cut at additional serde tests (#75)
* First cut at additional serde tests * Add JSON test * Add protobuf ref test * Add format params * Checkpoint * Add coverage to gitignore * Remove coverage * Minor fix * Minor fix * Avro ref test * Add json ref test * Add nested tests
1 parent 79a1c27 commit d58a26d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+3332
-107
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ deps/*
1515

1616
.idea
1717
.vscode
18+
coverage

jest.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@ module.exports = {
33
'^.+\\.tsx?$': 'ts-jest',
44
},
55
};
6-
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
syntax = "proto3";
2+
3+
package test;
4+
option go_package="../test";
5+
6+
message LinkedList {
7+
int32 value = 1;
8+
LinkedList next = 10;
9+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
syntax = "proto3";
2+
3+
package test;
4+
option go_package="../test";
5+
6+
import "test/schemaregistry/serde/test.proto";
7+
8+
message DependencyMessage {
9+
bool is_active = 1;
10+
TestMessage test_messsage = 2;
11+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
syntax = "proto3";
2+
3+
package test;
4+
option go_package="../test";
5+
6+
import "confluent/meta.proto";
7+
8+
message Author {
9+
string name = 1 [
10+
(confluent.field_meta).tags = "PII"
11+
];
12+
int32 id = 2;
13+
bytes picture = 3 [
14+
(confluent.field_meta).tags = "PII"
15+
];
16+
repeated string works = 4;
17+
}
18+
19+
message Pizza {
20+
string size = 1;
21+
repeated string toppings = 2;
22+
}
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
syntax = "proto3";
2+
3+
package test;
4+
option go_package="../test";
5+
6+
import "google/protobuf/timestamp.proto";
7+
8+
message UserId {
9+
oneof user_id {
10+
string kafka_user_id = 1;
11+
int32 other_user_id = 2;
12+
MessageId another_id = 3;
13+
}
14+
}
15+
16+
message MessageId {
17+
string id = 1;
18+
}
19+
20+
enum Status {
21+
ACTIVE = 0;
22+
INACTIVE = 1;
23+
}
24+
25+
message ComplexType {
26+
oneof some_val {
27+
string one_id = 1;
28+
int32 other_id = 2;
29+
}
30+
bool is_active = 3;
31+
}
32+
33+
/*
34+
* Complex message using nested protos and repeated fields
35+
*/
36+
message NestedMessage {
37+
UserId user_id = 1;
38+
bool is_active = 2;
39+
repeated string experiments_active = 3;
40+
google.protobuf.Timestamp updated_at = 4;
41+
Status status = 5;
42+
ComplexType complex_type = 6;
43+
map<string, string> map_type = 7;
44+
InnerMessage inner = 8;
45+
46+
message InnerMessage {
47+
string id = 1 [json_name="id"];
48+
repeated int32 ids = 2 [packed=true];
49+
}
50+
51+
enum InnerEnum {
52+
option allow_alias = true;
53+
ZERO = 0;
54+
ALSO_ZERO = 0;
55+
}
56+
57+
reserved 14, 15, 9 to 11;
58+
reserved "foo", "bar";
59+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
syntax = "proto3";
2+
3+
package test;
4+
option go_package="../test";
5+
6+
message NewerWidget {
7+
string name = 1;
8+
int32 length = 2;
9+
int32 version = 3;
10+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
syntax = "proto3";
2+
3+
package test;
4+
option go_package="../test";
5+
6+
message NewWidget {
7+
string name = 1;
8+
int32 height = 2;
9+
int32 version = 3;
10+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
syntax = "proto3";
2+
3+
package test;
4+
option go_package="../test";
5+
6+
import "google/protobuf/descriptor.proto";
7+
8+
message TestMessage {
9+
string test_string = 1;
10+
bool test_bool = 2;
11+
bytes test_bytes = 3;
12+
double test_double = 4;
13+
float test_float = 5;
14+
fixed32 test_fixed32 = 6;
15+
fixed64 test_fixed64 = 7;
16+
int32 test_int32 = 8;
17+
int64 test_int64 = 9;
18+
sfixed32 test_sfixed32 = 10;
19+
sfixed64 test_sfixed64 = 11;
20+
sint32 test_sint32 = 12;
21+
sint64 test_sint64 = 13;
22+
uint32 test_uint32 = 14;
23+
uint64 test_uint64 = 15;
24+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
syntax = "proto3";
2+
3+
package test;
4+
option go_package="../test";
5+
6+
message Widget {
7+
string name = 1;
8+
int32 size = 2;
9+
int32 version = 3;
10+
}

0 commit comments

Comments
 (0)