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 <Boris.Glimcher@emc.com>
  • Loading branch information
glimchb committed Aug 29, 2023
1 parent b998cfe commit 7894efe
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 @@ -48,6 +48,24 @@ docker-compose exec opi-evpn-bridge grpcurl -plaintext -d '{"name" : "//network.
![OPI EVPN Bridge Architcture Diagram](./docs/OPI-EVPN-GW-FRR-bridge.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
```
## POC diagrams
![OPI EVPN Bridge POC Diagram for CI/CD](./docs/OPI-EVPN-PoC.png)
Expand Down

0 comments on commit 7894efe

Please sign in to comment.