Skip to content

Commit

Permalink
Restructure test folders / move npm commands to shell scripts (#841)
Browse files Browse the repository at this point in the history
  • Loading branch information
cgewecke authored Feb 2, 2024
1 parent 1c257b0 commit fbed395
Show file tree
Hide file tree
Showing 130 changed files with 49 additions and 35 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
- run:
name: Zeppelin E2E
command: |
./scripts/run-zeppelin.sh
./scripts/zeppelin.sh
e2e-nomiclabs:
machine: true
steps:
Expand All @@ -58,7 +58,7 @@ jobs:
- run:
name: Hardhat E2E
command: |
./scripts/run-nomiclabs.sh
./scripts/nomiclabs.sh
workflows:
version: 2
build:
Expand Down
8 changes: 3 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@
"test": "test"
},
"scripts": {
"nyc": "SILENT=true nyc --exclude '**/sc_temp/**' --exclude '**/test/**'",
"test": "SILENT=true node --max-old-space-size=4096 ./node_modules/.bin/nyc --exclude '**/sc_temp/**' --exclude '**/test/**/' -- mocha test/units/* --timeout 100000 --no-warnings --exit",
"test:ci": "SILENT=true node --max-old-space-size=4096 ./node_modules/.bin/nyc --reporter=lcov --exclude '**/sc_temp/**' --exclude '**/test/**/' --exclude 'plugins/resources/matrix.js' -- mocha test/units/* --timeout 100000 --no-warnings --exit",
"test:debug": "node --max-old-space-size=4096 ./node_modules/.bin/mocha test/units/* --timeout 100000 --no-warnings --exit",
"netlify": "./scripts/run-netlify.sh"
"test:unit": "./scripts/unit.sh",
"test:integration": "./scripts/integration.sh",
"test:ci": "./scripts/ci.sh"
},
"homepage": "https://github.com/sc-forks/solidity-coverage",
"repository": {
Expand Down
14 changes: 14 additions & 0 deletions scripts/ci.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

SILENT=true node --max-old-space-size=4096 \
./node_modules/.bin/nyc \
--reporter=lcov \
--exclude '**/sc_temp/**' \
--exclude '**/test/**/' \
--exclude 'plugins/resources/matrix.js' \
-- \
mocha \
test/units/* test/integration/* \
--timeout 100000 \
--no-warnings \
--exit \
11 changes: 11 additions & 0 deletions scripts/integration.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

node --max-old-space-size=4096 \
./node_modules/.bin/nyc \
--exclude '**/sc_temp/**' \
--exclude '**/test/**/' \
-- \
mocha test/integration/* \
--timeout 100000 \
--no-warnings \
--exit
File renamed without changes.
20 changes: 0 additions & 20 deletions scripts/run-netlify.sh

This file was deleted.

11 changes: 11 additions & 0 deletions scripts/unit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

node --max-old-space-size=4096 \
./node_modules/.bin/nyc \
--exclude '**/sc_temp/**' \
--exclude '**/test/**/' \
-- \
mocha test/units/* \
--timeout 100000 \
--no-warnings \
--exit
File renamed without changes.
4 changes: 2 additions & 2 deletions test/units/hardhat/errors.js → test/integration/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ const pify = require('pify')
const shell = require('shelljs');
const ganache = require('ganache-cli')

const verify = require('../../util/verifiers')
const mock = require('../../util/integration');
const verify = require('./../util/verifiers')
const mock = require('./../util/integration');

// =======
// Errors
Expand Down
4 changes: 2 additions & 2 deletions test/units/hardhat/flags.js → test/integration/flags.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ const fs = require('fs');
const path = require('path')
const shell = require('shelljs');

const verify = require('../../util/verifiers')
const mock = require('../../util/integration');
const verify = require('./../util/verifiers')
const mock = require('./../util/integration');

// =======================
// CLI Options / Flags
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ const fs = require('fs');
const path = require('path')
const shell = require('shelljs');

const verify = require('../../util/verifiers')
const mock = require('../../util/integration');
const verify = require('./../util/verifiers')
const mock = require('./../util/integration');

// =======================
// Standard Use-case Tests
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions test/util/integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ const hardhatConfigName = 'hardhat.config.js';
const configPath = `${temp}/.solcover.js`;
const testPath = './test/sources/js/';
const sourcesPath = './test/sources/solidity/contracts/app/';
const templatePath = './test/integration/generic/*';
const projectPath = './test/integration/projects/'
const templatePath = './test/sources/generic/*';
const projectPath = './test/sources/projects/'

let previousCWD;

Expand Down

0 comments on commit fbed395

Please sign in to comment.