From 2f506021adada07eb5a8a2a4e836d2ba8be104db Mon Sep 17 00:00:00 2001 From: Linden <70739041+linden@users.noreply.github.com> Date: Fri, 21 Nov 2025 17:23:47 -0800 Subject: [PATCH 1/2] fix(`spark-sdk`): skip minikube dependent tests when unavailable --- .../spark-sdk/src/tests/integration/transfer.test.ts | 7 +++---- .../src/tests/integration/unilateral-exit.test.ts | 4 ++-- sdks/js/packages/spark-sdk/src/tests/utils/utils.ts | 4 ++++ 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/sdks/js/packages/spark-sdk/src/tests/integration/transfer.test.ts b/sdks/js/packages/spark-sdk/src/tests/integration/transfer.test.ts index de7dd3316..408129641 100644 --- a/sdks/js/packages/spark-sdk/src/tests/integration/transfer.test.ts +++ b/sdks/js/packages/spark-sdk/src/tests/integration/transfer.test.ts @@ -20,8 +20,7 @@ import { SparkWalletTestingIntegrationWithStream, } from "../utils/spark-testing-wallet.js"; import { BitcoinFaucet } from "../utils/test-faucet.js"; - -const testLocalOnly = process.env.GITHUB_ACTIONS ? it.skip : it; +import { testMinikubeAndLocalOnly } from "../utils/utils.js"; describe.each(walletTypes)( "Transfer with name", @@ -121,7 +120,7 @@ describe.each(walletTypes)( expect(balance.balance).toBe(1000n); }, 30000); - testLocalOnly(`${name} - test transfer with separate`, async () => { + testMinikubeAndLocalOnly(`${name} - test transfer with separate`, async () => { const faucet = BitcoinFaucet.getInstance(); const options: ConfigOptions = { @@ -252,7 +251,7 @@ describe.each(walletTypes)( ); }); - testLocalOnly( + testMinikubeAndLocalOnly( `${name} - test that when the receiver has tweaked the key on some SOs, we can still claim the transfer`, async () => { const faucet = BitcoinFaucet.getInstance(); diff --git a/sdks/js/packages/spark-sdk/src/tests/integration/unilateral-exit.test.ts b/sdks/js/packages/spark-sdk/src/tests/integration/unilateral-exit.test.ts index 9eb74c4ba..4e6e12e7d 100644 --- a/sdks/js/packages/spark-sdk/src/tests/integration/unilateral-exit.test.ts +++ b/sdks/js/packages/spark-sdk/src/tests/integration/unilateral-exit.test.ts @@ -5,7 +5,7 @@ import { RPCError } from "../../errors/types.js"; import { Network } from "../../utils/network.js"; import { SparkWalletTestingIntegration } from "../utils/spark-testing-wallet.js"; import { BitcoinFaucet } from "../utils/test-faucet.js"; -import { waitForClaim } from "../utils/utils.js"; +import { testMinikubeOnly, waitForClaim } from "../utils/utils.js"; import { constructUnilateralExitFeeBumpPackages, hash160, @@ -14,7 +14,7 @@ import { signPsbtWithExternalKey } from "../utils/signing.js"; import { TreeNode } from "../../proto/spark.js"; describe("unilateral exit", () => { - it("should unilateral exit", async () => { + testMinikubeOnly("should unilateral exit", async () => { const faucet = BitcoinFaucet.getInstance(); const { wallet: userWallet } = diff --git a/sdks/js/packages/spark-sdk/src/tests/utils/utils.ts b/sdks/js/packages/spark-sdk/src/tests/utils/utils.ts index 635e1b487..c623de777 100644 --- a/sdks/js/packages/spark-sdk/src/tests/utils/utils.ts +++ b/sdks/js/packages/spark-sdk/src/tests/utils/utils.ts @@ -61,3 +61,7 @@ export async function waitForClaim({ wallet.once(SparkWalletEvent.TransferClaimed, onClaim); }); } + +export const isMinikube = process.env.MINIKUBE_IP != undefined; +export const testMinikubeOnly = !isMinikube ? it.skip : it; +export const testMinikubeAndLocalOnly = process.env.GITHUB_ACTIONS || !isMinikube ? it.skip : it; From b90137607d48b044c1b73554ecfdc66fbdbdd3f9 Mon Sep 17 00:00:00 2001 From: Linden <70739041+linden@users.noreply.github.com> Date: Wed, 17 Dec 2025 15:11:31 -0800 Subject: [PATCH 2/2] chore(`spark-sdk`): rename `testMinikube{AndLocal}Only` to `testHermetic{AndLocal}Only` --- .../spark-sdk/src/tests/integration/transfer.test.ts | 6 +++--- .../spark-sdk/src/tests/integration/unilateral-exit.test.ts | 6 ++++-- sdks/js/packages/spark-sdk/src/tests/isHermeticTest.ts | 3 +++ sdks/js/packages/spark-sdk/src/tests/utils/utils.ts | 4 ---- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/sdks/js/packages/spark-sdk/src/tests/integration/transfer.test.ts b/sdks/js/packages/spark-sdk/src/tests/integration/transfer.test.ts index 408129641..72a2000a8 100644 --- a/sdks/js/packages/spark-sdk/src/tests/integration/transfer.test.ts +++ b/sdks/js/packages/spark-sdk/src/tests/integration/transfer.test.ts @@ -20,7 +20,7 @@ import { SparkWalletTestingIntegrationWithStream, } from "../utils/spark-testing-wallet.js"; import { BitcoinFaucet } from "../utils/test-faucet.js"; -import { testMinikubeAndLocalOnly } from "../utils/utils.js"; +import { testHermeticAndLocalOnly } from "../isHermeticTest.js"; describe.each(walletTypes)( "Transfer with name", @@ -120,7 +120,7 @@ describe.each(walletTypes)( expect(balance.balance).toBe(1000n); }, 30000); - testMinikubeAndLocalOnly(`${name} - test transfer with separate`, async () => { + testHermeticAndLocalOnly(`${name} - test transfer with separate`, async () => { const faucet = BitcoinFaucet.getInstance(); const options: ConfigOptions = { @@ -251,7 +251,7 @@ describe.each(walletTypes)( ); }); - testMinikubeAndLocalOnly( + testHermeticAndLocalOnly( `${name} - test that when the receiver has tweaked the key on some SOs, we can still claim the transfer`, async () => { const faucet = BitcoinFaucet.getInstance(); diff --git a/sdks/js/packages/spark-sdk/src/tests/integration/unilateral-exit.test.ts b/sdks/js/packages/spark-sdk/src/tests/integration/unilateral-exit.test.ts index 4e6e12e7d..a65836dcf 100644 --- a/sdks/js/packages/spark-sdk/src/tests/integration/unilateral-exit.test.ts +++ b/sdks/js/packages/spark-sdk/src/tests/integration/unilateral-exit.test.ts @@ -5,7 +5,9 @@ import { RPCError } from "../../errors/types.js"; import { Network } from "../../utils/network.js"; import { SparkWalletTestingIntegration } from "../utils/spark-testing-wallet.js"; import { BitcoinFaucet } from "../utils/test-faucet.js"; -import { testMinikubeOnly, waitForClaim } from "../utils/utils.js"; +import { waitForClaim } from "../utils/utils.js"; +import { testHermeticOnly } from "../isHermeticTest.js"; + import { constructUnilateralExitFeeBumpPackages, hash160, @@ -14,7 +16,7 @@ import { signPsbtWithExternalKey } from "../utils/signing.js"; import { TreeNode } from "../../proto/spark.js"; describe("unilateral exit", () => { - testMinikubeOnly("should unilateral exit", async () => { + testHermeticOnly("should unilateral exit", async () => { const faucet = BitcoinFaucet.getInstance(); const { wallet: userWallet } = diff --git a/sdks/js/packages/spark-sdk/src/tests/isHermeticTest.ts b/sdks/js/packages/spark-sdk/src/tests/isHermeticTest.ts index 1f9bfdc7f..27db27fd7 100644 --- a/sdks/js/packages/spark-sdk/src/tests/isHermeticTest.ts +++ b/sdks/js/packages/spark-sdk/src/tests/isHermeticTest.ts @@ -1,3 +1,6 @@ export const isHermeticTest = Boolean( typeof process !== "undefined" && process?.env?.MINIKUBE_IP, ); + +export const testHermeticOnly = !isHermeticTest ? it.skip : it; +export const testHermeticAndLocalOnly = process.env.GITHUB_ACTIONS || !isHermeticTest ? it.skip : it; diff --git a/sdks/js/packages/spark-sdk/src/tests/utils/utils.ts b/sdks/js/packages/spark-sdk/src/tests/utils/utils.ts index c623de777..635e1b487 100644 --- a/sdks/js/packages/spark-sdk/src/tests/utils/utils.ts +++ b/sdks/js/packages/spark-sdk/src/tests/utils/utils.ts @@ -61,7 +61,3 @@ export async function waitForClaim({ wallet.once(SparkWalletEvent.TransferClaimed, onClaim); }); } - -export const isMinikube = process.env.MINIKUBE_IP != undefined; -export const testMinikubeOnly = !isMinikube ? it.skip : it; -export const testMinikubeAndLocalOnly = process.env.GITHUB_ACTIONS || !isMinikube ? it.skip : it;