-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
121 lines (94 loc) · 4.51 KB
/
Copy pathMakefile
File metadata and controls
121 lines (94 loc) · 4.51 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
SHELL := /bin/bash
EXPLORER_DIR := explorer
SCENES_DIR := $(EXPLORER_DIR)/scenes
TESTS_DIR := $(EXPLORER_DIR)/Tests
SCOPE_DIR := $(EXPLORER_DIR)/ci/ScopeInWorldTests
WEB_DIR := web
.PHONY: help \
install install-scenes install-web \
scenes-build scenes-new-scene scenes-format scenes-format-fix scenes-syncpack \
explorer-build explorer-scope explorer-scope-test \
web-test web-test-headed web-test-ui web-typecheck web-report \
clean
## Show this help.
help:
@awk ' \
/^## / { gsub(/^## /, "", $$0); doc = doc $$0 "\n"; next } \
/^[a-zA-Z][a-zA-Z0-9_-]*:/ && doc { \
target = $$1; sub(/:$$/, "", target); \
printf "\033[36m %-28s\033[0m %s", target, doc; \
doc = ""; next \
} \
{ doc = "" } \
' $(MAKEFILE_LIST)
# ─────────────── install ───────────────────────────────────────────────────────
## Install everything (scenes + web).
install: install-scenes install-web
## Install scene workspace deps under explorer/scenes.
install-scenes:
cd $(SCENES_DIR) && npm install
## Install web suite deps + Playwright browsers.
install-web:
cd $(WEB_DIR) && npm install && npx playwright install chromium
# ─────────────── visual scenes (explorer/scenes) ───────────────────────────────
## Build every visual-regression scene in parallel.
scenes-build:
cd $(SCENES_DIR) && npm run build
## Scaffold a new visual scene + matching C# fixture. Usage: make scenes-new-scene NAME=my-scene
scenes-new-scene:
ifndef NAME
$(error NAME is not set. Usage: make scenes-new-scene NAME=my-scene)
endif
cd $(SCENES_DIR) && npm run new-scene -- $(NAME)
## Run prettier --check across the scene workspace.
scenes-format:
cd $(SCENES_DIR) && npm run format
## Run prettier --write across the scene workspace.
scenes-format-fix:
cd $(SCENES_DIR) && npm run format:fix
## Report @dcl/* version mismatches across scene packages.
scenes-syncpack:
cd $(SCENES_DIR) && npm run syncpack:list
# ─────────────── explorer (C# / NUnit) ─────────────────────────────────────────
## Build the C# Tests project.
explorer-build:
dotnet build $(TESTS_DIR)
## Run the explorer suite (needs AltTester Desktop + instrumented client), then build + open the Allure report. Usage: make explorer-test [FILTER="FullyQualifiedName~ExplorePanelTests"]
explorer-test:
rm -rf $(TESTS_DIR)/bin/Debug/net10.0/allure-results
-dotnet test $(TESTS_DIR) $(if $(FILTER),--filter "$(FILTER)") --logger "console;verbosity=normal"
$(MAKE) explorer-report
## Build the Allure HTML report from the last explorer run and open it in the browser.
explorer-report:
allure generate --clean --single-file $(TESTS_DIR)/bin/Debug/net10.0/allure-results -o $(TESTS_DIR)/allure-report
open $(TESTS_DIR)/allure-report/index.html
## Print the InWorld fixtures that can reach a changed file, plus the member path. Usage: make explorer-scope FILES="explorer/Tests/Views/MinimapView.cs"
explorer-scope:
printf '%s\n' $(FILES) | dotnet run --project $(SCOPE_DIR) --nologo -v q
## Check the InWorld scope resolver against its golden closures.
explorer-scope-test:
dotnet run --project $(SCOPE_DIR) --nologo -v q -- --self-test
# ─────────────── web (Playwright) ──────────────────────────────────────────────
## Run the web suite (headless).
web-test:
cd $(WEB_DIR) && npm test
## Run the web suite with a visible browser.
web-test-headed:
cd $(WEB_DIR) && npm run test:headed
## Open Playwright's interactive UI mode for the web suite.
web-test-ui:
cd $(WEB_DIR) && npm run test:ui
## Type-check the web suite.
web-typecheck:
cd $(WEB_DIR) && npm run typecheck
## Open the last Playwright HTML report.
web-report:
cd $(WEB_DIR) && npm run report
# ─────────────── housekeeping ──────────────────────────────────────────────────
## Remove all node_modules + scene bin/ + dotnet bin/obj.
clean:
rm -rf $(SCENES_DIR)/node_modules
rm -rf $(SCENES_DIR)/packages/*/bin
rm -rf $(SCENES_DIR)/packages/*/main.crdt
rm -rf $(WEB_DIR)/node_modules
rm -rf $(TESTS_DIR)/bin $(TESTS_DIR)/obj