diff --git a/.serena/memories/scripts/ci.md b/.serena/memories/scripts/ci.md index 335b4b03d8..0fccffc8d1 100644 --- a/.serena/memories/scripts/ci.md +++ b/.serena/memories/scripts/ci.md @@ -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`. diff --git a/backend/src/app/rpc/commands/management.clj b/backend/src/app/rpc/commands/management.clj index 1519e01ca5..9d75a78088 100644 --- a/backend/src/app/rpc/commands/management.clj +++ b/backend/src/app/rpc/commands/management.clj @@ -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 diff --git a/frontend/test/frontend_tests/plugins/tokens_test.cljs b/frontend/test/frontend_tests/plugins/tokens_test.cljs index 58054bca40..1124a9887b 100644 --- a/frontend/test/frontend_tests/plugins/tokens_test.cljs +++ b/frontend/test/frontend_tests/plugins/tokens_test.cljs @@ -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])))) diff --git a/scripts/ci b/scripts/ci index e2ed5cd6e0..280b081a8e 100755 --- a/scripts/ci +++ b/scripts/ci @@ -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" ) diff --git a/scripts/test_ci.py b/scripts/test_ci.py index 405f385d8e..6ad70101f5 100644 --- a/scripts/test_ci.py +++ b/scripts/test_ci.py @@ -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'."""