From 9d24ac70879bbf8a881f8df7b9810a22d222117c Mon Sep 17 00:00:00 2001 From: cgewecke Date: Sun, 16 Apr 2017 18:22:32 -0700 Subject: [PATCH] Remove some extraneous deps, use sc-forks testrpc --- .gitignore | 1 + exec.js | 18 ++++++++---------- package.json | 2 +- test/run.js | 13 +++++-------- 4 files changed, 15 insertions(+), 19 deletions(-) diff --git a/.gitignore b/.gitignore index 88ae067..f5b0cd5 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ allFiredEvents coverage.json coverage/ node_modules/ +.changelog diff --git a/exec.js b/exec.js index e3f63c7..7c7a90b 100644 --- a/exec.js +++ b/exec.js @@ -4,9 +4,7 @@ const shell = require('shelljs'); const fs = require('fs'); const reqCwd = require('req-cwd'); const path = require('path'); -const program = require('commander'); const childprocess = require('child_process'); -const SolidityCoder = require('web3/lib/solidity/coder.js'); const getInstrumentedVersion = require('./instrumentSolidity.js'); const CoverageMap = require('./coverageMap.js'); @@ -27,14 +25,14 @@ const solcoverDir = 'node_modules/solcover'; // Solcover assets let modulesDir = 'node_modules/solcover/node_modules'; // Solcover's npm assets: configurable via test // Options -let workingDir = '.'; // Default location of contracts folder -let port = 8555; // Default port - NOT 8545 & configurable via --port -let coverageOption = '--network coverage'; // Default truffle network execution flag -let silence = ''; // Default log level: configurable by --silence -let log = console.log; // Default log level: configurable by --silence - -let testrpcProcess; // ref to testrpc process we need to kill on exit -let events; // ref to string loaded from 'allFiredEvents' +let workingDir = '.'; // Default location of contracts folder +let port = 8555; // Default port - NOT 8545 & configurable via --port +let coverageOption = '--network coverage'; // Default truffle network execution flag +let silence = ''; // Default log level: configurable by --silence +let log = console.log; // Default log level: configurable by --silence + +let testrpcProcess; // ref to testrpc server we need to close on exit +let events; // ref to string loaded from 'allFiredEvents' // --------------------------------------- Script -------------------------------------------------- const config = reqCwd.silent(`${workingDir}/.solcover.js`) || {}; diff --git a/package.json b/package.json index dd23826..cf64f78 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "license": "ISC", "dependencies": { "commander": "^2.9.0", - "ethereumjs-testrpc": "https://github.com/cgewecke/testrpc.git#solcover", + "ethereumjs-testrpc": "https://github.com/sc-forks/testrpc.git", "istanbul": "^0.4.5", "mkdirp": "^0.5.1", "req-cwd": "^1.0.1", diff --git a/test/run.js b/test/run.js index a92b2d0..790853b 100644 --- a/test/run.js +++ b/test/run.js @@ -12,7 +12,7 @@ function collectGarbage() { if (global.gc) { global.gc(); } } -describe('run', () => { +describe.only('run', () => { let testrpcProcess = null; let script = 'node ./exec.js' let launchTestRpc = false; @@ -22,7 +22,7 @@ describe('run', () => { dir: "./mock", port: port, testing: true, - silent: false, + silent: true, norpc: true, }; @@ -45,13 +45,10 @@ describe('run', () => { // possibly tied to the use of ethereumjs-vm in the coverage tests? // - tests pass w/out this if we only run these test - e.g. it only fails when running the suite. // - the first test always fails unless there is a fresh testrpc install. - // - Running this on Circle CI causes suite to crash it('flush test suite', () => { - //if (!process.env.CI){ // <---- CI is set by default on circle - mock.install('Simple.sol', 'simple.js', config); - shell.exec(script); // <---- This fails mysteriously, but we don't test here. - collectGarbage(); - //} + mock.install('Simple.sol', 'simple.js', config); + shell.exec(script); // <---- This fails mysteriously, but we don't test here. + collectGarbage(); }); // This test should be positioned first (or second if flushing) in the suite because of