Commit 7a693da
[WIP] - Testing ReadStateBytes and WriteStateBytes (#37464)
* Fix nil pointer error
* Add WIP test for ReadStateBytes
* Move test mock to separate testing file
* Update mock to send unexpected EOF when there's a problem returning data and it's not a true EOF
* Add test case for when length != expected length
* Add test for when trying to read state from a store type that doesn't exist
* Change symbol names to lowercase
* Add ability to force a diagnostic to be returned from `mockReadStateBytesClient`'s `Recv` method
* Add test showing error diagnostics raised by the ReadStateBytes client are returned
* Add missing header
* Simplify mock by using an embedded type
* Rename `mockOpts` to `mockReadStateBytesOpts`
* Update existing tests to assert what arguments are passed to the RPC method call
* Add mock WriteStateBytesClient which uses `go.uber.org/mock/gomock` to enable assertions about calls to Send
* Add a test for WriteStateBytes that makes assertions about calls to the Send method
* Update test case to explicitly test writing data smaller than the chunk size
* Implement chunking in WriteStateBytes, add test case to assert expected chunking behaviour
* Add generated mock for Provider_WriteStateBytesClient in protocol v6
* Update tests to use new `MockProvider_WriteStateBytesClient`, remove handwritten mock
* Update code comments in test
* Add tests for diagnostics and errors returned during WriteStateBytes
* Add generated mock for Provider_ReadStateBytesClient in protocol v6, replace old mock
* Add test case for grpc errors in ReadStateBytes, fix how error is returned
* Typo in comment
* Add missing warning test, rename some test cases1 parent 6322501 commit 7a693da
File tree
4 files changed
+899
-26
lines changed- internal/plugin6
- mock_proto
4 files changed
+899
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1537 | 1537 | | |
1538 | 1538 | | |
1539 | 1539 | | |
1540 | | - | |
| 1540 | + | |
1541 | 1541 | | |
1542 | 1542 | | |
1543 | 1543 | | |
| |||
1546 | 1546 | | |
1547 | 1547 | | |
1548 | 1548 | | |
1549 | | - | |
| 1549 | + | |
1550 | 1550 | | |
1551 | 1551 | | |
1552 | 1552 | | |
| |||
1603 | 1603 | | |
1604 | 1604 | | |
1605 | 1605 | | |
1606 | | - | |
| 1606 | + | |
| 1607 | + | |
| 1608 | + | |
| 1609 | + | |
| 1610 | + | |
| 1611 | + | |
| 1612 | + | |
| 1613 | + | |
| 1614 | + | |
| 1615 | + | |
| 1616 | + | |
| 1617 | + | |
| 1618 | + | |
| 1619 | + | |
| 1620 | + | |
| 1621 | + | |
| 1622 | + | |
| 1623 | + | |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
1607 | 1633 | | |
1608 | 1634 | | |
1609 | 1635 | | |
1610 | | - | |
1611 | | - | |
| 1636 | + | |
| 1637 | + | |
1612 | 1638 | | |
1613 | | - | |
1614 | | - | |
| 1639 | + | |
| 1640 | + | |
1615 | 1641 | | |
1616 | 1642 | | |
1617 | | - | |
1618 | | - | |
1619 | | - | |
1620 | | - | |
1621 | | - | |
1622 | 1643 | | |
1623 | 1644 | | |
1624 | 1645 | | |
1625 | 1646 | | |
1626 | 1647 | | |
1627 | | - | |
1628 | | - | |
1629 | | - | |
1630 | | - | |
1631 | | - | |
1632 | | - | |
1633 | | - | |
1634 | | - | |
1635 | | - | |
1636 | | - | |
1637 | 1648 | | |
1638 | | - | |
| 1649 | + | |
| 1650 | + | |
| 1651 | + | |
1639 | 1652 | | |
1640 | 1653 | | |
1641 | 1654 | | |
| |||
0 commit comments