Repository navigation
e2e: split drafts.spec.ts and optimize dev Argon2id hashing - #239
Merged
Merged
Conversation
Split the 385-line single test in web/e2e/drafts.spec.ts (17 debug Argon2id hashes/verifies, 59.1s solo against the 60s budget) into four focused lifecycle tests reusing signed-in per-role browser contexts while preserving every assertion, and compile argon2 and blake2 at opt-level = 3 in dev/test builds so test sign-in/reset flows run at realistic Argon2id speed instead of unoptimized debug speed without changing any Argon2id parameters or raising timeouts. Closes #199
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Primary Issue
Closes #199
Problem And Outcome
e2e/drafts.spec.ts:113ran the entire daily-evaluation, review, finalization, export, trainee acknowledgment, packet, amendment, task signoff, and weekly summary lifecycle in one 385-line test performing 17 Argon2id hashes/verifies against an unoptimized debug binary. Even solo with 1 worker on this host it took 59.1s against the 60s test timeout, and under parallel suite load bothdrafts.spec.tsand unrelated/reset//loginassertions in other specs tripped timeouts because unoptimized debugargon2/blake2is ~30–50× slower than release.Splitting
drafts.spec.tsinto four focused lifecycle tests (reusing per-role browser contexts and preserving every existing assertion) and compilingargon2andblake2atopt-level = 3in dev/test builds brings the four tests to 4.7s–20.5s inside the full parallel suite and cuts full local E2E runtime from 16.5m to 4.6m without changing any Argon2id parameters or raising any timeouts.Changes
Cargo.toml[profile.dev.package.argon2]and[profile.dev.package.blake2]withopt-level = 3so dev/test password hashing runs at realistic release speed while keeping every Argon2id parameter (m=19456, t=2, p=1) unchanged.web/e2e/drafts.spec.tsopenSignedInContext), keeping all existing assertions intact:draft, collaborate, transfer, and submit a daily evaluationreview, request changes, approve, finalize, and export a daily evaluationtrainee acknowledges a finalized record, downloads a verified packet, and re-acknowledges an amendmentcoordinator signs off tasks with override reasons and links a finalized daily version into a weekly summaryVerification
Baseline (before fix)
main:npx playwright test e2e/drafts.spec.ts→ 59.1s (0.9s under the 60s timeout).cargo xtask proofprior run on loaded host:drafts.spec.tsexceeded 60s timeout (npm run e2etook 663–995s).Stress check (after split, before
opt-level = 3)npx playwright test e2e/drafts.spec.ts --repeat-each=3→ 12/12 passed across 3 parallel workers (24.4s–46.4s).After split + dev
argon2/blake2optimization (inside full parallel E2E suite)draft, collaborate, transfer, and submit a daily evaluation: 20.5sreview, request changes, approve, finalize, and export a daily evaluation: 11.9strainee acknowledges a finalized record, downloads a verified packet, and re-acknowledges an amendment: 7.5scoordinator signs off tasks with override reasons and links a finalized daily version into a weekly summary: 4.7sLocal proof receipt — passed
d71b3f6ca7acf6c67a4a027bb255363978fddad6tree9505744eb3386801fbd19b8a23690f970c47666b; unchanged during run: truecargo xtask proofin/data/dev/src/consolebook87f297e8dad4868f1364b29eb9a45b372ca3dc34e8e205c3505d15883036daa5/home/dev/.cache/ms-playwright/chromium-1254/chrome-linux64/chrome(Google Chrome for Testing 158.0.8127.18)target/debug/consolebook-serversha2564a53968554a2918a81253efff6b5dc7caf4b4aa0a69f1a44bc3ea00ec6ca2015a3575deff4d79ac07b095b00051459728cc0ad0ad1fa11543ee4af9230faf38c5d0bd902590fe37b5e4a8fb552805d76fe4fc2518a1d11ddb113bfdf59c9d179scripts/check-guidance-names.sh2b172a8e66c87574(cd web && npm ci && npm run check && npm run build)1d6925722aee3334cargo fmt --checke3b0c44298fc1c14cargo clippy --workspace --all-targets -- -D warnings149fdeeeff2df10fcargo test --workspace63ff7654a72956d5cargo build -p consolebook-server29b5eb7e6828fd2e(cd web && npx playwright install chromium && npm run e2e)a1b6bbf163d018beReview And Merge Notes
drafts.spec.ts) and the underlying debug-build Argon2id bottleneck inCargo.tomlwithout touching security parameters or global timeouts.