Repository navigation
Expand file tree
/
Copy pathjustfile
More file actions
171 lines (139 loc) · 6.47 KB
/
Copy pathjustfile
File metadata and controls
171 lines (139 loc) · 6.47 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
# VIP - Verified Installation of Posit
# Exact uv version used to regenerate uv.lock. Must satisfy the
# `required-version` floor in pyproject.toml's [tool.uv]. Bump both together.
UV_VERSION := "0.11.28"
# List available recipes
default:
@just --list
# Install all dependencies (system packages where possible, plus Playwright)
setup:
uv sync
uv run vip install
# Same as `setup` — kept for muscle memory; vip install handles RHEL detection.
setup-rhel: setup
# Use this instead of a bare `uv lock`: `uvx` fetches the exact pinned uv, so
# the lockfile is byte-reproducible even when your local uv is a different
# version. This is also how you resolve a uv.lock merge conflict — take either
# side, then relock:
# git checkout --theirs -- uv.lock && just relock
# Regenerate uv.lock with the pinned uv version (see UV_VERSION above).
relock:
uvx --from uv=={{ UV_VERSION }} uv lock
# Run ruff linter
# --extra dev: ruff is in the dev extra, which a bare `uv sync` does not install;
# without it, `uv run ruff` falls back to whatever ruff is on PATH instead of the pinned version.
lint:
uv run --extra dev ruff check .
# Run ruff formatter check (fails if files would change)
format-check:
uv run --extra dev ruff format --check .
# Auto-fix lint issues
lint-fix:
uv run --extra dev ruff check --fix .
# Format code in place
format:
uv run --extra dev ruff format .
# Run all checks (lint + format)
check: lint format-check
# Auto-fix everything (lint fixes + formatting)
fix: lint-fix format
# Run mypy type checker
# --all-extras, not --extra dev: load_engine.py imports locust (the `load` extra), and
# ignore_missing_imports silently drops that import's real errors when it isn't installed.
typecheck:
uv run --all-extras mypy src/vip src/vip_tests selftests
# Run selftests with coverage
# --extra dev: pytest-cov is in the dev extra, which a bare `uv sync` does not install.
coverage:
uv run --extra dev pytest selftests/ --cov=src/vip --cov-report=term-missing
# Run selftests (no products required)
selftest *ARGS:
uv run pytest selftests/ {{ ARGS }}
# Run the full VIP test suite against configured products
test *ARGS:
uv run pytest src/vip_tests/ {{ ARGS }}
# Run tests for a specific product (connect, workbench, package_manager)
test-product PRODUCT:
uv run pytest src/vip_tests/ -m {{ PRODUCT }}
# Generate the Quarto report from product test results
report *ARGS:
uv run pytest src/vip_tests/ {{ ARGS }}
cd report && uv run quarto render
# Generate test catalog and feature matrix JSON for the website
website-data:
uv run python scripts/generate-test-catalog.py
uv run python scripts/generate-feature-matrix.py
# Catch a .env left over from before the Posit image migration. Compose reads
# .env itself (this justfile sets no dotenv-load), and every license variable
# there resolves through `${PWB_LICENSE:-}`, so a stale RSW_/RSC_/RSPM_ name
# yields an unlicensed container that fails minutes later as an opaque
# health-check timeout. Compose's `${VAR:?}` form would report it immediately
# but also aborts `docker compose down`, so the check lives here instead.
[private]
_check-env:
#!/usr/bin/env bash
set -euo pipefail
[ -f .env ] || exit 0
stale=$(grep -oE '^(RSW|RSC|RSPM)_(LICENSE|VERSION)' .env || true)
if [ -n "$stale" ]; then
echo "error: .env still uses pre-migration variable names:" >&2
printf ' %s\n' $stale >&2
echo " Rename them (see .env.example):" >&2
echo " RSW_LICENSE -> PWB_LICENSE RSW_VERSION -> PWB_VERSION" >&2
echo " RSC_LICENSE -> PCT_LICENSE RSC_VERSION -> PCT_VERSION" >&2
echo " RSPM_LICENSE -> PPM_LICENSE RSPM_VERSION -> PPM_VERSION" >&2
exit 1
fi
# Start the local docker-compose dev environment
compose-up *SERVICES: _check-env
docker compose up -d --wait {{ SERVICES }}
@docker compose ps
# Stop the local docker-compose dev environment
compose-down:
docker compose down
# Run VIP tests against the local docker-compose environment (Workbench only by default)
test-local *ARGS: _check-env
docker compose up -d --wait
uv run vip verify --config vip.toml.local --categories workbench {{ ARGS }}
# Run VIP tests against the full local stack (requires PCT_LICENSE and PPM_LICENSE).
# Passes URL flags directly so Connect and PM don't need to be enabled in vip.toml.local.
test-local-full *ARGS: _check-env
docker compose --profile full up -d --wait
uv run vip verify --connect-url http://localhost:3939 --workbench-url http://localhost:8787 --package-manager-url http://localhost:4242 {{ ARGS }}
# Generate a Quarto report from selftests (for CI / demo purposes)
report-selftest:
uv run pytest selftests/
cd report && uv run quarto render
# Start the mock-IdP E2E stack (Keycloak + Connect + Workbench, real OIDC).
# Requires PCT_LICENSE and PWB_LICENSE. Add vip.test hostnames to /etc/hosts
# first: `127.0.0.1 keycloak.vip.test connect.vip.test workbench.vip.test`.
mock-idp-up: _check-env
docker compose -f compose.mock-idp.yml up -d --build --wait
@docker compose -f compose.mock-idp.yml ps
# Stop the mock-IdP E2E stack and remove its volumes (certs, realm state, home dirs)
mock-idp-down:
docker compose -f compose.mock-idp.yml down -v
# (issue #263: Workbench behind SAML on a separate hostname from Connect).
# Same requirements as `mock-idp-up`, plus add workbench-saml.vip.test to
# /etc/hosts: `127.0.0.1 keycloak.vip.test connect.vip.test workbench.vip.test workbench-saml.vip.test`.
# Start the mock-IdP E2E stack with the SAML Workbench lane also enabled.
mock-idp-saml-up: _check-env
docker compose -f compose.mock-idp.yml --profile saml up -d --build --wait
@docker compose -f compose.mock-idp.yml --profile saml ps
# Export it before running `vip verify --headless-auth` locally:
# export VIP_TEST_TOTP_SECRET=$(just mock-idp-totp-secret)
# Print the mock-IdP stack's auto-generated TOTP seed.
mock-idp-totp-secret:
@docker run --rm -v vip-mock-idp_mock-idp-certs:/certs:ro alpine/openssl:3.5.4 cat /certs/totp-secret.b32
# Build and run the RHEL 9 headless Chromium smoke test
rhel9-smoke:
./scripts/rhel-smoke.sh 9
# Build and run the RHEL 10 headless Chromium smoke test
rhel10-smoke:
./scripts/rhel-smoke.sh 10
# Build and run the openSUSE Leap headless Chromium smoke test
opensuse-leap-smoke:
./scripts/opensuse-leap-smoke.sh
# Build and run the Ubuntu 24.04 headless Chromium smoke test (also proves #621)
ubuntu2404-smoke:
./scripts/ubuntu2404-smoke.sh