-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
98 lines (74 loc) · 3.08 KB
/
Copy pathjustfile
File metadata and controls
98 lines (74 loc) · 3.08 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
set shell := ["bash", "-euo", "pipefail", "-c"]
# Shared test VM is managed by zfskit's justfile (one VM, port 2226,
# both projects' integration tests use it). vm-up / vm-down delegate so
# there's exactly one source of truth.
ZFSKIT_DIR := env_var('HOME') + "/code/zfskit"
SSH_PORT := "2226"
SSH_TARGET := "root@localhost:" + SSH_PORT
# Show this list
default:
@just --list
# ─── Cargo ─────────────────────────────────────────────
check:
cargo check --workspace
test:
cargo test --workspace
lint:
cargo clippy --workspace --all-targets -- -D warnings
fmt:
cargo fmt --all
fmt-check:
cargo fmt --all -- --check
# Full pre-push gate: Rust checks plus the complete Vite+ frontend workflow.
ci: fmt-check lint test
cd admin-ui && vp install && vp check && vp test && vp run build
# ─── Admin UI ──────────────────────────────────────────
# Install JS deps + typecheck + build the Vue SPA into admin-ui/dist.
# The daemon's build.rs embeds that directory via memory-serve.
build-ui:
cd admin-ui && vp install && vp run build
# Release artifact: UI bundle first, then cargo release build.
build: build-ui
cargo build --release -p arctern-daemon
# Regenerate admin-ui/openapi.json + TypeScript client from the live
# router. Re-run whenever crates/api types or handler signatures change.
openapi:
cargo run -q -p arctern-daemon -- openapi > admin-ui/openapi.json
cd admin-ui && vp exec openapi-ts
# Vite dev server with hot reload. Proxies /api/v1 and /api-docs to
# the daemon's loopback bind on 127.0.0.1:7878 (start the daemon
# separately in another shell).
ui-dev:
cd admin-ui && vp dev
# ─── VM lifecycle (delegates to zfskit) ────────────
vm-up:
just --justfile {{ZFSKIT_DIR}}/justfile vm-up
vm-down:
just --justfile {{ZFSKIT_DIR}}/justfile vm-down
vm-ssh:
just --justfile {{ZFSKIT_DIR}}/justfile vm-ssh
vm-log:
just --justfile {{ZFSKIT_DIR}}/justfile vm-log
# Sweep stale zfskit_test_* pools/files inside the VM.
test-cleanup:
just --justfile {{ZFSKIT_DIR}}/justfile test-cleanup
# ─── Integration tests ─────────────────────────────────
# Requires the VM to be running (`just vm-up`).
test-integration:
ZFSKIT_SSH_TARGET={{SSH_TARGET}} \
ZFSKIT_SSH_PASSWORD="" \
cargo test -p arctern-daemon --features integration -- --test-threads=1
# Real OpenSSH forced-command control-channel test. Requires the shared VM.
test-openssh: vm-up
ZFSKIT_SSH_TARGET={{SSH_TARGET}} \
ZFSKIT_SSH_PASSWORD="" \
ARCTERN_OPENSSH_INTEGRATION=1 \
cargo test -p arctern-daemon --test integration_openssh_forced_command --features integration -- --nocapture
# One-shot: vm-up + integration + vm-down. For CI / clean checks.
test-vm: vm-up
#!/usr/bin/env bash
set -uo pipefail
rc=0
just test-integration || rc=$?
just vm-down
exit "$rc"