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
This commit is contained in:
Mateusz Franik
2024-12-30 10:39:28 +01:00
committed by GitHub
parent 2a38bf2961
commit 85770ea6f1
11 changed files with 454 additions and 128 deletions

View File

@@ -1,4 +1,4 @@
import { $, createWalletViaCli, downloadCli, getMoneroC, getMoneroCTags } from "./utils.ts";
import { $, createWalletViaCli, getMoneroCTags, prepareCli, prepareMoneroC } from "./utils.ts";
const coin = Deno.env.get("COIN");
if (coin !== "monero" && coin !== "wownero") {
@@ -11,7 +11,7 @@ Deno.test(`Regression tests (${coin})`, async (t) => {
const tags = await getMoneroCTags();
const latestTag = tags[0];
await Promise.all([getMoneroC(coin, "next"), await getMoneroC(coin, latestTag), downloadCli(coin)]);
await Promise.all([prepareMoneroC(coin, "next"), await prepareMoneroC(coin, latestTag), prepareCli(coin)]);
await t.step("Simple (next, latest, next)", async () => {
const walletInfo = await createWalletViaCli(coin, "dog", "sobaka");
@@ -27,13 +27,10 @@ Deno.test(`Regression tests (${coin})`, async (t) => {
const walletInfo = await createWalletViaCli(coin, "cat", "koshka");
for (const version of tags.toReversed()) {
if (version !== "next" && version !== tags[0]) await getMoneroC(coin, version);
if (version !== "next" && version !== tags[0]) await prepareMoneroC(coin, version);
await $`deno run -A ./tests/compare.ts ${coin} ${version} ${JSON.stringify(walletInfo)}`;
}
await Deno.remove("./tests/wallets", { recursive: true }).catch(() => {});
});
await Deno.remove("./tests/wallets", { recursive: true }).catch(() => {});
await Deno.remove("./tests/libs", { recursive: true }).catch(() => {});
});