Skip to content

Commit

Permalink
docs: add testing and mocks section to readme
Browse files Browse the repository at this point in the history
Signed-off-by: Boris Glimcher <36732377+glimchb@users.noreply.github.com>
  • Loading branch information
glimchb authored Aug 29, 2023
1 parent b998cfe commit 75dbb13
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,21 @@ docker-compose exec opi-evpn-bridge grpcurl -plaintext -d '{"name" : "//network.
![OPI EVPN Bridge Diagram for L3VXLAN Symmetric IRB](./docs/OPI-EVPN-L3-Symmetric-IRB.png)
![OPI EVPN Bridge Diagram for L2VXLAN in_Symmetric IRB](./docs/OPI-EVPN-L2-VXLAN-In-Symmetric-IRB-setup.png)
![OPI EVPN Bridge Diagram for Leaf1_Detailed_View](./docs/OPI-EVPN-Leaf1-Detailed-View.png)
## Tests
Test your APIs even if unmerged using your private fork like this:
```bash
chmod a+w go.*
docker run --rm -it -v `pwd`:/app -w /app golang:alpine go mod edit -replace github.com/opiproject/opi-api@main=github.com/YOURUSERNAME/opi-api@main
docker run --rm -it -v `pwd`:/app -w /app golang:alpine go get -u github.com/YOURUSERNAME/opi-api/storage/v1alpha1/gen/go@a98ca449468a
docker run --rm -it -v `pwd`:/app -w /app golang:alpine go mod tidy
```
Generate mocks like this:
```bash
go install github.com/vektra/mockery/v2@latest
make mock-generate
```

0 comments on commit 75dbb13

Please sign in to comment.