forked from DataDog/helm-charts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
92 lines (72 loc) · 2.43 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
# Default variables
SHELL = /usr/bin/env bash -o pipefail
GOTESTSUM_FORMAT?=standard-verbose
# E2E environment variables
E2E_CONFIG_PARAMS?=
DD_TEAM?=container-ecosystems
DD_TAGS?=
## Local profile
E2E_PROFILE?=local
export AWS_KEYPAIR_NAME?=${USER}
export E2E_API_KEY?=
export E2E_APP_KEY?=
export PULUMI_CONFIG_PASSPHRASE?=
## CI profile
CI_ENV_NAMES?=aws/agent-qa
ifdef ${CI_PIPELINE_ID}
override E2E_PROFILE=ci
endif
ifdef ${CI_PROJECT_ID}
override E2E_PROFILE=ci
endif
ifeq ($(E2E_PROFILE), ci)
export CI_ENV_NAMES
export DD_TEAM
export DD_TAGS
endif
.PHONY: all
all: fmt vet test test-e2e
.PHONY: test
test: fmt vet unit-test integration-test
.PHONY: fmt
fmt:
go fmt -C test ./...
.PHONY: vet
vet:
go vet -C test ./...
.PHONY: unit-test
unit-test:
go test -C test ./... -count=1
.PHONY: unit-test-operator
unit-test-operator:
go test -C test ./datadog-operator -count=1
.PHONY: unit-test-private-action-runner
unit-test-private-action-runner:
go test -C test ./private-action-runner -count=1
.PHONY: update-test-baselines
update-test-baselines:
go test -C test ./... -count=1 -args -updateBaselines=true
.PHONY: update-test-baselines-operator
update-test-baselines-operator:
go test -C test ./datadog-operator -count=1 -args -updateBaselines=true
.PHONY: integration-test
integration-test:
go test -C test/integ --tags=integration -count=1 -v
# Running E2E tests locally:
## Must be connected to appgate
## E2E make target commands must be prepended with `aws-vault exec sso-agent-sandbox-account-admin --`
# aws-vault exec sso-agent-sandbox-account-admin -- make test-e2e
.PHONY: test-e2e
test-e2e: fmt vet e2e-test
# aws-vault exec sso-agent-sandbox-account-admin -- make e2e-test
.PHONY: e2e-test
e2e-test:
E2E_CONFIG_PARAMS=$(E2E_CONFIG_PARAMS) E2E_PROFILE=$(E2E_PROFILE) go test -C test/e2e ./... --tags=e2e -v -vet=off -timeout 1h -count=1
# aws-vault exec sso-agent-sandbox-account-admin -- make e2e-test-preserve-stacks
.PHONY: e2e-test-preserve-stacks
e2e-test-preserve-stacks:
E2E_CONFIG_PARAMS=$(E2E_CONFIG_PARAMS) E2E_PROFILE=$(E2E_PROFILE) go test -C test/e2e ./... --tags=e2e -v -vet=off -timeout 1h -count=1 -args -preserveStacks=true
# aws-vault exec sso-agent-sandbox-account-admin -- make e2e-test-cleanup-stacks
.PHONY: e2e-test-cleanup-stacks
e2e-test-cleanup-stacks:
E2E_CONFIG_PARAMS=$(E2E_CONFIG_PARAMS) E2E_PROFILE=$(E2E_PROFILE) go test -C test/e2e ./... --tags=e2e -v -vet=off -timeout 1h -count=1 -args -destroyStacks=true