Skip to content

refactor(test-suite): refactor negative ACL e2e tests into consistent pattern#2101

Merged
mergify[bot] merged 11 commits intomainfrom
malatrax/refactor/1152/test-suite-negative-acl-tests
Mar 16, 2026
Merged

refactor(test-suite): refactor negative ACL e2e tests into consistent pattern#2101
mergify[bot] merged 11 commits intomainfrom
malatrax/refactor/1152/test-suite-negative-acl-tests

Conversation

@zmalatrax
Copy link
Copy Markdown
Contributor

@zmalatrax zmalatrax requested a review from a team as a code owner March 12, 2026 11:30
@cla-bot cla-bot bot added the cla-signed label Mar 12, 2026
@mergify
Copy link
Copy Markdown

mergify bot commented Mar 12, 2026

🧪 CI Insights

Here's what we observed from your CI run for e427987.

🟢 All jobs passed!

But CI Insights is watching 👀

@eudelins-zama
Copy link
Copy Markdown
Contributor

@claude /pr-review

@claude
Copy link
Copy Markdown

claude bot commented Mar 13, 2026

Claude finished @eudelins-zama's request.View run

claude[bot]
claude bot previously approved these changes Mar 13, 2026
Copy link
Copy Markdown

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[AUTOMATED]

Code Review

PR: refactor(test-suite): refactor negative ACL e2e tests into consistent pattern

Summary

This PR refactors negative (failure-path) ACL e2e tests across 4 test files into a consistent describe('negative', ...) pattern, adds a negative-acl test type to the CLI, and adds a corresponding CI workflow step. The changes are well-structured and maintain test correctness.

Review Results

Agent Focus Findings
Bug Hunter (×2) Bugs & security ✅ No issues found
Guideline Compliance Convention adherence ✅ No violations found
Error Handling Auditor Silent failures ✅ No issues found

Analysis Highlights

Grep pattern safety (-g "negative"): Verified that the Mocha grep pattern "negative" used by the new negative-acl test type will only match the four newly introduced describe('negative', ...) blocks. No existing test names in the e2e suite contain the substring "negative", so there is no risk of accidentally running unintended tests.

Test state preservation: Each extracted negative test properly sets up its own state or correctly relies on the shared before/beforeEach hooks from the parent describe block. Specifically:

  • EncryptedERC20.ts: The new standalone test correctly replicates the mint + transfer setup from the original positive test
  • userDecryption.ts: All four extracted tests re-obtain handles and generate fresh keypairs; shared contract state from the before hook is sufficient
  • delegatedUserDecryption.ts: Pure structural wrap with no logic changes
  • httpPublicDecrypt.ts: The xBoolxUint8 change is functionally equivalent for testing ACL rejection

Error handling in tests: The try/catch patterns used in negative tests are safe — expect.fail() throws AssertionError with messages that would never match the specific error strings being asserted in catch blocks.

No issues found. Checked for bugs, guideline compliance, and error handling.

@claude
Copy link
Copy Markdown

claude bot commented Mar 13, 2026

The review has been posted. Here's a summary:


Code Review Summary — PR #2101

PR: refactor(test-suite): refactor negative ACL e2e tests into consistent pattern

Verdict: ✅ Approved

All four specialized review agents (2× Bug Hunter, Guideline Compliance, Error Handling Auditor) found no issues meeting the high-confidence threshold (≥80/100).

Key Points Verified

  1. Grep pattern safety — The -g "negative" Mocha grep pattern will only match the four newly introduced describe('negative', ...) blocks. No existing tests contain "negative" in their names.

  2. Test state preservation — Each extracted negative test correctly sets up its own state or properly relies on shared before/beforeEach hooks. No test logic was lost in the refactoring.

  3. xBoolxUint8 change — Functionally equivalent for testing ACL rejection (the FHE type is irrelevant to the public-decryption ACL check).

  4. Error handling patterns — The try/catch blocks in negative tests are safe and cannot accidentally swallow test framework assertion failures.

eudelins-zama
eudelins-zama previously approved these changes Mar 13, 2026
Copy link
Copy Markdown
Contributor

@eudelins-zama eudelins-zama left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zmalatrax zmalatrax dismissed stale reviews from eudelins-zama and claude[bot] via f1d61f2 March 13, 2026 12:10
eudelins-zama
eudelins-zama previously approved these changes Mar 13, 2026
@zmalatrax zmalatrax force-pushed the malatrax/refactor/1152/test-suite-negative-acl-tests branch from dc2314f to 080ad58 Compare March 13, 2026 13:29
@zmalatrax
Copy link
Copy Markdown
Contributor Author

@mergify queue

@mergify
Copy link
Copy Markdown

mergify bot commented Mar 16, 2026

Merge Queue Status

This pull request spent 1 hour 34 minutes 56 seconds in the queue, including 34 minutes 44 seconds running CI.

Required conditions to merge
  • #approved-reviews-by >= 1 [🛡 GitHub branch protection]
  • #changes-requested-reviews-by = 0 [🛡 GitHub branch protection]
  • #review-threads-unresolved = 0 [🛡 GitHub branch protection]
  • branch-protection-review-decision = APPROVED [🛡 GitHub branch protection]
  • check-success = run-e2e-tests / fhevm-e2e-test
  • any of [🛡 GitHub branch protection]:
    • check-success = common-pull-request/lint (bpr)
    • check-neutral = common-pull-request/lint (bpr)
    • check-skipped = common-pull-request/lint (bpr)
  • any of [🛡 GitHub branch protection]:
    • check-skipped = coprocessor-cargo-listener-tests/cargo-tests (bpr)
    • check-neutral = coprocessor-cargo-listener-tests/cargo-tests (bpr)
    • check-success = coprocessor-cargo-listener-tests/cargo-tests (bpr)
  • any of [🛡 GitHub branch protection]:
    • check-skipped = coprocessor-cargo-test/cargo-tests (bpr)
    • check-neutral = coprocessor-cargo-test/cargo-tests (bpr)
    • check-success = coprocessor-cargo-test/cargo-tests (bpr)
  • any of [🛡 GitHub branch protection]:
    • check-skipped = coprocessor-dependency-analysis/dependencies-check (bpr)
    • check-neutral = coprocessor-dependency-analysis/dependencies-check (bpr)
    • check-success = coprocessor-dependency-analysis/dependencies-check (bpr)
  • any of [🛡 GitHub branch protection]:
    • check-skipped = gateway-contracts-deployment-tests/sc-deploy (bpr)
    • check-neutral = gateway-contracts-deployment-tests/sc-deploy (bpr)
    • check-success = gateway-contracts-deployment-tests/sc-deploy (bpr)
  • any of [🛡 GitHub branch protection]:
    • check-skipped = kms-connector-tests/test-connector (bpr)
    • check-neutral = kms-connector-tests/test-connector (bpr)
    • check-success = kms-connector-tests/test-connector (bpr)

@mergify mergify bot added the queued label Mar 16, 2026
mergify bot added a commit that referenced this pull request Mar 16, 2026
@mergify mergify bot merged commit 7c5dc38 into main Mar 16, 2026
64 of 66 checks passed
@mergify mergify bot deleted the malatrax/refactor/1152/test-suite-negative-acl-tests branch March 16, 2026 10:08
@mergify mergify bot removed the queued label Mar 16, 2026
mergify bot added a commit that referenced this pull request Mar 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants