From e1f73c8286dad6d0797792cf1b482cfbaa316336 Mon Sep 17 00:00:00 2001 From: joaquim-verges Date: Fri, 28 Feb 2025 01:05:01 +0000 Subject: [PATCH] [SDK] chore: Re-enable flaky smart wallet tests (#6369) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ## PR-Codex overview This PR focuses on addressing flaky tests in the `thirdweb` codebase by enabling previously skipped tests related to `SmartWallet` functionality, ensuring they are executed as part of the test suite. ### Detailed summary - Removed `.github/workflows/issue.yml`. - Enabled `describe` and `test` blocks previously marked as skipped in: - `smart-wallet-modular.test.ts` - `verify-typed-data.test.ts` - `smart-wallet-integration-v07.test.ts` - Adjusted test configurations by removing `FIMXE` comments and retry limits. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` --- .github/workflows/issue.yml | 49 ------------------- .../src/auth/verify-typed-data.test.ts | 6 +-- .../smart-wallet-integration-v07.test.ts | 10 ++-- .../smart/smart-wallet-integration.test.ts | 1 - .../smart/smart-wallet-modular.test.ts | 3 +- 5 files changed, 6 insertions(+), 63 deletions(-) delete mode 100644 .github/workflows/issue.yml diff --git a/.github/workflows/issue.yml b/.github/workflows/issue.yml deleted file mode 100644 index 2c65e6d21f8..00000000000 --- a/.github/workflows/issue.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: Linked Issue - -on: - pull_request: - types: [opened, edited, ready_for_review] - -env: - VALID_ISSUE_PREFIXES: "CORE|TOOL|NEB|INFRA" - -jobs: - linear: - name: Linear - runs-on: ubuntu-latest - steps: - - name: Check for linked issue - uses: actions/github-script@v7 - with: - script: | - const pr = await github.rest.pulls.get({ - owner: context.repo.owner, - repo: context.repo.repo, - pull_number: context.issue.number - }); - - // Check if contributor is external - const isInternalContributor = ['MEMBER', 'OWNER', 'COLLABORATOR'].includes( - context.payload.pull_request.author_association - ); - - // Automatically pass for external contributors - if (!isInternalContributor) { - console.log('External contributor detected - automatically passing check'); - return; - } - - const body = pr.data.body || ''; - const branchName = pr.data.head.ref; - const issueRegex = new RegExp(`(${process.env.VALID_ISSUE_PREFIXES})-\\d+`, 'i'); - const branchIssueRegex = new RegExp(`(${process.env.VALID_ISSUE_PREFIXES.toLowerCase()})-\\d+`, 'i'); - - if (!issueRegex.test(body) && !branchIssueRegex.test(branchName)) { - core.setFailed( - `No valid issue reference found. PR body or branch name must contain an issue ID with one of these prefixes: ${process.env.VALID_ISSUE_PREFIXES}` - ); - return; - } - - const matches = body.match(issueRegex) || branchName.match(branchIssueRegex); - console.log(`Found issue reference: ${matches[0]}`); diff --git a/packages/thirdweb/src/auth/verify-typed-data.test.ts b/packages/thirdweb/src/auth/verify-typed-data.test.ts index 5f24b7080e8..14969954008 100644 --- a/packages/thirdweb/src/auth/verify-typed-data.test.ts +++ b/packages/thirdweb/src/auth/verify-typed-data.test.ts @@ -26,8 +26,7 @@ describe.runIf(process.env.TW_SECRET_KEY)("verifyTypedData", async () => { ).toBe(true); }); - // FIXME: flaky test - needs to be fixed - test.skip("invalid EOA signature", async () => { + test("invalid EOA signature", async () => { expect( await verifyTypedData({ ...typedData.basic, @@ -54,8 +53,7 @@ describe.runIf(process.env.TW_SECRET_KEY)("verifyTypedData", async () => { ).toBe(true); }); - // FIXME: flaky test - needs to be fixed - test.skip("invalid smart account signature", async () => { + test("invalid smart account signature", async () => { expect( await verifyTypedData({ ...typedData.basic, diff --git a/packages/thirdweb/src/wallets/smart/smart-wallet-integration-v07.test.ts b/packages/thirdweb/src/wallets/smart/smart-wallet-integration-v07.test.ts index 4cf3b60572a..8c304a0dc7f 100644 --- a/packages/thirdweb/src/wallets/smart/smart-wallet-integration-v07.test.ts +++ b/packages/thirdweb/src/wallets/smart/smart-wallet-integration-v07.test.ts @@ -49,11 +49,9 @@ const contract = getContract({ address: "0xe2cb0eb5147b42095c2FfA6F7ec953bb0bE347D8", }); -// FIXME: SKIP ALL OF THIS IT IS FLAKY -describe.skip( +describe.sequential( "SmartWallet 0.7 core tests", { - retry: 0, timeout: 240_000, }, () => { @@ -103,8 +101,7 @@ describe.skip( expect(isValid).toEqual(true); }); - // FIXME: flaky test - skipped - it.skip("should use ERC-1271 signatures after deployment", async () => { + it("should use ERC-1271 signatures after deployment", async () => { await deploySmartAccount({ chain, client, @@ -137,8 +134,7 @@ describe.skip( expect(isValid).toEqual(true); }); - // FIXME: flaky test - skipped - it.skip("should use ERC-1271 typed data signatures after deployment", async () => { + it("should use ERC-1271 typed data signatures after deployment", async () => { await deploySmartAccount({ chain, client, diff --git a/packages/thirdweb/src/wallets/smart/smart-wallet-integration.test.ts b/packages/thirdweb/src/wallets/smart/smart-wallet-integration.test.ts index 67e15e3022c..50f0c572916 100644 --- a/packages/thirdweb/src/wallets/smart/smart-wallet-integration.test.ts +++ b/packages/thirdweb/src/wallets/smart/smart-wallet-integration.test.ts @@ -51,7 +51,6 @@ const factoryAddress = "0x564cf6453a1b0FF8DB603E92EA4BbD410dea45F3"; // pre 712 describe.runIf(process.env.TW_SECRET_KEY).sequential( "SmartWallet core tests", { - retry: 0, timeout: 240_000, }, () => { diff --git a/packages/thirdweb/src/wallets/smart/smart-wallet-modular.test.ts b/packages/thirdweb/src/wallets/smart/smart-wallet-modular.test.ts index 10870d34a96..36e9c8870e8 100644 --- a/packages/thirdweb/src/wallets/smart/smart-wallet-modular.test.ts +++ b/packages/thirdweb/src/wallets/smart/smart-wallet-modular.test.ts @@ -28,8 +28,7 @@ const client = TEST_CLIENT; const DEFAULT_FACTORY_ADDRESS = "0xB1846E893CA01c5Dcdaa40371C1e13f2e0Df5717"; const DEFAULT_VALIDATOR_ADDRESS = "0x7D3631d823e0De311DC86f580946EeF2eEC81fba"; -// FIXME: This test is flaky and needs to be fixed -describe.skip.sequential( +describe.sequential( "SmartWallet modular tests", { retry: 0,