1+ .PHONY : default
12default : checks fmt lint
23
34# Default packages to test (all)
@@ -12,24 +13,30 @@ GOTESTSUM_CMD ?= ${GO_TOOL} gotestsum --format ${GOTESTSUM_FORMAT} --no-summary=
1213LOCAL_TIMEOUT ?= 30m
1314
1415
16+ .PHONY : lintfull
1517lintfull : ./tools/golangci-lint
1618 ./tools/golangci-lint run --fix
1719
20+ .PHONY : lint
1821lint : ./tools/golangci-lint
1922 ./tools/lintdiff.py ./tools/golangci-lint run --fix
2023
24+ .PHONY : tidy
2125tidy :
2226 @# not part of golangci-lint, apparently
2327 go mod tidy
2428
29+ .PHONY : lintcheck
2530lintcheck : ./tools/golangci-lint
2631 ./tools/golangci-lint run ./...
2732
33+ .PHONY : fmtfull
2834fmtfull : ./tools/golangci-lint ./tools/yamlfmt
2935 ruff format -n
3036 ./tools/golangci-lint fmt
3137 ./tools/yamlfmt .
3238
39+ .PHONY : fmt
3340fmt : ./tools/golangci-lint ./tools/yamlfmt
3441 ruff format -n
3542 ./tools/lintdiff.py ./tools/golangci-lint fmt
@@ -46,60 +53,77 @@ tools/yamlfmt.exe: tools/go.mod tools/go.sum
4653tools/golangci-lint : tools/go.mod tools/go.sum
4754 go build -modfile=tools/go.mod -o tools/golangci-lint github.com/golangci/golangci-lint/v2/cmd/golangci-lint
4855
56+ .PHONY : ws
4957ws :
5058 ./tools/validate_whitespace.py
5159
60+ .PHONY : wsfix
5261wsfix :
5362 ./tools/validate_whitespace.py --fix
5463
64+ .PHONY : links
5565links :
5666 ./tools/update_github_links.py
5767
5868# Checks other than 'fmt' and 'lint'; these are fast, so can be run first
69+ .PHONY : checks
5970checks : tidy ws links
6071
6172
6273# Run short unit and acceptance tests (testing.Short() is true).
74+ .PHONY : test
6375test : test-unit test-acc
6476
6577# Run all unit and acceptance tests.
78+ .PHONY : test-slow
6679test-slow : test-slow-unit test-slow-acc
6780
81+ .PHONY : test-unit
6882test-unit :
6983 ${GOTESTSUM_CMD} --packages " ${TEST_PACKAGES} " -- -timeout=${LOCAL_TIMEOUT} -short
7084
85+ .PHONY : test-slow-unit
7186test-slow-unit :
7287 ${GOTESTSUM_CMD} --packages " ${TEST_PACKAGES} " -- -timeout=${LOCAL_TIMEOUT}
7388
89+ .PHONY : test-acc
7490test-acc :
7591 ${GOTESTSUM_CMD} --packages ./acceptance/... -- -timeout=${LOCAL_TIMEOUT} -short -run ${ACCEPTANCE_TEST_FILTER}
7692
93+ .PHONY : test-slow-acc
7794test-slow-acc :
7895 ${GOTESTSUM_CMD} --packages ./acceptance/... -- -timeout=${LOCAL_TIMEOUT} -run ${ACCEPTANCE_TEST_FILTER}
7996
8097# Updates acceptance test output (local tests)
98+ .PHONY : test-update
8199test-update :
82100 -go test ./acceptance -run ' ^TestAccept$$' -update -timeout=${LOCAL_TIMEOUT}
83101 @# at the moment second pass is required because some tests show diff against output of another test for easier review
84102 -go test ./acceptance -run ' ^TestAccept$$' -update -timeout=${LOCAL_TIMEOUT}
85103
86104# Updates acceptance test output for template tests only
105+ .PHONY : test-update-templates
87106test-update-templates :
88107 -go test ./acceptance -run ' ^TestAccept/bundle/templates' -update -timeout=${LOCAL_TIMEOUT}
89108
90109# Regenerate out.test.toml files without running tests
110+ .PHONY : generate-out-test-toml
91111generate-out-test-toml :
92112 go test ./acceptance -run ' ^TestAccept$$' -only-out-test-toml -timeout=${LOCAL_TIMEOUT}
93113
94114# Updates acceptance test output (integration tests, requires access)
115+ .PHONY : test-update-aws
95116test-update-aws :
96117 deco env run -i -n aws-prod-ucws -- env DATABRICKS_TEST_SKIPLOCAL=1 go test ./acceptance -run ^TestAccept$$ -update -timeout=1h -v
97118
119+ .PHONY : test-update-all
98120test-update-all : test-update test-update-aws
99121
122+ .PHONY : slowest
100123slowest :
101124 ${GO_TOOL} gotestsum tool slowest --jsonfile test-output.json --threshold 1s --num 50
102125
126+ .PHONY : cover
103127cover :
104128 rm -fr ./acceptance/build/cover/
105129 VERBOSE_TEST=1 ${GOTESTSUM_CMD} --packages " ${TEST_PACKAGES} " -- -coverprofile=coverage.txt -timeout=${LOCAL_TIMEOUT}
@@ -109,53 +133,67 @@ cover:
109133 go tool covdata merge -i $$(printf '%s,' acceptance/build/cover/* | sed 's/,$$//' ) -o acceptance/build/cover-merged/
110134 go tool covdata textfmt -i acceptance/build/cover-merged -o coverage-acceptance.txt
111135
136+ .PHONY : showcover
112137showcover :
113138 go tool cover -html=coverage.txt
114139
140+ .PHONY : acc-showcover
115141acc-showcover :
116142 go tool cover -html=coverage-acceptance.txt
117143
144+ .PHONY : build
118145build : tidy
119146 go build
120147
121148# builds the binary in a VM environment (such as Parallels Desktop) where your files are mirrored from the host os
149+ .PHONY : build-vm
122150build-vm : tidy
123151 go build -buildvcs=false
124152
153+ .PHONY : snapshot
125154snapshot :
126155 go build -o .databricks/databricks
127156
128157# Produce release binaries and archives in the dist folder without uploading them anywhere.
129158# Useful for "databricks ssh" development, as it needs to upload linux releases to the /Workspace.
159+ .PHONY : snapshot-release
130160snapshot-release :
131161 goreleaser release --clean --skip docker --snapshot
132162
163+ .PHONY : schema
133164schema :
134165 go run ./bundle/internal/schema ./bundle/internal/schema ./bundle/schema/jsonschema.json
135166
167+ .PHONY : schema-for-docs
136168schema-for-docs :
137169 go run ./bundle/internal/schema ./bundle/internal/schema ./bundle/schema/jsonschema_for_docs.json --docs
138170
171+ .PHONY : docs
139172docs :
140173 go run ./bundle/docsgen ./bundle/internal/schema ./bundle/docsgen
141174
142175INTEGRATION = go run -modfile=tools/go.mod ./tools/testrunner/main.go ${GO_TOOL} gotestsum --format github-actions --rerun-fails --jsonfile output.json --packages "./acceptance ./integration/..." -- -parallel 4 -timeout=2h
143176
177+ .PHONY : integration
144178integration :
145179 $(INTEGRATION )
146180
181+ .PHONY : integration-short
147182integration-short :
148183 DATABRICKS_TEST_SKIPLOCAL=1 VERBOSE_TEST=1 $(INTEGRATION ) -short
149184
185+ .PHONY : dbr-integration
150186dbr-integration :
151187 DBR_ENABLED=true go test -v -timeout 4h -run TestDbrAcceptance$$ ./acceptance
152188
153189# DBR acceptance tests - run on Databricks Runtime using serverless compute
154190# These require deco env run for authentication
155191# Set DBR_TEST_VERBOSE=1 for detailed output (e.g., DBR_TEST_VERBOSE=1 make dbr-test)
192+ .PHONY : dbr-test
156193dbr-test :
157194 deco env run -i -n aws-prod-ucws -- make dbr-integration
158195
196+ .PHONY : generate-validation
159197generate-validation :
160198 go run ./bundle/internal/validation/.
161199 gofmt -w -s ./bundle/internal/validation/generated
@@ -174,6 +212,7 @@ generate-validation:
174212UNIVERSE_DIR ?= $(HOME ) /universe
175213GENKIT_BINARY := $(UNIVERSE_DIR ) /bazel-bin/openapi/genkit/genkit_/genkit
176214
215+ .PHONY : generate
177216generate :
178217 @echo " Checking out universe at SHA: $$ (cat .codegen/_openapi_sha)"
179218 cd $(UNIVERSE_DIR ) && git cat-file -e $$(cat $(PWD ) /.codegen/_openapi_sha ) 2> /dev/null || git fetch --filter=blob:none origin master && git checkout $$(cat $(PWD ) /.codegen/_openapi_sha )
@@ -190,40 +229,50 @@ generate:
190229.codegen/openapi.json : .codegen/_openapi_sha
191230 wget -O $@ .tmp " https://openapi.dev.databricks.com/$$ (cat $<)/specs/all-internal.json" && mv $@ .tmp $@ && touch $@
192231
232+ .PHONY : generate-direct
193233generate-direct : generate-direct-apitypes generate-direct-resources
234+
235+ .PHONY : generate-direct-apitypes
194236generate-direct-apitypes : bundle/direct/dresources/apitypes.generated.yml
237+
238+ .PHONY : generate-direct-resources
195239generate-direct-resources : bundle/direct/dresources/resources.generated.yml
240+
241+ .PHONY : generate-direct-clean
196242generate-direct-clean :
197243 rm -f bundle/direct/dresources/apitypes.generated.yml bundle/direct/dresources/resources.generated.yml
198- .PHONY : generate-direct generate-direct-apitypes generate-direct-resources generate-direct-clean
199244
200245bundle/direct/dresources/apitypes.generated.yml : ./bundle/direct/tools/generate_apitypes.py .codegen/openapi.json acceptance/bundle/refschema/out.fields.txt
201246 python3 $^ > $@
202247
203248bundle/direct/dresources/resources.generated.yml : ./bundle/direct/tools/generate_resources.py .codegen/openapi.json bundle/direct/dresources/apitypes.generated.yml bundle/direct/dresources/apitypes.yml acceptance/bundle/refschema/out.fields.txt
204249 python3 $^ > $@
205250
206- .PHONY : lint lintfull tidy lintcheck fmt fmtfull test test-unit test-acc test-slow test-slow-unit test-slow-acc cover showcover build snapshot snapshot-release schema schema-for-docs integration integration-short acc-cover acc-showcover docs ws wsfix links checks test-update test-update-templates generate-out-test-toml test-update-aws test-update-all generate-validation
207-
251+ .PHONY : test-exp-aitools
208252test-exp-aitools :
209253 make test TEST_PACKAGES=" ./experimental/aitools/..." ACCEPTANCE_TEST_FILTER=" TestAccept/apps"
210254
255+ .PHONY : test-exp-ssh
211256test-exp-ssh :
212257 make test TEST_PACKAGES=" ./experimental/ssh/..." ACCEPTANCE_TEST_FILTER=" TestAccept/ssh"
213258
259+ .PHONY : test-pipelines
214260test-pipelines :
215261 make test TEST_PACKAGES=" ./cmd/pipelines/..." ACCEPTANCE_TEST_FILTER=" TestAccept/pipelines"
216262
217263
218264# Benchmarks:
219265
266+ .PHONY : bench1k
220267bench1k :
221268 BENCHMARK_PARAMS=" --jobs 1000" go test ./acceptance -v -tail -run TestAccept/bundle/benchmarks -timeout=120m
222269
270+ .PHONY : bench100
223271bench100 :
224272 BENCHMARK_PARAMS=" --jobs 100" go test ./acceptance -v -tail -run TestAccept/bundle/benchmarks -timeout=120m
225273
226274# small benchmark to quickly test benchmark-related code
275+ .PHONY : bench10
227276bench10 :
228277 BENCHMARK_PARAMS=" --jobs 10" go test ./acceptance -v -tail -run TestAccept/bundle/benchmarks -timeout=120m
229278
@@ -236,11 +285,14 @@ bench100.log:
236285bench10.log :
237286 make bench10 | tee $@
238287
288+ .PHONY : bench1k_summary
239289bench1k_summary : bench1k.log
240290 ./tools/bench_parse.py $<
241291
292+ .PHONY : bench100_summary
242293bench100_summary : bench100.log
243294 ./tools/bench_parse.py $<
244295
296+ .PHONY : bench10_summary
245297bench10_summary : bench10.log
246298 ./tools/bench_parse.py $<
0 commit comments