mirror of
https://github.com/embarklabs/embark.git
synced 2025-01-09 13:26:10 +00:00
feat(@embark/tests): enable comms and storage in tests
But only enabled at the start and not changed per test
This commit is contained in:
parent
de9e667794
commit
aecb99d428
@ -749,9 +749,20 @@ class EmbarkController {
|
|||||||
engine.registerModuleGroup("tests", options);
|
engine.registerModuleGroup("tests", options);
|
||||||
engine.registerModulePackage('embark-deploy-tracker', {plugins: engine.plugins, trackContracts: false});
|
engine.registerModulePackage('embark-deploy-tracker', {plugins: engine.plugins, trackContracts: false});
|
||||||
engine.registerModuleGroup("namesystem");
|
engine.registerModuleGroup("namesystem");
|
||||||
|
engine.registerModuleGroup("storage");
|
||||||
|
engine.registerModuleGroup("communication");
|
||||||
|
|
||||||
engine.startEngine(next);
|
engine.startEngine(next);
|
||||||
},
|
},
|
||||||
|
function startNodes(next) {
|
||||||
|
Promise.all([
|
||||||
|
engine.events.request2("storage:node:start", engine.config.storageConfig),
|
||||||
|
engine.events.request2("communication:node:start", engine.config.communicationConfig),
|
||||||
|
engine.events.request2("namesystem:node:start", engine.config.namesystemConfig)
|
||||||
|
]).then(() => {
|
||||||
|
next();
|
||||||
|
}).catch(next);
|
||||||
|
},
|
||||||
function setupTestEnvironment(next) {
|
function setupTestEnvironment(next) {
|
||||||
engine.events.request2('tests:run', options, next);
|
engine.events.request2('tests:run', options, next);
|
||||||
}
|
}
|
||||||
|
@ -68,16 +68,10 @@ class MochaTestRunner {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
(next) => {
|
(next) => {
|
||||||
events.request('tests:config:check', cfg, (err, needResetEmbarkJS) => {
|
events.request('tests:config:check', cfg, (err) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
return next(err);
|
return next(err);
|
||||||
}
|
}
|
||||||
if (needResetEmbarkJS) {
|
|
||||||
// TODO add back this event?
|
|
||||||
// events.request("runcode:embarkjs:reset", (err) => {
|
|
||||||
// next(err, accounts);
|
|
||||||
// });
|
|
||||||
}
|
|
||||||
next();
|
next();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -38,7 +38,6 @@ export default class Namesystem {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO START PLS
|
|
||||||
startNode(namesystemConfig, cb) {
|
startNode(namesystemConfig, cb) {
|
||||||
if (!namesystemConfig.enabled) {
|
if (!namesystemConfig.enabled) {
|
||||||
return cb();
|
return cb();
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { __ } from 'embark-i18n';
|
import { __ } from 'embark-i18n';
|
||||||
import {buildUrl, deconstructUrl, recursiveMerge, prepareContractsConfig} from "embark-utils";
|
import {buildUrl, deconstructUrl, recursiveMerge} from "embark-utils";
|
||||||
const assert = require('assert').strict;
|
const assert = require('assert').strict;
|
||||||
const async = require('async');
|
const async = require('async');
|
||||||
const chalk = require('chalk');
|
const chalk = require('chalk');
|
||||||
@ -32,9 +32,7 @@ class TestRunner {
|
|||||||
this.simOptions = {};
|
this.simOptions = {};
|
||||||
|
|
||||||
this.moduleConfigs = {
|
this.moduleConfigs = {
|
||||||
namesystem: {},
|
namesystem: {}
|
||||||
storage: {},
|
|
||||||
communication: {}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
this.events.setCommandHandler('tests:run', (options, callback) => {
|
this.events.setCommandHandler('tests:run', (options, callback) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user