Skip to content

Restructure test folders / move npm commands to shell scripts #841

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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