Commit 73d0e88
authored
Fuzz test Thrift to Proto mapper round trips (#1457)
**What changed?**
Adds fuzz tests to all thrift->proto->thrift round trip mappers.
<!-- Tell your future self why have you made these changes -->
**Why?**
When mapping from idl to another there are multiple scenarios:
1. neither mapper implements a field
1. the mapper implementations are incompatible
1. both mappers implement a field correctly
1. both mappers implement conversion incorrectly but in a reversible way (e.g they both do a rot13 of an [a-z] string)
Our existing tests test for scenarios 2 and 3, but don't test for 1 - if someone adds a new field and omits it from the mappers + the test data, it will never be tested for. This PR adds a fuzz test which randomly assigns data to all fields (including nils), which ensures that unmapped data will be tested for without requiring the developer to check it (and keeps the tests for 2 & 3).1 parent b6fc775 commit 73d0e88
File tree
4 files changed
+2092
-4
lines changed- internal/compatibility
- test/testdatagen
4 files changed
+2092
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| 95 | + | |
95 | 96 | | |
96 | 97 | | |
97 | 98 | | |
| |||
0 commit comments