🔧 Fix CI module commands

Set a default key for exporter tests and use the library format script.
Add dry-run tests for both commands. Format the backend merge resolution.
Align the token test with its selected fixture.

AI-assisted-by: gpt-6-luna
This commit is contained in:
Andrey Antukh 2026-11-20 17:55:21 +00:00
parent adb61a9b96
commit 0572645d97
5 changed files with 44 additions and 25 deletions

View File

@ -111,6 +111,9 @@ produce deployable artifacts.
- `mcp` has no lint task and `media-processor` has no lint task; both show
as skipped. `render-wasm` uses `./lint`, `./test`, and `./fmt`.
- The exporter test task supplies `PENPOT_SECRET_KEY=test-secret-key` when the
environment does not set it, matching the package's regular test command.
The library format task uses its `check-fmt` script.
- `scripts/test_ci.py` (unittest, `python3 scripts/test_ci.py`) covers the
flag wiring, one build command per module and the help text through
`--dry-run`; it executes no real build.
@ -118,7 +121,8 @@ produce deployable artifacts.
existing value, so backend test runs compile in and exercise
precondition asserts; see `mem:backend/testing`.
- Test and build tasks are long-running (backend: `clojure -M:dev:test`;
frontend build: ~2 min warm); use a generous timeout when calling it from
an agent shell.
frontend build: ~2 min warm). Use a timeout of at least 20 minutes when
running the complete CI across all modules; shorter limits can terminate
valid checks before they finish.
- Skill entry point: `.agents/skills/local-ci/SKILL.md`.
- Testing principles and output discipline: `mem:testing`.

View File

@ -25,9 +25,9 @@
[app.rpc.commands.projects :as proj]
[app.rpc.commands.teams :as teams]
[app.rpc.doc :as-alias doc]
[app.rpc.notifications :as ntf]
[app.rpc.permissions :as perms]
[app.rpc.helpers :as rph]
[app.rpc.helpers :as rph]
[app.rpc.notifications :as ntf]
[app.rpc.permissions :as perms]
[app.setup :as-alias setup]
[app.setup.templates :as tmpl]
[app.storage.tmp :as tmp]
@ -371,19 +371,19 @@
(recur (rest project-ids)
(ct/plus modified-at 10))))
;; Moving files can take them out of the reach of the team they came
;; from. Only the open connections know who was relying on them, so
;; the source teams are announced wholesale and the watcher re-checks
;; each member against the subscriptions they actually hold.
(notify-team-access-changed
cfg
(keep (partial perms/get-team-id-for-project conn) source))
;; Moving files can take them out of the reach of the team they came
;; from. Only the open connections know who was relying on them, so
;; the source teams are announced wholesale and the watcher re-checks
;; each member against the subscriptions they actually hold.
(notify-team-access-changed
cfg
(keep (partial perms/get-team-id-for-project conn) source))
;; Both teams travel explicitly in the event props so a consumer
;; never joins production tables.
(rph/with-meta (rph/wrap)
{::audit/props {:source-team-id (first source-teams)
:dest-team-id (:id dest-team)}}))))
;; Both teams travel explicitly in the event props so a consumer
;; never joins production tables.
(rph/with-meta (rph/wrap)
{::audit/props {:source-team-id (first source-teams)
:dest-team-id (:id dest-team)}}))))
(def ^:private
schema:move-files

View File

@ -957,12 +957,10 @@
^js token-set (aget (.-sets catalog) 0)
^js token (aget (.-tokens token-set) 0)]
(.applyToSelected token #js ["fill"])
(doseq [label [:rect1 :rect2 :rect3]]
(let [shape-path [:files (:id file) :data :pages-index page-id :objects (cthi/id label)]]
(await (async/wait-for-store store #(= "color.primary" (get-in @store (conj shape-path :applied-tokens :fill)))
(str "apply external token to " label)))
(await (async/wait-for-store store #(= "#ff0000" (get-in @store (conj shape-path :fills 0 :fill-color)))
(str "resolve external token on " label)))))
(await (async/wait-for #(= "color.primary" (get-in @store (conj shape-path :applied-tokens :fill)))
"apply external token to the selection"))
(await (async/wait-for #(= "#ff0000" (get-in @store (conj shape-path :fills 0 :fill-color)))
"resolve external token on the selection"))
(t/is (= (ctht/get-tokens-lib file) (get-in @store [:files (:id file) :data :tokens-lib])))
(t/is (= (datafy (ctht/get-tokens-status file))
(datafy (get-in @store [:files (:id file) :data :tokens-status]))))

View File

@ -44,7 +44,7 @@ declare -A TEST_CMD=(
[backend]="clojure -M:dev:test"
[common]="clojure -M:dev:test && pnpm run test:quiet"
[render-wasm]="./test"
[exporter]="pnpm run test:quiet"
[exporter]="PENPOT_SECRET_KEY=${PENPOT_SECRET_KEY:-test-secret-key} pnpm run test:quiet"
[mcp]="pnpm run test"
[plugins]="pnpm run test"
[library]="pnpm run test"
@ -59,7 +59,7 @@ declare -A FMT_CHECK_CMD=(
[exporter]="pnpm run check-fmt:clj"
[mcp]="pnpm run fmt:check"
[plugins]="pnpm run format:check"
[library]="pnpm run check-fmt:clj"
[library]="pnpm run check-fmt"
[media-processor]="pnpm run fmt:check"
)

View File

@ -129,6 +129,23 @@ class MediaProcessorModuleTests(unittest.TestCase):
)
class ModuleCommandTests(unittest.TestCase):
def test_exporter_test_sets_the_default_secret_key(self):
code, out = run_ci("--test", "--dry-run", "exporter")
self.assertEqual(code, 0, out)
self.assertIn(
"PENPOT_SECRET_KEY=test-secret-key pnpm run test:quiet",
out,
)
def test_library_format_check_uses_its_declared_script(self):
code, out = run_ci("--fmt", "--dry-run", "library")
self.assertEqual(code, 0, out)
self.assertIn("pnpm run check-fmt", out)
class HelpTests(unittest.TestCase):
def help_options(self, out):
"""Option tokens from the OPTIONS section, e.g. '--build'."""