mirror of
https://github.com/waku-org/js-waku.git
synced 2025-02-10 11:26:58 +00:00
Do not run bootstrap live data test as part of normal CI (#468)
This commit is contained in:
parent
fac4afac9d
commit
91d6e436d4
@ -5,12 +5,14 @@ module.exports = function (config) {
|
|||||||
frameworks: ['mocha', 'karma-typescript'],
|
frameworks: ['mocha', 'karma-typescript'],
|
||||||
files: ['src/lib/**/*.ts', 'src/proto/**/*.ts'],
|
files: ['src/lib/**/*.ts', 'src/proto/**/*.ts'],
|
||||||
preprocessors: {
|
preprocessors: {
|
||||||
'**/*.ts': ['karma-typescript'],
|
'**/*.ts': ['karma-typescript', 'env'],
|
||||||
},
|
},
|
||||||
|
envPreprocessor: ['CI'],
|
||||||
plugins: [
|
plugins: [
|
||||||
require('karma-mocha'),
|
require('karma-mocha'),
|
||||||
require('karma-typescript'),
|
require('karma-typescript'),
|
||||||
require('karma-chrome-launcher'),
|
require('karma-chrome-launcher'),
|
||||||
|
require('karma-env-preprocessor'),
|
||||||
],
|
],
|
||||||
reporters: ['progress', 'karma-typescript'],
|
reporters: ['progress', 'karma-typescript'],
|
||||||
browsers: ['ChromeHeadless'],
|
browsers: ['ChromeHeadless'],
|
||||||
|
13
package-lock.json
generated
13
package-lock.json
generated
@ -60,6 +60,7 @@
|
|||||||
"gh-pages": "^3.2.3",
|
"gh-pages": "^3.2.3",
|
||||||
"karma": "^6.3.12",
|
"karma": "^6.3.12",
|
||||||
"karma-chrome-launcher": "^3.1.0",
|
"karma-chrome-launcher": "^3.1.0",
|
||||||
|
"karma-env-preprocessor": "^0.1.1",
|
||||||
"karma-mocha": "^2.0.1",
|
"karma-mocha": "^2.0.1",
|
||||||
"karma-typescript": "^5.5.3",
|
"karma-typescript": "^5.5.3",
|
||||||
"mocha": "^9.1.3",
|
"mocha": "^9.1.3",
|
||||||
@ -9984,6 +9985,12 @@
|
|||||||
"which": "bin/which"
|
"which": "bin/which"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/karma-env-preprocessor": {
|
||||||
|
"version": "0.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/karma-env-preprocessor/-/karma-env-preprocessor-0.1.1.tgz",
|
||||||
|
"integrity": "sha1-u+jIfVnADtt2BwvTwxtLOdXcfhU=",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"node_modules/karma-mocha": {
|
"node_modules/karma-mocha": {
|
||||||
"version": "2.0.1",
|
"version": "2.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/karma-mocha/-/karma-mocha-2.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/karma-mocha/-/karma-mocha-2.0.1.tgz",
|
||||||
@ -25507,6 +25514,12 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"karma-env-preprocessor": {
|
||||||
|
"version": "0.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/karma-env-preprocessor/-/karma-env-preprocessor-0.1.1.tgz",
|
||||||
|
"integrity": "sha1-u+jIfVnADtt2BwvTwxtLOdXcfhU=",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"karma-mocha": {
|
"karma-mocha": {
|
||||||
"version": "2.0.1",
|
"version": "2.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/karma-mocha/-/karma-mocha-2.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/karma-mocha/-/karma-mocha-2.0.1.tgz",
|
||||||
|
@ -107,6 +107,7 @@
|
|||||||
"gh-pages": "^3.2.3",
|
"gh-pages": "^3.2.3",
|
||||||
"karma": "^6.3.12",
|
"karma": "^6.3.12",
|
||||||
"karma-chrome-launcher": "^3.1.0",
|
"karma-chrome-launcher": "^3.1.0",
|
||||||
|
"karma-env-preprocessor": "^0.1.1",
|
||||||
"karma-mocha": "^2.0.1",
|
"karma-mocha": "^2.0.1",
|
||||||
"karma-typescript": "^5.5.3",
|
"karma-typescript": "^5.5.3",
|
||||||
"mocha": "^9.1.3",
|
"mocha": "^9.1.3",
|
||||||
|
@ -3,6 +3,12 @@ import { expect } from 'chai';
|
|||||||
import { DnsClient, DnsNodeDiscovery } from './dns';
|
import { DnsClient, DnsNodeDiscovery } from './dns';
|
||||||
import testData from './testdata.json';
|
import testData from './testdata.json';
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
interface Window {
|
||||||
|
__env__?: any;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const mockData = testData.dns;
|
const mockData = testData.dns;
|
||||||
|
|
||||||
const host = 'nodes.example.org';
|
const host = 'nodes.example.org';
|
||||||
@ -176,7 +182,7 @@ describe('DNS Node Discovery [live data]', function () {
|
|||||||
const maxQuantity = 3;
|
const maxQuantity = 3;
|
||||||
|
|
||||||
before(function () {
|
before(function () {
|
||||||
if (process.env.CI) {
|
if (process.env.CI || window.__env__.CI) {
|
||||||
this.skip();
|
this.skip();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -44,41 +44,6 @@ describe('Waku Dial [node only]', function () {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Bootstrap [live data]', function () {
|
|
||||||
let waku: Waku;
|
|
||||||
let nimWaku: NimWaku;
|
|
||||||
|
|
||||||
afterEach(async function () {
|
|
||||||
!!nimWaku && nimWaku.stop();
|
|
||||||
!!waku && waku.stop().catch((e) => console.log('Waku failed to stop', e));
|
|
||||||
});
|
|
||||||
|
|
||||||
before(function () {
|
|
||||||
if (process.env.CI) {
|
|
||||||
this.skip();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
it('Enabling default [live data]', async function () {
|
|
||||||
// This test depends on fleets.status.im being online.
|
|
||||||
// This dependence must be removed once DNS discovery is implemented
|
|
||||||
this.timeout(20_000);
|
|
||||||
|
|
||||||
waku = await Waku.create({
|
|
||||||
staticNoiseKey: NOISE_KEY_1,
|
|
||||||
bootstrap: { default: true },
|
|
||||||
});
|
|
||||||
|
|
||||||
const connectedPeerID: PeerId = await new Promise((resolve) => {
|
|
||||||
waku.libp2p.connectionManager.on('peer:connect', (connection) => {
|
|
||||||
resolve(connection.remotePeer);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
expect(connectedPeerID).to.not.be.undefined;
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('Bootstrap', function () {
|
describe('Bootstrap', function () {
|
||||||
let waku: Waku;
|
let waku: Waku;
|
||||||
let nimWaku: NimWaku;
|
let nimWaku: NimWaku;
|
||||||
|
44
src/lib/waku.spec.ts
Normal file
44
src/lib/waku.spec.ts
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
import { expect } from 'chai';
|
||||||
|
import PeerId from 'peer-id';
|
||||||
|
|
||||||
|
import { Waku } from './waku';
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
interface Window {
|
||||||
|
__env__?: any;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
describe('Waku Dial', function () {
|
||||||
|
describe('Bootstrap [live data]', function () {
|
||||||
|
let waku: Waku;
|
||||||
|
|
||||||
|
afterEach(function () {
|
||||||
|
!!waku && waku.stop().catch((e) => console.log('Waku failed to stop', e));
|
||||||
|
});
|
||||||
|
|
||||||
|
before(function () {
|
||||||
|
if (process.env.CI || window.__env__.CI) {
|
||||||
|
this.skip();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Enabling default [live data]', async function () {
|
||||||
|
// This test depends on fleets.status.im being online.
|
||||||
|
// This dependence must be removed once DNS discovery is implemented
|
||||||
|
this.timeout(20_000);
|
||||||
|
|
||||||
|
waku = await Waku.create({
|
||||||
|
bootstrap: { default: true },
|
||||||
|
});
|
||||||
|
|
||||||
|
const connectedPeerID: PeerId = await new Promise((resolve) => {
|
||||||
|
waku.libp2p.connectionManager.on('peer:connect', (connection) => {
|
||||||
|
resolve(connection.remotePeer);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(connectedPeerID).to.not.be.undefined;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
Loading…
x
Reference in New Issue
Block a user