Skip to content

chore: refactor proposal cancel tests [CLD-2769]#808

Open
ecPablo wants to merge 15 commits into
mainfrom
ecpablo/refactor-proposal-cancel-tests
Open

chore: refactor proposal cancel tests [CLD-2769]#808
ecPablo wants to merge 15 commits into
mainfrom
ecpablo/refactor-proposal-cancel-tests

Conversation

@ecPablo

@ecPablo ecPablo commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

This pull request introduces new end-to-end tests for the "schedule and cancel" timelock proposal flow on EVM and Solana chains, and refactors existing tests for Aptos and TON chains to use a shared test harness in e2e/tests/common. This change improves test coverage and consistency across chains while reducing code duplication.

New E2E Tests:

  • Added a new test, TestScheduleAndCancelProposal, for EVM in e2e/tests/evm/timelock_schedule_cancel.go, covering scheduling and then canceling a timelock proposal and verifying no role is granted after cancellation.
  • Added a new test, TestScheduleAndCancelProposal, for Solana in e2e/tests/solana/timelock_schedule_cancel.go, covering the analogous flow for Solana and ensuring proper cancellation.

Refactoring for Code Reuse and Consistency:

  • Refactored Aptos and TON schedule/cancel tests to use the shared e2ecommon.RunScheduleAndCancelTest harness and types from e2e/tests/common, replacing previous direct usage of mcmslib types and helpers. This improves maintainability and standardizes test logic across chains. [1] [2] [3] [4] [5] [6] [7] [8]

krebernisak and others added 14 commits June 25, 2026 14:18
… reused by other chain

Signed-off-by: Pablo <pablo.estrada@smartcontract.com>
# Conflicts:
#	e2e/tests/aptos/timelock_cancel.go
#	e2e/tests/ton/executable.go
Signed-off-by: Pablo <pablo.estrada@smartcontract.com>
Signed-off-by: Pablo <pablo.estrada@smartcontract.com>
Signed-off-by: Pablo <pablo.estrada@smartcontract.com>
Signed-off-by: Pablo <pablo.estrada@smartcontract.com>
@ecPablo ecPablo changed the title chore: refactor proposal cancel tests chore: refactor proposal cancel tests [CLD-2769] Jul 8, 2026
@ecPablo ecPablo requested a review from Copilot July 8, 2026 15:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the timelock schedule→cancel E2E lifecycle into a reusable runner (e2e/tests/common) and updates multiple chain suites (Aptos, TON) to use it, while adding new E2E coverage for EVM and Solana.

Changes:

  • Added a shared E2E schedule/cancel test runner with configurable hooks (e2e/tests/common/timelock_schedule_cancel.go).
  • Updated Aptos and TON E2E tests to use the shared runner; added new E2E schedule/cancel tests for EVM and Solana.
  • Added a similar schedule/cancel runner under mcms package tests (but it currently diverges from the E2E runner in important correctness details).

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
test_runner_timelock_schedule_cancel_test.go Adds a package-level test runner for schedule/cancel flow; currently has correctness issues for multi-op conversions and “not found” post-cancel behavior.
e2e/tests/common/timelock_schedule_cancel.go Introduces the shared E2E runner and helper utilities for schedule/cancel lifecycle.
e2e/tests/aptos/timelock_cancel.go Refactors Aptos cancel E2E test to use the shared runner and chain-specific metadata override.
e2e/tests/ton/executable.go Switches TON schedule/cancel E2E coverage to use the shared runner.
e2e/tests/evm/timelock_schedule_cancel.go Adds EVM E2E schedule/cancel test using the shared runner and EVM-specific finality/assertions.
e2e/tests/solana/timelock_schedule_cancel.go Adds Solana E2E schedule/cancel test using the shared runner and Solana-specific wiring.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ecPablo ecPablo marked this pull request as ready for review July 8, 2026 17:33
@ecPablo ecPablo requested a review from a team as a code owner July 8, 2026 17:33
@ecPablo ecPablo enabled auto-merge (squash) July 8, 2026 22:53
Copilot AI review requested due to automatic review settings July 8, 2026 22:54
@cl-sonarqube-production

Copy link
Copy Markdown

@gustavogama-cll gustavogama-cll Jul 8, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

aren't we duplicating a lot of code now? It seems that test_runner_timelock_schedule_cancel_test.go and e2e/tests/common/timelock_schedule_cancel.go are very similar now.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

maybe timelock_executable_test.go::TestScheduleAndExecuteProposal is now redundant? At least partially?

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.

Comment on lines +117 to +121
WaitForTransaction: func(ctx context.Context, t *testing.T, tx types.TransactionResult) {
t.Helper()
_, err := solana.SignatureFromBase58(tx.Hash)
require.NoError(t, err)
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants