-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathGNUmakefile
More file actions
54 lines (43 loc) · 1.93 KB
/
Copy pathGNUmakefile
File metadata and controls
54 lines (43 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
default: testacc
PROVIDER_SRC_DIR := ./internal/provider/...
TEST_ENV_FILE ?= $(PWD)/test-config.env
# =============================================================================
# Local Development Targets
# =============================================================================
# Run acceptance tests locally (loads config from test-config.env)
testacc:
@echo "Starting acceptance test (local)..."
@if [ ! -f "$(TEST_ENV_FILE)" ]; then \
echo "Error: $(TEST_ENV_FILE) not found"; \
echo "Run: cp test-config.env.example test-config.env"; \
exit 1; \
fi
@set -a && . $(TEST_ENV_FILE) && set +a && \
TF_ACC=1 gotestsum --junitfile report_acc.xml -- -coverprofile=coverage_acc.out $(TESTARGS) $(PROVIDER_SRC_DIR) -timeout 30m -v -parallel=2
# Run unit tests (no real API call to NGC and other dependencies)
test:
@echo "Starting unit tests..."
gotestsum --junitfile report_ut.xml -- -coverprofile=coverage_ut.out -tags=unittest $(TESTARGS) $(PROVIDER_SRC_DIR) -v
# =============================================================================
# CI Targets (expect environment variables to be set externally)
# =============================================================================
# Run acceptance tests in CI (env vars passed from GitHub Actions)
testacc-ci:
@echo "Starting acceptance test (CI)..."
@if [ -z "$$NGC_API_KEY" ]; then \
echo "Error: NGC_API_KEY environment variable is not set"; \
exit 1; \
fi
TF_ACC=1 gotestsum --junitfile report_acc.xml -- -coverprofile=coverage_acc.out $(TESTARGS) $(PROVIDER_SRC_DIR) -timeout 30m -v -parallel=2
# =============================================================================
# Development Utilities
# =============================================================================
lint:
@echo "Running linter..."
golangci-lint run
generate_doc:
go generate ./...
install:
@echo "Installing binary..."
go install .
.PHONY: testacc testacc-ci test lint generate_doc install