Skip to content

Commit 5d6878c

Browse files
authored
refactor: Update Makefile target names to match finch cli (#70)
refactor: update Makefile target names to match finch cli Signed-off-by: Swagat Bora <[email protected]>
1 parent a97a89a commit 5d6878c

File tree

4 files changed

+24
-24
lines changed

4 files changed

+24
-24
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
- name: Build and run unit tests
6464
run: |
6565
make build
66-
make run-unit-tests
66+
make test-unit
6767
e2e-test:
6868
runs-on: ubuntu-latest
6969
steps:
@@ -83,4 +83,4 @@ jobs:
8383
- name: Start finch-daemon
8484
run: sudo bin/finch-daemon --debug --socket-owner $UID &
8585
- name: Run e2e test
86-
run: sudo make run-e2e-tests
86+
run: sudo make test-e2e

Makefile

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ ifneq ("$(wildcard /run/finch.sock)","")
5353
sudo unlink /run/finch.sock
5454
endif
5555

56-
.PHONY: code-gen
57-
code-gen: linux
56+
.PHONY: gen-code
57+
gen-code: linux
5858
rm -rf ./pkg/mocks
5959
GOBIN=$(BIN) go install github.com/golang/mock/mockgen
6060
GOBIN=$(BIN) go install golang.org/x/tools/cmd/stringer
@@ -72,36 +72,36 @@ GOLINT=$(BIN)/golangci-lint
7272
$(GOLINT): linux
7373
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(BIN) v1.60.3
7474

75-
.PHONY: golint
76-
golint: linux $(GOLINT)
75+
.PHONY: lint
76+
lint: linux $(GOLINT)
7777
$(GOLINT) run ./...
7878

79-
.PHONY: run-unit-tests
80-
run-unit-tests: linux
79+
.PHONY: test-unit
80+
test-unit: linux
8181
$(GINKGO) $(GFLAGS) ./...
8282

83-
.PHONY: licenses
84-
licenses:
85-
PATH=$(BIN):$(PATH) go-licenses report --template="scripts/third-party-license.tpl" --ignore github.com/runfinch ./... > THIRD_PARTY_LICENSES
86-
8783
# Runs tests in headless dlv mode, must specify package directory with PKG_DIR
8884
PKG_DIR ?= .
89-
.PHONY: debug-unit-tests
90-
debug-unit-tests: linux $(DLV)
85+
.PHONY: test-unit-debug
86+
test-unit-debug: linux $(DLV)
9187
sudo $(DLV) --listen=:2345 --headless=true --api-version=2 test $(PKG_DIR)
9288

89+
.PHONY: test-e2e
90+
test-e2e: linux
91+
DOCKER_HOST="unix:///run/finch.sock" \
92+
DOCKER_API_VERSION="v1.41" \
93+
TEST_E2E=1 \
94+
$(GINKGO) $(GFLAGS) ./e2e/...
95+
96+
.PHONY: licenses
97+
licenses:
98+
PATH=$(BIN):$(PATH) go-licenses report --template="scripts/third-party-license.tpl" --ignore github.com/runfinch ./... > THIRD_PARTY_LICENSES
99+
93100
.PHONY: coverage
94101
coverage: linux
95102
$(GINKGO) -r -v -race --trace --cover --coverprofile="coverage-report.out" ./...
96103
go tool cover -html="coverage-report.out" -o="unit-test-coverage-report.html"
97104

98-
.PHONY: run-e2e-tests
99-
run-e2e-tests: linux
100-
DOCKER_HOST="unix:///run/finch.sock" \
101-
DOCKER_API_VERSION="v1.41" \
102-
RUN_E2E_TESTS=1 \
103-
$(GINKGO) $(GFLAGS) ./e2e/...
104-
105105
.PHONY: release
106106
release: linux
107107
@echo "$@"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Getting started with Finch Daemon on Linux only requires a few steps:
3232
make
3333
sudo bin/finch-daemon --debug --socket-owner $UID
3434
```
35-
5. Test any changes with `make run-unit-tests` and `sudo make run-e2e-tests`
35+
5. Test any changes with `make test-unit` and `sudo make test-e2e`
3636

3737

3838
## Creating a systemd service

e2e/e2e_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ import (
1616
)
1717

1818
func TestRun(t *testing.T) {
19-
if os.Getenv("RUN_E2E_TESTS") != "1" {
20-
t.Skip("E2E tests skipped. Set RUN_E2E_TESTS=1 to run these tests")
19+
if os.Getenv("TEST_E2E") != "1" {
20+
t.Skip("E2E tests skipped. Set TEST_E2E=1 to run these tests")
2121
}
2222
// TODO : Make this configurable
2323
runtimeExe := "nerdctl"

0 commit comments

Comments
 (0)