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:
Jonathan Rainville 2019-11-07 15:51:05 -05:00 committed by Iuri Matias
parent de9e667794
commit aecb99d428
4 changed files with 14 additions and 12 deletions

View File

@ -749,9 +749,20 @@ class EmbarkController {
engine.registerModuleGroup("tests", options);
engine.registerModulePackage('embark-deploy-tracker', {plugins: engine.plugins, trackContracts: false});
engine.registerModuleGroup("namesystem");
engine.registerModuleGroup("storage");
engine.registerModuleGroup("communication");
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) {
engine.events.request2('tests:run', options, next);
}

View File

@ -68,16 +68,10 @@ class MochaTestRunner {
});
},
(next) => {
events.request('tests:config:check', cfg, (err, needResetEmbarkJS) => {
events.request('tests:config:check', cfg, (err) => {
if (err) {
return next(err);
}
if (needResetEmbarkJS) {
// TODO add back this event?
// events.request("runcode:embarkjs:reset", (err) => {
// next(err, accounts);
// });
}
next();
});
},

View File

@ -38,7 +38,6 @@ export default class Namesystem {
});
}
// TODO START PLS
startNode(namesystemConfig, cb) {
if (!namesystemConfig.enabled) {
return cb();

View File

@ -1,5 +1,5 @@
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 async = require('async');
const chalk = require('chalk');
@ -32,9 +32,7 @@ class TestRunner {
this.simOptions = {};
this.moduleConfigs = {
namesystem: {},
storage: {},
communication: {}
namesystem: {}
};
this.events.setCommandHandler('tests:run', (options, callback) => {