Repository navigation
Expand file tree
/
Copy pathTaskfile.yml
More file actions
151 lines (133 loc) · 5.06 KB
/
Copy pathTaskfile.yml
File metadata and controls
151 lines (133 loc) · 5.06 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
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
version: "3"
tasks:
build:
desc: Build mackit CLI binary -> ./bin/mackit
dir: "{{.TASKFILE_DIR}}"
silent: true
cmds:
- mkdir -p ./bin
- go build -o ./bin/mackit ./cmd/mackit/
- '[ "$(uname -s)" != "Darwin" ] || codesign --force --sign - --entitlements entitlements.plist ./bin/mackit'
install:
desc: Build + copy to ~/.local/bin/mackit (+ mackit-vz on macOS arm64)
dir: "{{.TASKFILE_DIR}}"
deps: [build, build:vz]
silent: true
cmds:
- mkdir -p ~/.local/bin
- cp ./bin/mackit ~/.local/bin/mackit
- '[ "$(uname -s)" != "Darwin" ] || codesign --force --sign - --entitlements entitlements.plist ~/.local/bin/mackit'
- '[ ! -f ./bin/mackit-vz ] || cp ./bin/mackit-vz ~/.local/bin/mackit-vz'
- echo "Installed to ~/.local/bin/mackit"
test:
desc: Run unit tests
cmds:
- go test $(go list ./... | grep -v '/test/e2e')
test:race:
desc: Run tests with race detector
cmds:
- go test -race ./...
test:cover:
desc: Run tests with coverage
cmds:
- go test -coverprofile=coverage.out ./...
- go tool cover -func=coverage.out
vet:
desc: Run go vet
cmds:
- go vet ./...
tidy:
desc: Tidy go modules
cmds:
- go mod tidy
clean:
desc: Remove build artifacts and test disk images
cmds:
- rm -rf bin/ coverage.out
- task: clean:results:qcow2
- task: clean:results:raw
test:vz:
desc: "Install + provision + SSH: full VZ end-to-end (macOS arm64)"
dir: "{{.TASKFILE_DIR}}"
deps: [build:vz]
vars:
TIMEOUT: '{{.TIMEOUT | default "60m"}}'
cmds:
- go test -c -o ./bin/vz.test ./vm/vz/
- codesign --force --sign - --entitlements entitlements.plist ./bin/vz.test
- MACKIT_VZ_TEST=1 ./bin/vz.test -test.run TestVZProvisionAndSSH -test.timeout {{.TIMEOUT}} -test.v {{.CLI_ARGS}}
platforms: [darwin/arm64]
test:vz:all:
desc: "Run all VZ tests: protocol (any platform) + integration (macOS arm64)"
dir: "{{.TASKFILE_DIR}}"
cmds:
- task: test:vz:helper
- task: test:vz:integration
test:vz:integration:
desc: "Compile, sign, and run VZ integration tests (macOS arm64 only)"
dir: "{{.TASKFILE_DIR}}"
deps: [build:vz]
vars:
TEST_RUN: '{{.TEST_RUN | default "."}}'
TIMEOUT: '{{.TIMEOUT | default "60m"}}'
cmds:
- go test -c -o ./bin/vz.test ./vm/vz/
- codesign --force --sign - --entitlements entitlements.plist ./bin/vz.test
- MACKIT_VZ_TEST=1 ./bin/vz.test -test.run '{{.TEST_RUN}}' -test.timeout {{.TIMEOUT}} -test.v {{.CLI_ARGS}}
platforms: [darwin/arm64]
test:vz:install:
desc: "Install macOS from IPSW, boot, and verify screen (macOS arm64 only)"
dir: "{{.TASKFILE_DIR}}"
deps: [build:vz]
vars:
TIMEOUT: '{{.TIMEOUT | default "60m"}}'
cmds:
- go test -c -o ./bin/vz.test ./vm/vz/
- codesign --force --sign - --entitlements entitlements.plist ./bin/vz.test
- MACKIT_VZ_TEST=1 MACKIT_VZ_FORCE_INSTALL=1 ./bin/vz.test -test.run TestVZInstallAndBoot -test.timeout {{.TIMEOUT}} -test.v {{.CLI_ARGS}}
platforms: [darwin/arm64]
test:vz:setup-assistant:
desc: "Boot installed disk into Setup Assistant with VNC for flow development"
dir: "{{.TASKFILE_DIR}}"
vars:
TIMEOUT: '{{.TIMEOUT | default "120m"}}'
cmds:
- go test -c -o ./bin/vz.test ./vm/vz/
- codesign --force --sign - --entitlements entitlements.plist ./bin/vz.test
- MACKIT_VZ_TEST=1 MACKIT_VZ_KEEP=1 ./bin/vz.test -test.run TestVZSetupAssistant -test.timeout {{.TIMEOUT}} -test.v {{.CLI_ARGS}}
platforms: [darwin/arm64]
build:vz:
desc: "Build the mackit-vz Swift helper binary (macOS arm64 only)"
dir: "{{.TASKFILE_DIR}}/cmd/mackit-vz"
cmds:
- swift build -c release
- mkdir -p ../../bin
- cp .build/release/mackit-vz ../../bin/mackit-vz
- codesign --force --sign - --entitlements ../../entitlements.plist ../../bin/mackit-vz
platforms: [darwin/arm64]
test:vz:recovery-boot:
desc: "Boot installed disk into Recovery and verify stability (macOS arm64 only)"
dir: "{{.TASKFILE_DIR}}"
deps: [build:vz]
vars:
TIMEOUT: '{{.TIMEOUT | default "10m"}}'
cmds:
- go test -c -o ./bin/vz.test ./vm/vz/
- codesign --force --sign - --entitlements entitlements.plist ./bin/vz.test
- MACKIT_VZ_TEST=1 ./bin/vz.test -test.run TestVZBoot_Recovery -test.timeout {{.TIMEOUT}} -test.v {{.CLI_ARGS}}
platforms: [darwin/arm64]
test:vz:helper:
desc: "Run Go-side VZ helper protocol tests (any platform)"
dir: "{{.TASKFILE_DIR}}"
cmds:
- go test ./vm/vz/ -run TestHelper -v {{.CLI_ARGS}}
clean:results:qcow2:
desc: Delete every qcow2 under test/results (keeps logs, screenshots, OCR readings)
dir: "{{.TASKFILE_DIR}}"
cmds:
- find test/results -type f -name '*.qcow2' -print -delete
clean:results:raw:
desc: Delete every raw disk image under test/results (keeps logs, screenshots, OCR readings)
dir: "{{.TASKFILE_DIR}}"
cmds:
- find test/results -type f -name '*.raw' -print -delete