From cf2d1fac4a648070905f353efb38c086d8393ebe Mon Sep 17 00:00:00 2001 From: repo-worker-code Date: Sun, 1 Nov 2026 10:20:31 -0600 Subject: [PATCH] =?UTF-8?q?ci(id):=20run=20Roc=20library=20expect=20tests?= =?UTF-8?q?=20in=20CI=20=E2=80=94=20roc-test=20check=20+=20recipe=20(#813)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/scripts/id-pr-checks.txt | 1 + pkgs/id/flake.nix | 7 +- pkgs/id/just-recipes.json | 139 ++++++++++++++++++++++++++++++- pkgs/id/justfile | 19 ++++- 4 files changed, 161 insertions(+), 5 deletions(-) diff --git a/.github/scripts/id-pr-checks.txt b/.github/scripts/id-pr-checks.txt index be01f8ed59..af8e566528 100644 --- a/.github/scripts/id-pr-checks.txt +++ b/.github/scripts/id-pr-checks.txt @@ -36,6 +36,7 @@ test-shard-2 test-shard-3 test-web-unit test-web-typecheck +roc-test crash-gate-sampled crash-gate-sweep crash-gate-control diff --git a/pkgs/id/flake.nix b/pkgs/id/flake.nix index dc93a74435..9f7282d701 100644 --- a/pkgs/id/flake.nix +++ b/pkgs/id/flake.nix @@ -306,7 +306,7 @@ # Uses 'ci' command (read-only, no auto-fix modifications) # ======================================================================= checks = { - # CI-safe checks (read-only): cargo-fmt-check web-fmt-check clippy-lint web-lint test-sandbox test-web-unit test-web-typecheck doc build release + # CI-safe checks (read-only): cargo-fmt-check web-fmt-check clippy-lint web-lint test-sandbox test-web-unit test-web-typecheck roc-test doc build release # NixOS VM integration tests (Linux only): nixos-serve nixos-e2e default = mkCheck "ci" "ci"; @@ -330,6 +330,11 @@ test-web = mkCheck "test-web" "test-web-sandbox"; test-web-unit = mkCheck "test-web-unit" "test-web-unit"; test-web-typecheck = mkCheck "test-web-typecheck" "test-web-typecheck"; + # Roc library expect() tests (#813): runs the roc-test just + # recipe with the pinned nightly from nix/roc.nix (already in + # nativeBuildInputs); fails on a missing compiler or a failing + # expect — the world_compile.rs skip path is not reused here. + roc-test = mkCheck "roc-test" "roc-test"; doc = mkCheck "doc" "doc"; cargo-check = mkCheck "cargo-check" "cargo-check"; crash-gate = mkCheck "crash-gate" "crash-gate"; diff --git a/pkgs/id/just-recipes.json b/pkgs/id/just-recipes.json index 86e545c3b4..1d26ba8b53 100644 --- a/pkgs/id/just-recipes.json +++ b/pkgs/id/just-recipes.json @@ -78,6 +78,64 @@ "namepath": "root::chown", "shebang": true }, + "deploy-developing-today-backup": { + "attributes": [{ "group": "github-backup" }], + "body": [["nix run .#developing-today-backup-deploy -- ", [["variable", "args"]]]], + "dependencies": [], + "doc": "Deploy the developing-today-backup Worker via the nix flake app (wrangler versions flow; extra args go to deploy.mjs, e.g. --dry-run, --deploy-version to roll back)", + "name": "deploy-developing-today-backup", + "parameters": [ + { + "default": null, + "export": false, + "flag": false, + "help": null, + "kind": "star", + "long": null, + "max": null, + "min": null, + "multiple": false, + "name": "args", + "pattern": null, + "short": null, + "value": null + } + ], + "priors": 0, + "private": false, + "quiet": false, + "namepath": "root::deploy-developing-today-backup", + "shebang": false + }, + "deploy-pkarr": { + "attributes": [{ "group": "pkarr" }], + "body": [["nix run .#pkarr-deploy -- ", [["variable", "args"]]]], + "dependencies": [], + "doc": "Deploy the pkarr Worker via the nix flake app (cf versions flow; extra args go to deploy.mjs, e.g. --dry-run, --deploy-version to roll back)", + "name": "deploy-pkarr", + "parameters": [ + { + "default": null, + "export": false, + "flag": false, + "help": null, + "kind": "star", + "long": null, + "max": null, + "min": null, + "multiple": false, + "name": "args", + "pattern": null, + "short": null, + "value": null + } + ], + "priors": 0, + "private": false, + "quiet": false, + "namepath": "root::deploy-pkarr", + "shebang": false + }, "fix": { "attributes": [{ "group": "format" }], "body": [], @@ -140,6 +198,51 @@ "namepath": "root::fmt", "shebang": false }, + "github-backup-fetch": { + "attributes": [{ "group": "github-backup" }], + "body": [ + ["systemctl --user start github-backup-fetch.service"], + ["@systemctl --user status github-backup-fetch.service --no-pager | head -5"] + ], + "dependencies": [], + "doc": "Run the github-backup daily fetch now (via the installed systemd unit)", + "name": "github-backup-fetch", + "parameters": [], + "priors": 0, + "private": false, + "quiet": false, + "namepath": "root::github-backup-fetch", + "shebang": false + }, + "github-backup-reconcile": { + "attributes": [{ "group": "github-backup" }], + "body": [ + ["systemctl --user start github-backup-reconcile.service"], + ["@systemctl --user status github-backup-reconcile.service --no-pager | head -5"] + ], + "dependencies": [], + "doc": "Run the github-backup weekly reconciliation sweep now (via the installed systemd unit)", + "name": "github-backup-reconcile", + "parameters": [], + "priors": 0, + "private": false, + "quiet": false, + "namepath": "root::github-backup-reconcile", + "shebang": false + }, + "github-backup-units": { + "attributes": [{ "group": "github-backup" }], + "body": [["bash infra/github-backup/systemd/install-units.sh"]], + "dependencies": [], + "doc": "Install or refresh the github-backup laptop systemd units from this checkout", + "name": "github-backup-units", + "parameters": [], + "priors": 0, + "private": false, + "quiet": false, + "namepath": "root::github-backup-units", + "shebang": false + }, "id-mail-deploy": { "attributes": [{ "group": "mail" }], "body": [["nix run .#id-mail-deploy -- ", [["variable", "args"]]]], @@ -724,7 +827,7 @@ "windows_shell": null, "working_directory": null }, - "source": "/home/user/git/fleet/4094-2729-just-recipes-drift/root.just", + "source": "/home/user/git/fleet/4856/root.just", "unexports": [], "warnings": [] } @@ -1365,6 +1468,7 @@ { "arguments": [], "recipe": "test-sandbox", "star": null }, { "arguments": [], "recipe": "test-web-unit", "star": null }, { "arguments": [], "recipe": "test-web-typecheck", "star": null }, + { "arguments": [], "recipe": "roc-test", "star": null }, { "arguments": [], "recipe": "doc", "star": null }, { "arguments": [], "recipe": "build", "star": null }, { "arguments": [], "recipe": "release", "star": null } @@ -1372,7 +1476,7 @@ "doc": "CI-safe checks (read-only, no modifications) [bun]", "name": "ci", "parameters": [], - "priors": 11, + "priors": 12, "private": false, "quiet": false, "namepath": "ci", @@ -1982,6 +2086,35 @@ "namepath": "repl", "shebang": false }, + "roc-test": { + "attributes": [{ "group": "test" }], + "body": [ + ["#!/usr/bin/env bash"], + ["set -euo pipefail"], + ["if ! command -v roc >/dev/null 2>&1; then"], + [" echo \"roc-test: the pinned Roc compiler (nix/roc.nix) is not on PATH.\" >&2"], + [ + " echo \"roc-test: run inside 'nix develop' or the roc-test flake check — refusing to skip silently (#813).\" >&2" + ], + [" exit 1"], + ["fi"], + ["echo \"roc-test: $(roc version)\""], + ["for module in RocJson Screen Key; do"], + [" echo \"=== roc test examples/roc-world/${module}.roc ===\""], + [" roc test \"examples/roc-world/${module}.roc\""], + ["done"], + ["echo \"✓ Roc library expectations passed (RocJson, Screen, Key)\""] + ], + "dependencies": [], + "doc": "Run the Roc library expect() tests (RocJson, Screen, Key) with the pinned Roc compiler (#813)", + "name": "roc-test", + "parameters": [], + "priors": 0, + "private": false, + "quiet": false, + "namepath": "roc-test", + "shebang": true + }, "run": { "attributes": [{ "group": "run" }], "body": [["cargo run -- ", [["variable", "ARGS"]]]], @@ -3168,7 +3301,7 @@ "windows_shell": null, "working_directory": null }, - "source": "/home/user/git/fleet/4094-2729-just-recipes-drift/pkgs/id/justfile", + "source": "/home/user/git/fleet/4856/pkgs/id/justfile", "unexports": [], "warnings": [] } diff --git a/pkgs/id/justfile b/pkgs/id/justfile index 6b86d6efe0..b74d851e20 100644 --- a/pkgs/id/justfile +++ b/pkgs/id/justfile @@ -36,7 +36,7 @@ alias check-all := check # CI-safe checks (read-only, no modifications) [bun] [group('check')] -ci: cargo-fmt-check web-fmt-check cargo-check clippy-lint web-lint test-sandbox test-web-unit test-web-typecheck doc build release +ci: cargo-fmt-check web-fmt-check cargo-check clippy-lint web-lint test-sandbox test-web-unit test-web-typecheck roc-test doc build release @echo "✓ CI checks passed!" # Auto-fix formatting and lint issues @@ -332,6 +332,23 @@ test-web-unit: test-web-typecheck: cd web && bun run typecheck +# Run the Roc library expect() tests (RocJson, Screen, Key) with the pinned Roc compiler (#813) +[group('test')] +roc-test: + #!/usr/bin/env bash + set -euo pipefail + if ! command -v roc >/dev/null 2>&1; then + echo "roc-test: the pinned Roc compiler (nix/roc.nix) is not on PATH." >&2 + echo "roc-test: run inside 'nix develop' or the roc-test flake check — refusing to skip silently (#813)." >&2 + exit 1 + fi + echo "roc-test: $(roc version)" + for module in RocJson Screen Key; do + echo "=== roc test examples/roc-world/${module}.roc ===" + roc test "examples/roc-world/${module}.roc" + done + echo "✓ Roc library expectations passed (RocJson, Screen, Key)" + # Run nix flake check (27 sandboxed checks: lint, test, E2E, NixOS VM tests, VM Playwright) [group('test')] test-nix: