diff options
| author | Mateusz Franik <47059999+Im-Beast@users.noreply.github.com> | 2024-12-30 10:39:28 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-30 10:39:28 +0100 |
| commit | 85770ea6f1dab106754675f40e1334e575e03646 (patch) | |
| tree | 9ce1a0a6ba07896b44a13ceceec7a936a467994d /tests/integration.test.ts | |
| parent | 2a38bf29618a8ce163f9d6f83b7ae86924752e32 (diff) | |
tests: run integration and regression tests on other platforms (#93)
* tests: add script to download test dependencies from fallback mirrors
* tests: use the new download_deps script, run tests on macos
* ci: download proper artifact for macos
* chore: make download_deps script download everything to dir named `monero_c` when ran directly
* tests: await downloading deps
* tests download proper monero_c version in prepareMoneroC
* tests: fix typos
* tests: add file data for more targets
* tests: print why retrieving tags failed
* chore: change mirror url endpoint from `monero_c` to `download_mirror`
* tests: use cached releases endpoint to prevent ratelimits
* ci: remove brew@1.76 dependency
* tests: fix macos dylib path
* feat!(monero.ts): make `createTransactionMultDest` optionally return `null`
* feat(monero.ts): make `Wallet_reconnectDevice` symbol optional
* tests: don't try to extract file if out already exists
* tests: remove unnecesary directory rm calls
* ci: set regression tests to use canary
Diffstat (limited to 'tests/integration.test.ts')
| -rw-r--r-- | tests/integration.test.ts | 28 |
1 files changed, 6 insertions, 22 deletions
diff --git a/tests/integration.test.ts b/tests/integration.test.ts index 1a65009..100bd43 100644 --- a/tests/integration.test.ts +++ b/tests/integration.test.ts @@ -1,16 +1,7 @@ -import { - CoinsInfo, - type Dylib, - loadMoneroDylib, - loadWowneroDylib, - moneroSymbols, - Wallet, - WalletManager, - wowneroSymbols, -} from "../impls/monero.ts/mod.ts"; +import { CoinsInfo, Wallet, WalletManager } from "../impls/monero.ts/mod.ts"; import { assert, assertEquals } from "jsr:@std/assert"; -import { $, downloadCli, getMoneroC } from "./utils.ts"; +import { $, loadDylib, prepareCli, prepareMoneroC } from "./utils.ts"; const coin = Deno.env.get("COIN"); if (coin !== "monero" && coin !== "wownero") { @@ -53,7 +44,7 @@ const DESTINATION_ADDRESS = coin === "monero" ? MONERO_DESTINATION_ADDRESS : WOW const BILLION = 10n ** 9n; -await getMoneroC(coin, "next"); +await prepareMoneroC(coin, "next"); interface WalletInfo { name: string; @@ -74,14 +65,7 @@ async function clearWallets() { await Deno.mkdir("tests/wallets/"); } -let dylib: Dylib; -if (coin === "monero") { - dylib = Deno.dlopen(`tests/libs/next/monero_libwallet2_api_c.so`, moneroSymbols); - loadMoneroDylib(dylib); -} else { - dylib = Deno.dlopen(`tests/libs/next/wownero_libwallet2_api_c.so`, wowneroSymbols); - loadWowneroDylib(dylib); -} +loadDylib(coin, "next"); Deno.test("0001-polyseed.patch", async (t) => { const WALLETS: Record<"monero" | "wownero", WalletInfo[]> = { @@ -487,7 +471,7 @@ Deno.test("0004-coin-control.patch", { Deno.test("0009-Add-recoverDeterministicWalletFromSpendKey.patch", async () => { await Promise.all([ - downloadCli(coin), + prepareCli(coin), clearWallets(), ]); @@ -498,7 +482,7 @@ Deno.test("0009-Add-recoverDeterministicWalletFromSpendKey.patch", async () => { await Deno.remove("./tests/wallets/stoat"); - const cliPath = `./tests/${coin}-cli/${coin}-wallet-cli`; + const cliPath = `./tests/dependencies/${coin}-cli/${coin}-wallet-cli`; const moneroCliSeed = (await $.raw`${cliPath} --wallet-file ./tests/wallets/stoat --password gornostay --command seed` .stdinText(`gornostay\n`) .lines()).slice(-3).join(" "); |
