From 0a575f032ec7734a8ae93b103c0558b5ed58b97b Mon Sep 17 00:00:00 2001 From: clangenb <37865735+clangenb@users.noreply.github.com> Date: Wed, 10 Apr 2024 11:19:59 +0800 Subject: [PATCH] [worker] run integration tests against paseo (#92) --- packages/worker-api/src/testUtils/networks.ts | 14 ++++++++++++++ packages/worker-api/src/worker.spec.ts | 11 ++++++----- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/packages/worker-api/src/testUtils/networks.ts b/packages/worker-api/src/testUtils/networks.ts index e7ea96c6..40090eb0 100644 --- a/packages/worker-api/src/testUtils/networks.ts +++ b/packages/worker-api/src/testUtils/networks.ts @@ -46,6 +46,20 @@ export const localDockerNetwork = () => { }; }; +export const paseoNetwork = () => { + return { + chain: 'wss://rpc.ibp.network/paseo:443', + // reverse proxy to the worker + worker: 'wss://scv1.paseo.api.incognitee.io:443', + genesisHash: '', + mrenclave: '7RuM6U4DLEtrTnVntDjDPBCAN4LbCGRpnmcTYUGhLqc7', + // abused as shard vault + chosenCid: '5CBWPstfcW7dPYGdUG4kVDZSQq9Q9Ed65LT2Eu1inhJRoY8e', + customTypes: {}, + palletOverrides: {} + }; +}; + // Type overrides needed for the v3.8 tag of the encointer-node repo. const TypeOverrides_V3_8 = { CurrencyIdentifier: 'Hash', diff --git a/packages/worker-api/src/worker.spec.ts b/packages/worker-api/src/worker.spec.ts index 07972d29..4688e7c7 100644 --- a/packages/worker-api/src/worker.spec.ts +++ b/packages/worker-api/src/worker.spec.ts @@ -1,13 +1,13 @@ import { Keyring } from '@polkadot/api'; import { cryptoWaitReady } from '@polkadot/util-crypto'; -import { localDockerNetwork } from './testUtils/networks.js'; +import { paseoNetwork } from './testUtils/networks.js'; import { Worker } from './worker.js'; import WS from 'websocket'; const {w3cwebsocket: WebSocket} = WS; describe('worker', () => { - const network = localDockerNetwork(); + const network = paseoNetwork(); let keyring: Keyring; let worker: Worker; beforeAll(async () => { @@ -24,8 +24,9 @@ describe('worker', () => { undefined, undefined, undefined, - // Allow the worker's self-signed certificate - { rejectUnauthorized: false } + // Allow the worker's self-signed certificate, needed in non-reverse proxy setups + // where we talk to the worker directly. + // { rejectUnauthorized: false } ), api: null, }); @@ -34,7 +35,7 @@ describe('worker', () => { // skip it, as this requires a worker (and hence a node) to be running // To my knowledge jest does not have an option to run skipped tests specifically, does it? // Todo: add proper CI to test this too. - describe.skip('needs worker and node running', () => { + describe('needs worker and node running', () => { describe('getWorkerPubKey', () => { it('should return value', async () => { const result = await worker.getShieldingKey();