Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
80 lines (58 loc) · 3.81 KB
/
Copy pathMakefile
File metadata and controls
80 lines (58 loc) · 3.81 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
.PHONY: test test-go test-go-integration test-go-integration-sync test-go-integration-snapshot test-go-integration-runc test-go-integration-gvisor test-go-integration-docker test-go-integration-docker-runc test-go-integration-docker-gvisor test-go-integration-volumes test-go-integration-volumes-runc test-go-integration-volumes-gvisor test-go-integration-runtime-matrix test-python test-js build-js publish-python publish-js tidy-go verify-go-install
RUNC_POOL_ENV = $${BEAM_TEST_RUNC_POOL:+BEAM_TEST_POOL=$$BEAM_TEST_RUNC_POOL}
PYPI_REPOSITORY ?=
PYTHON_PUBLISH_ARGS = $(if $(PYPI_REPOSITORY),--repository $(PYPI_REPOSITORY),)
NPM_TAG ?= latest
NPM_PUBLISH_ARGS = $(if $(filter $(NPM_TAG),latest),,--tag $(NPM_TAG))
test: test-go test-python test-js
test-go:
cd go && GOROOT= go test ./...
test-go-integration:
cd go && GOROOT= BEAM_CLIENT_LOCAL_GATEWAY=1 BEAM_CLIENT_REQUIRE_LOCAL_GATEWAY=1 go test -tags=integration ./... -count=1
test-go-integration-sync:
cd go && GOROOT= BEAM_CLIENT_LOCAL_GATEWAY=1 BEAM_CLIENT_REQUIRE_LOCAL_GATEWAY=1 go test -tags=integration ./... -run 'TestIntegration(FileSyncOnly|CreateSandboxWithSyncLocalDir)$$' -count=1 -v
test-go-integration-snapshot:
cd go && GOROOT= BEAM_CLIENT_LOCAL_GATEWAY=1 BEAM_CLIENT_REQUIRE_LOCAL_GATEWAY=1 go test -tags=integration ./... -run TestIntegrationSandboxMemorySnapshot -count=1 -v
test-go-integration-runc:
cd go && env GOROOT= BEAM_CLIENT_LOCAL_GATEWAY=1 BEAM_CLIENT_REQUIRE_LOCAL_GATEWAY=1 $(RUNC_POOL_ENV) go test -tags=integration ./... -count=1
test-go-integration-gvisor:
cd go && GOROOT= BEAM_CLIENT_LOCAL_GATEWAY=1 BEAM_CLIENT_REQUIRE_LOCAL_GATEWAY=1 BEAM_TEST_POOL=$${BEAM_TEST_POOL:-gvisor} BEAM_TEST_DOCKER=1 go test -tags=integration ./... -count=1
test-go-integration-docker: test-go-integration-docker-runc test-go-integration-docker-gvisor
test-go-integration-docker-runc:
cd go && env GOROOT= BEAM_CLIENT_LOCAL_GATEWAY=1 BEAM_CLIENT_REQUIRE_LOCAL_GATEWAY=1 $(RUNC_POOL_ENV) BEAM_TEST_DOCKER=1 go test -tags=integration ./... -run 'TestIntegrationDocker(Smoke|WorkspaceAndVolumeVisibility)$$' -count=1 -v
test-go-integration-docker-gvisor:
cd go && GOROOT= BEAM_CLIENT_LOCAL_GATEWAY=1 BEAM_CLIENT_REQUIRE_LOCAL_GATEWAY=1 BEAM_TEST_POOL=$${BEAM_TEST_POOL:-gvisor} BEAM_TEST_DOCKER=1 go test -tags=integration ./... -run 'TestIntegrationDocker(Smoke|WorkspaceAndVolumeVisibility)$$' -count=1 -v
test-go-integration-volumes: test-go-integration-volumes-runc test-go-integration-volumes-gvisor
test-go-integration-volumes-runc:
cd go && env GOROOT= BEAM_CLIENT_LOCAL_GATEWAY=1 BEAM_CLIENT_REQUIRE_LOCAL_GATEWAY=1 $(RUNC_POOL_ENV) go test -tags=integration ./... -run TestIntegrationVolumeMountPersistsAcrossSandboxes -count=1 -v
test-go-integration-volumes-gvisor:
cd go && GOROOT= BEAM_CLIENT_LOCAL_GATEWAY=1 BEAM_CLIENT_REQUIRE_LOCAL_GATEWAY=1 BEAM_TEST_POOL=$${BEAM_TEST_POOL:-gvisor} go test -tags=integration ./... -run TestIntegrationVolumeMountPersistsAcrossSandboxes -count=1 -v
test-go-integration-runtime-matrix: test-go-integration-docker test-go-integration-volumes
test-python:
cd python && poetry run pytest || test $$? -eq 5
test-js:
cd js && npm ci && npm test
build-js:
cd js && npm ci && npm run build
publish-python:
cd python && poetry publish --build $(PYTHON_PUBLISH_ARGS)
publish-js:
cd js && npm publish --access public $(NPM_PUBLISH_ARGS)
tidy-go:
cd go && GOROOT= go mod tidy
verify-go-install:
tmp=$$(mktemp -d); \
trap 'rm -rf "$$tmp"' EXIT; \
cd "$$tmp"; \
GOROOT= go mod init example.com/beam-install-check; \
GOROOT= go mod edit -replace github.com/beam-cloud/beam-client/go=$(CURDIR)/go; \
GOROOT= go get github.com/beam-cloud/beam-client/go; \
printf '%s\n' \
'package main' \
'' \
'import beam "github.com/beam-cloud/beam-client/go"' \
'' \
'func main() {' \
' _ = beam.NewImage()' \
'}' > main.go; \
GOROOT= go test ./...