forked from openshift-kni/cnf-features-deploy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
123 lines (94 loc) · 3.69 KB
/
Makefile
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#TODO add default features here
export FEATURES?=sctp performance xt_u32 vrf container-mount-namespace
export SKIP_TESTS?=
IMAGE_BUILD_CMD ?= "docker"
# The environment represents the kustomize patches to apply when deploying the features
export FEATURES_ENVIRONMENT?=deploy
.PHONY: deps-update \
functests \
gofmt \
golint \
govet \
ci-job \
feature-deploy \
cnf-tests-local \
test-bin
TARGET_GOOS=linux
TARGET_GOARCH=amd64
CACHE_DIR="_cache"
TOOLS_DIR="$(CACHE_DIR)/tools"
$(shell mkdir -p $(TOOLS_DIR))
# Export GO111MODULE=on to enable project to be built from within GOPATH/src
export GO111MODULE=on
deps-update:
go mod tidy && \
go mod vendor
functests:
@echo "Running Functional Tests"
SKIP_TESTS="$(SKIP_TESTS)" FEATURES="$(FEATURES)" hack/run-functests.sh
#validate is intended to validate the deployment as a whole, not focusing
# but eventually skipping
wait-and-validate:
@echo "Waiting"
SKIP_TESTS="$(SKIP_TESTS)" DONT_FOCUS=true FEATURES="$(FEATURES)" hack/feature-wait.sh
@echo "Validating"
SKIP_TESTS="$(SKIP_TESTS)" DONT_FOCUS=true TEST_SUITES="validationsuite" hack/run-functests.sh
functests-on-ci: setup-test-cluster feature-deploy feature-wait functests
origin-tests:
@echo "Running origin-tests"
TESTS_IN_CONTAINER=true ORIGIN_TESTS_FILTER="$(ORIGIN_TESTS_FILTER)" hack/run-origin-tests.sh
skopeo-origin-tests:
@echo "Running origin-tests"
ORIGIN_TESTS_FILTER="$(ORIGIN_TESTS_FILTER)" hack/run-origin-tests.sh
mirror-origin-tests:
@echo "Mirroring origin-tests"
TESTS_IN_CONTAINER=true ORIGIN_TESTS_REPOSITORY="$(ORIGIN_TESTS_REPOSITORY)" hack/mirror-origin-tests.sh
skopeo-mirror-origin-tests:
@echo "Mirroring origin-tests"
ORIGIN_TESTS_REPOSITORY="$(ORIGIN_TESTS_REPOSITORY)" hack/mirror-origin-tests.sh
origin-tests-disconnected-environment:
@echo "Mirroring origin-tests"
ORIGIN_TESTS_REPOSITORY="$(ORIGIN_TESTS_REPOSITORY)" hack/mirror-origin-tests.sh
@echo "Running origin-tests"
TESTS_IN_CONTAINER=true ORIGIN_TESTS_IN_DISCONNECTED_ENVIRONMENT=true \
ORIGIN_TESTS_REPOSITORY="$(ORIGIN_TESTS_REPOSITORY)" ORIGIN_TESTS_FILTER="$(ORIGIN_TESTS_FILTER)" \
hack/run-origin-tests.sh
validate-on-ci: setup-test-cluster feature-deploy wait-and-validate
gofmt:
@echo "Running gofmt"
gofmt -s -l `find . -path ./vendor -prune -o -type f -name '*.go' -print`
golint:
@echo "Running go lint"
cnf-tests/hack/lint.sh
govet:
@echo "Running go vet"
# Disabling GO111MODULE just for go vet execution
GO111MODULE=off go vet github.com/openshift-kni/cnf-features-deploy/cnf-tests/testsuites...
ci-job: gofmt golint govet check-tests-nodesc validate-test-list
feature-deploy:
FEATURES_ENVIRONMENT=$(FEATURES_ENVIRONMENT) FEATURES="$(FEATURES)" hack/feature-deploy.sh
setup-test-cluster:
@echo "Setting up test cluster"
hack/setup-test-cluster.sh
feature-wait:
@echo "Waiting for features"
SKIP_TESTS="$(SKIP_TESTS)" FEATURES="$(FEATURES)" hack/feature-wait.sh
test-bin:
@echo "Making test binary"
cnf-tests/hack/build-test-bin.sh
cnf-tests-local:
@echo "Making cnf-tests local"
$(IMAGE_BUILD_CMD) build --no-cache -f cnf-tests/Dockerfile -t cnf-tests-local .
$(IMAGE_BUILD_CMD) build --no-cache -f buildingexamples/s2i-dpdk/Dockerfile -t dpdk buildingexamples/s2i-dpdk/
check-tests-nodesc:
@echo "Checking undocumented cnf tests"
cnf-tests/hack/fill-empty-docs.sh
generate-cnf-tests-doc:
@echo "Generating cnf tests doc"
cnf-tests/hack/generate-cnf-docs.sh
validate-test-list:
@echo "Comparing newly generated docs to existing docs"
cnf-tests/hack/compare-gen-md.sh
.PHONY: list
list:
@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$'