Skip to content

test: add the mock_async_routine #10

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

Merged
merged 1 commit into from
Apr 15, 2025
Merged
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
19 changes: 18 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,35 @@
APP_NAME=asyncroutinemanager

MKFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
PROJECT_PATH := $(patsubst %/,%,$(dir $(MKFILE_PATH)))
LOCAL_BIN_PATH := $(PROJECT_PATH)/bin

export PATH := $(LOCAL_BIN_PATH):$(PATH)

.PHONY: all build test clean

all: build

MOCKGEN := $(LOCAL_BIN_PATH)/mockgen

.PHONY: mockgen-install
mockgen-install:
@GOBIN=$(LOCAL_BIN_PATH) go install go.uber.org/mock/[email protected] ;\

ginkgo:
go install github.com/onsi/ginkgo/v2/ginkgo

tools: ginkgo


.PHONY: generate
generate: mockgen-install
go generate ./...

build:
go build -o $(APP_NAME)

test: tools
test: tools generate
ginkgo -r -v

clean:
Expand Down
2 changes: 2 additions & 0 deletions async_routine.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ const (
var _ AsyncRoutine = (*asyncRoutine)(nil)

// AsyncRoutine is the public interface for managed async routines
//
//go:generate mockgen -source=async_routine.go -package=async -destination=mock_async_routine.go
type AsyncRoutine interface {
Name() string
CreatedAt() time.Time
Expand Down
215 changes: 215 additions & 0 deletions mock_async_routine.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.