Skip to content

test: stop focusing bridge SDK tests#3

Open
1507819106zxzx-crypto wants to merge 1 commit into
BitgesellOfficial:mainfrom
1507819106zxzx-crypto:test-disable-focused-bridge-tests
Open

test: stop focusing bridge SDK tests#3
1507819106zxzx-crypto wants to merge 1 commit into
BitgesellOfficial:mainfrom
1507819106zxzx-crypto:test-disable-focused-bridge-tests

Conversation

@1507819106zxzx-crypto
Copy link
Copy Markdown

Summary:

  • Remove committed focused Jest tests from the bridge SDK suite so the full intended test inventory is visible again.
  • Mock bridge status/balance/contract reads in WBGLBridgeSDK tests so the default suite does not depend on live bridge HTTP responses or local private keys.
  • Gate the real BGL/WBGL swap integration tests behind RUN_BRIDGE_INTEGRATION_TESTS=true plus EVM_PRIVATE_KEY and BGL_PRIVATEKEY_OR_SEED, preventing accidental gas-spending/private-key tests in normal CI runs.

Verification:

  • npm test -- --runInBand (1 suite passed, 2 integration suites skipped by default; 8 passed, 4 skipped)
  • npx tsc -p tsconfig.json --skipLibCheck
  • git diff --check

Notes:

  • npm install --ignore-scripts currently hits the repo's existing eslint peer dependency conflict; I used --legacy-peer-deps for local verification.
  • npm run build:main currently fails before project sources on the latest transitive @types/node declarations with TypeScript 4.9, so I verified with skipLibCheck as a local dependency workaround.
  • npm run test:prettier still lists pre-existing non-test source files; the three changed test files are now formatted.

Related bounty: BitgesellOfficial/bitgesell#39
Payout address if accepted: 0x4451dF3D21925eF7a62D20eEdc80B99f7140C5D2

@MyTH-zyxeon
Copy link
Copy Markdown

Maintainer review note for the #81/#39 bounty queue:

I checked head f1d5790: this is a test-suite visibility fix for the bridge SDK, not a live bridge execution change. The key behavior is replacing focused tests with a RUN_BRIDGE_INTEGRATION_TESTS === "true" plus key-present guard, so secret-backed BGL/WBGL integration tests are skipped by default instead of silently narrowing the suite.

Acceptance checks:

  • Run the normal test command with no RUN_BRIDGE_INTEGRATION_TESTS, EVM_PRIVATE_KEY, or BGL_PRIVATEKEY_OR_SEED; the integration suites should be skipped cleanly while non-integration tests still run.
  • Run a repository-wide focused-test guard such as searching for .only( before merge, because this PR's purpose is preventing accidental focused Jest runs.
  • In a maintainer-owned secret environment only, run the gated integration tests with RUN_BRIDGE_INTEGRATION_TESTS=true to confirm the BGL/WBGL swap assertions still exercise the intended paths.
  • Confirm the formatting churn does not change bridge runtime code or transaction/key handling; this should remain test visibility and integration-test gating only.

No wallet/key/live-chain action from this review; do not run the integration path outside maintainer-controlled secrets.

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.

3 participants