Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Share Integration Tests Between Server Implementations #241

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ build: prebuild
test: prebuild
@echo "+ $@"
@go test -race -coverprofile=unit.cov -test.short -timeout 30s -v ./...
@IN_MEMORY_DATABASE=1 go test -race -coverprofile=ims-integration.cov -coverpkg=github.com/ovn-org/libovsdb/... -timeout 60s -v ./test/ovs

.PHONY: integration-test
integration-test:
Expand All @@ -31,7 +32,8 @@ integration-test:
.PHONY: coverage
coverage: test integration-test
@sed -i '1d' integration.cov
@cat unit.cov integration.cov > profile.cov
@sed -i '1d' ims-integration.cov
@cat unit.cov integration.cov ims-integration.cov > profile.cov

.PHONY: bench
bench: install-deps
Expand Down
3 changes: 0 additions & 3 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
type OvsdbServer struct {
srv *rpc2.Server
listener net.Listener
done chan struct{}
db Database
ready bool
readyMutex sync.RWMutex
Expand All @@ -36,7 +35,6 @@ type DatabaseModel struct {
// NewOvsdbServer returns a new OvsdbServer
func NewOvsdbServer(db Database, models ...DatabaseModel) (*OvsdbServer, error) {
o := &OvsdbServer{
done: make(chan struct{}, 1),
db: db,
models: make(map[string]DatabaseModel),
modelsMutex: sync.RWMutex{},
Expand Down Expand Up @@ -98,7 +96,6 @@ func (o *OvsdbServer) Close() {
o.ready = false
o.readyMutex.Unlock()
o.listener.Close()
close(o.done)
}

// Ready returns true if a server is ready to handle connections
Expand Down
Loading