-
Notifications
You must be signed in to change notification settings - Fork 32
/
Makefile
49 lines (37 loc) · 1.47 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
.PHONY: import testacc testclient test dist ci
TIMEOUT ?= 40m
GOMAXPROCS ?= 5
TF_VERSION ?= v0.14.11
ROOT_PKG_PATH := github.com/vatesfr/terraform-provider-xenorchestra
ifdef TEST
TEST := github.com/vatesfr/terraform-provider-xenorchestra/xoa -run '$(TEST)'
else
TEST := ./...
endif
ifdef TF_LOG
TF_LOG := TF_LOG=$(TF_LOG)
endif
build:
go build -o terraform-provider-xenorchestra
clean:
rm dist/*
dist:
./scripts/dist.sh
plan: build
terraform init
terraform plan
apply:
terraform apply
sweep:
TF_ACC=1 $(TF_LOG) go test $(TEST) -sweep=true -v
test: testclient testacc
testclient:
cd client; go test $(TEST) -v -count 1 -ldflags "-X $(ROOT_PKG_PATH)/client.integrationTestPrefix=adhoc-xo-go-client"
testacc: xoa/testdata/alpine-virt-3.17.0-x86_64.iso
TF_ACC=1 $(TF_LOG) go test $(TEST) -parallel $(GOMAXPROCS) -v -count 1 -timeout $(TIMEOUT) -sweep=true -ldflags "-X $(ROOT_PKG_PATH)/xoa.accTestPrefix=adhoc-terraform-acc"
# This file was previously stored in the git repo with git lfs. GitHub
# has a very low quota for number of allowed clones and so this needed
# to be removed from the repo. Add a target to enforce that the CI system
# has copied that file into place before the tests run
ci: xoa/testdata/alpine-virt-3.17.0-x86_64.iso
TF_ACC_TERRAFORM_PATH=/opt/terraform-provider-xenorchestra/bin/$(TF_VERSION) TF_ACC=1 gotestsum --debug --rerun-fails=5 --max-fails=15 --packages=./xoa -- ./xoa -v -count=1 -timeout=$(TIMEOUT) -sweep=true -parallel=$(GOMAXPROCS)