Skip to content
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
16 changes: 16 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ jobs:
else
npx hardhat test:integration:l2 --compile --deploy --use-sips --use-fork
fi;
- store_test_results:
path: /tmp/junit/
- store_artifacts:
path: /tmp/junit/
job-fork-tests:
working_directory: ~/repo
docker:
Expand All @@ -92,6 +96,10 @@ jobs:
else
npx hardhat test:integration:l1 --compile --deploy --use-sips --use-fork --provider-port 9545
fi;
- store_test_results:
path: /tmp/junit/
- store_artifacts:
path: /tmp/junit/
job-integration-tests:
working_directory: ~/repo
machine:
Expand Down Expand Up @@ -137,6 +145,10 @@ jobs:
name: Run dual layer 1 and layer 2 integration tests
command: |
npx hardhat test:integration:dual --deploy
- store_test_results:
path: /tmp/junit/
- store_artifacts:
path: /tmp/junit/
job-lint:
working_directory: ~/repo
docker:
Expand Down Expand Up @@ -361,6 +373,10 @@ jobs:
root: .
paths:
- gasReporterOutput-*.json
- store_test_results:
path: /tmp/junit/
- store_artifacts:
path: /tmp/junit/
job-validate-deployments:
working_directory: ~/repo
docker:
Expand Down
4 changes: 4 additions & 0 deletions .circleci/src/jobs/job-fork-tests-ovm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@ steps:
else
npx hardhat test:integration:l2 --compile --deploy --use-sips --use-fork
fi;
- store_test_results:
path: /tmp/junit/
- store_artifacts:
path: /tmp/junit/
4 changes: 4 additions & 0 deletions .circleci/src/jobs/job-fork-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@ steps:
else
npx hardhat test:integration:l1 --compile --deploy --use-sips --use-fork --provider-port 9545
fi;
- store_test_results:
path: /tmp/junit/
- store_artifacts:
path: /tmp/junit/
4 changes: 4 additions & 0 deletions .circleci/src/jobs/job-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,7 @@ steps:
name: Run dual layer 1 and layer 2 integration tests
command: |
npx hardhat test:integration:dual --deploy
- store_test_results:
path: /tmp/junit/
- store_artifacts:
path: /tmp/junit/
4 changes: 4 additions & 0 deletions .circleci/src/jobs/job-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@ steps:
root: .
paths:
- gasReporterOutput-*.json
- store_test_results:
path: /tmp/junit/
- store_artifacts:
path: /tmp/junit/
10 changes: 10 additions & 0 deletions hardhat/tasks/task-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const { types, task, subtask } = require('hardhat/config');
const { TASK_TEST_RUN_MOCHA_TESTS } = require('hardhat/builtin-tasks/task-names');
const { gray, yellow } = require('chalk');
const optimizeIfRequired = require('../util/optimizeIfRequired');
const isCI = require('is-ci');

// Override builtin "test:run-mocha-tests" subtask so we can use the local mocha
// installation, which is up to date and allows us to run parallel tests.
Expand Down Expand Up @@ -54,5 +55,14 @@ task('test')
hre.config.gasReporter.outputFile = gasOutputFile;
}

// When using CircleCI, output the test metadata
// See https://circleci.com/docs/2.0/collect-test-data
if (isCI) {
hre.config.mocha.reporter = 'mocha-junit-reporter';
hre.config.mocha.reporterOptions = {
mochaFile: '/tmp/junit/test-results.[hash].xml',
};
}

await runSuper(taskArguments);
});
146 changes: 146 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
"lodash.clonedeep": "^4.5.0",
"lodash.uniq": "^4.5.0",
"mocha": "8.1.3",
"mocha-junit-reporter": "2.0.2",
"mustache": "^4.0.1",
"openzeppelin-solidity-2.3.0": "npm:openzeppelin-solidity@2.3.0",
"p-limit": "1.3.0",
Expand Down