use PeerConnection interface to make it easier to mock

This commit is contained in:
David Zhao
2020-12-20 22:57:06 -08:00
parent 684099d653
commit c4cb29a3bb
10 changed files with 478 additions and 52 deletions
+16 -2
View File
@@ -25,14 +25,17 @@ server: generate
go build -i -o ../../bin/livekit-server ;\
}
generate: wire
generate: wire mockgen
@{ \
echo "wiring" ;\
cd cmd/server ;\
$(WIRE) ;\
cd ../.. ;\
echo "updating mocks" ;\
$(MOCKGEN) -source pkg/rtc/interfaces.go -destination pkg/rtc/mock_test.go -package rtc ;\
}
test: wire
test: generate
go test ./...
GO_TARGET=proto/livekit
@@ -82,3 +85,14 @@ WIRE=$(GOBIN)/wire
else
WIRE=$(shell which wire)
endif
mockgen:
ifeq (, $(shell which mockgen))
@{ \
echo "installing mockgen" ;\
go get github.com/golang/mock/mockgen ;\
}
MOCKGEN=$(GOBIN)/mockgen
else
MOCKGEN=$(shell which mockgen)
endif