Skip to content

Commit

Permalink
Merge pull request #39 from EchoVault/update/README.md
Browse files Browse the repository at this point in the history
Added Test Coverage for Admin module
  • Loading branch information
kelvinmwinuka authored May 8, 2024
2 parents 6ed59ef + 1981fe9 commit 3629a4a
Show file tree
Hide file tree
Showing 5 changed files with 523 additions and 269 deletions.
12 changes: 8 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ build-modules:
CGO_ENABLED=$(CGO_ENABLED) CC=$(CC) GOOS=$(GOOS) GOARCH=$(GOARCH) go build -buildmode=plugin -o $(DEST)/module_set/module_set.so ./volumes/modules/module_set/module_set.go && \
CGO_ENABLED=$(CGO_ENABLED) CC=$(CC) GOOS=$(GOOS) GOARCH=$(GOARCH) go build -buildmode=plugin -o $(DEST)/module_get/module_get.so ./volumes/modules/module_get/module_get.go

build-modules-test:
CGO_ENABLED=1 go build --race=$(RACE) -buildmode=plugin -o $(OUT)/modules/module_set/module_set.so ./volumes/modules/module_set/module_set.go && \
CGO_ENABLED=1 go build --race=$(RACE) -buildmode=plugin -o $(OUT)/modules/module_get/module_get.so ./volumes/modules/module_get/module_get.go

build-server:
CGO_ENABLED=$(CGO_ENABLED) CC=$(CC) GOOS=$(GOOS) GOARCH=$(GOARCH) go build -o $(DEST)/server ./cmd/main.go

Expand All @@ -13,13 +17,13 @@ run:
make build && docker-compose up --build

test-unit:
CGO_ENABLED=1 go build -buildmode=plugin -o internal/modules/admin/testdata/modules/module_set/module_set.so ./volumes/modules/module_set/module_set.go && \
CGO_ENABLED=1 go build -buildmode=plugin -o internal/modules/admin/testdata/modules/module_get/module_get.so ./volumes/modules/module_get/module_get.go && \
env RACE=false OUT=internal/modules/admin/testdata make build-modules-test && \
env RACE=false OUT=echovault/testdata make build-modules-test && \
go clean -testcache && \
CGO_ENABLED=1 go test ./... -coverprofile coverage/coverage.out

test-race:
CGO_ENABLED=1 go build -buildmode=plugin --race -o internal/modules/admin/testdata/modules/module_set/module_set.so ./volumes/modules/module_set/module_set.go && \
CGO_ENABLED=1 go build -buildmode=plugin --race -o internal/modules/admin/testdata/modules/module_get/module_get.so ./volumes/modules/module_get/module_get.go && \
env RACE=true OUT=internal/modules/admin/testdata make build-modules-test && \
env RACE=true OUT=echovault/testdata make build-modules-test && \
go clean -testcache && \
CGO_ENABLED=1 go test ./... --race
Loading

0 comments on commit 3629a4a

Please sign in to comment.