-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
84 lines (67 loc) · 2.96 KB
/
Copy pathMakefile
File metadata and controls
84 lines (67 loc) · 2.96 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
.PHONY: fresh clean test-all test-all-tmux test-aidbox test-hapi test-medplum test-msfhir test-fhir-candle ui-dist ui-serve clean-dist format format-check
# Optional test filters (consumed by bin/run.ts via env).
# FILTER — jest test-path regex (matches against test file paths)
# NAME — jest -t name pattern (matches describe/it titles)
# Examples:
# make test-all FILTER=CRUD
# make test-aidbox FILTER=CRUD NAME='create returns 201'
# make test-all-tmux FILTER=validation
# make test-aidbox FILTER=validation-op # just tests/validation/$validation-op.ts
export FILTER
export NAME
clean:
rm -rf $(RESULTS) $(DIST)
fresh:
$(MAKE) clean
$(MAKE) test-all
$(MAKE) ui-dist
RESULTS := .results
DIST := dist
test-all:
FHIR262_CI=1 $(MAKE) -j5 -k test-aidbox test-hapi test-medplum test-msfhir test-fhir-candle
TMUX_SESSION := fhir262-tests
# Same impls as test-all, but each run gets its own tmux pane so output
# streams live side-by-side. When a run finishes, its pane drops into an
# interactive shell so the output stays visible — exit the shell to close
# the pane; the session closes when the last pane exits.
test-all-tmux:
$(MAKE) clean
@command -v tmux >/dev/null || { echo "tmux is required for test-all-tmux"; exit 1; }
@mkdir -p $(RESULTS)
@tmux kill-session -t $(TMUX_SESSION) 2>/dev/null || true
@# Inline FILTER/NAME on each pane's command: an already-running tmux server
@# uses its own env snapshot for new sessions, so `export` in this Makefile
@# doesn't reach the panes. Setting them on the command line is reliable.
@tmux new-session -d -s $(TMUX_SESSION) "FILTER='$(FILTER)' NAME='$(NAME)' $(MAKE) test-aidbox; exec $$SHELL"
@tmux split-window -t $(TMUX_SESSION) "FILTER='$(FILTER)' NAME='$(NAME)' $(MAKE) test-hapi; exec $$SHELL"
@tmux split-window -t $(TMUX_SESSION) "FILTER='$(FILTER)' NAME='$(NAME)' $(MAKE) test-medplum; exec $$SHELL"
@tmux split-window -t $(TMUX_SESSION) "FILTER='$(FILTER)' NAME='$(NAME)' $(MAKE) test-msfhir; exec $$SHELL"
@tmux split-window -t $(TMUX_SESSION) "FILTER='$(FILTER)' NAME='$(NAME)' $(MAKE) test-fhir-candle; exec $$SHELL"
@tmux select-layout -t $(TMUX_SESSION) tiled
@tmux attach -t $(TMUX_SESSION)
test-aidbox:
@mkdir -p $(RESULTS)
bun bin/run.ts -impl impl/aidbox/index.ts -out $(RESULTS)/aidbox.json
test-hapi:
@mkdir -p $(RESULTS)
bun bin/run.ts -impl impl/hapi/index.ts -out $(RESULTS)/hapi.json
test-medplum:
@mkdir -p $(RESULTS)
bun bin/run.ts -impl impl/medplum/index.ts -out $(RESULTS)/medplum.json
test-msfhir:
@mkdir -p $(RESULTS)
bun bin/run.ts -impl impl/msfhir/index.ts -out $(RESULTS)/msfhir.json
test-fhir-candle:
@mkdir -p $(RESULTS)
bun bin/run.ts -impl impl/fhir-candle/index.ts -out $(RESULTS)/fhir-candle.json
ui-dist:
bun bin/build.ts -results $(RESULTS) -dist $(DIST)
ui-serve: ui-dist
@echo "Serving $(DIST) on http://localhost:8000"
@python3 -m http.server -d $(DIST) 8000
clean-dist:
rm -rf $(DIST)
format:
bunx biome format --write .
format-check:
bunx biome format .