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

pull/845/head
cgewecke 10 months ago committed by GitHub
parent 1c257b0c74
commit fbed395a17
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      .circleci/config.yml
  2. 8
      package.json
  3. 14
      scripts/ci.sh
  4. 11
      scripts/integration.sh
  5. 0
      scripts/nomiclabs.sh
  6. 20
      scripts/run-netlify.sh
  7. 11
      scripts/unit.sh
  8. 0
      scripts/zeppelin.sh
  9. 4
      test/integration/errors.js
  10. 4
      test/integration/flags.js
  11. 4
      test/integration/standard.js
  12. 0
      test/sources/generic/assets/SimpleError.sol
  13. 0
      test/sources/generic/assets/asset.js
  14. 0
      test/sources/generic/contracts/.marker
  15. 0
      test/sources/generic/test/.marker
  16. 0
      test/sources/projects/bad-solcoverjs/.solcover.js
  17. 0
      test/sources/projects/bad-solcoverjs/hardhat.config.js
  18. 0
      test/sources/projects/contract-subfolders/.solcover.js
  19. 0
      test/sources/projects/contract-subfolders/contracts/A/ContractA2.sol
  20. 0
      test/sources/projects/contract-subfolders/contracts/B/ContractB2.sol
  21. 0
      test/sources/projects/contract-subfolders/hardhat.config.js
  22. 0
      test/sources/projects/contract-subfolders/test/contracta2.js
  23. 0
      test/sources/projects/ganache-solcoverjs/.gitignore
  24. 0
      test/sources/projects/ganache-solcoverjs/.solcover.js
  25. 0
      test/sources/projects/ganache-solcoverjs/contracts/ContractA.sol
  26. 0
      test/sources/projects/ganache-solcoverjs/contracts/ContractB.sol
  27. 0
      test/sources/projects/ganache-solcoverjs/contracts/ContractC.sol
  28. 0
      test/sources/projects/ganache-solcoverjs/contracts/Migrations.sol
  29. 0
      test/sources/projects/ganache-solcoverjs/hardhat.config.js
  30. 0
      test/sources/projects/ganache-solcoverjs/test/contracta.js
  31. 0
      test/sources/projects/ganache-solcoverjs/test/contractb.js
  32. 0
      test/sources/projects/ganache-solcoverjs/test/contractc.js
  33. 0
      test/sources/projects/hardhat-compile-config/.solcover.js
  34. 0
      test/sources/projects/hardhat-compile-config/contracts/ContractA1.sol
  35. 0
      test/sources/projects/hardhat-compile-config/contracts/ContractB1.sol
  36. 0
      test/sources/projects/hardhat-compile-config/contracts/ContractC1.sol
  37. 0
      test/sources/projects/hardhat-compile-config/hardhat.config.js
  38. 0
      test/sources/projects/hardhat-compile-config/test/contracta1.js
  39. 0
      test/sources/projects/hardhat-compile-config/test/contractb1.js
  40. 0
      test/sources/projects/hardhat-compile-config/test/contractc1.js
  41. 0
      test/sources/projects/hardhat-gas-reporter/contracts/ContractA.sol
  42. 0
      test/sources/projects/hardhat-gas-reporter/hardhat.config.js
  43. 0
      test/sources/projects/hardhat-gas-reporter/test/test.js
  44. 0
      test/sources/projects/hardhat-reset/.solcover.js
  45. 0
      test/sources/projects/hardhat-reset/contracts/ContractAReset.sol
  46. 0
      test/sources/projects/hardhat-reset/hardhat.config.js
  47. 0
      test/sources/projects/hardhat-reset/test/testReset.js
  48. 0
      test/sources/projects/import-paths/.gitignore
  49. 0
      test/sources/projects/import-paths/.solcover.js
  50. 0
      test/sources/projects/import-paths/assets/RelativePathImport.sol
  51. 0
      test/sources/projects/import-paths/contracts/OnlyUsesImports.sol
  52. 0
      test/sources/projects/import-paths/contracts/UsesImports.sol
  53. 0
      test/sources/projects/import-paths/hardhat.config.js
  54. 0
      test/sources/projects/import-paths/node_modules/package/AnotherImport.sol
  55. 0
      test/sources/projects/import-paths/node_modules/package/NodeModulesImport.sol
  56. 0
      test/sources/projects/import-paths/node_modules/package/package.json
  57. 0
      test/sources/projects/import-paths/test/uses_imports.js
  58. 0
      test/sources/projects/libraries/contracts/CLibrary.sol
  59. 0
      test/sources/projects/libraries/contracts/Migrations.sol
  60. 0
      test/sources/projects/libraries/contracts/PureView.sol
  61. 0
      test/sources/projects/libraries/contracts/UsesPure.sol
  62. 0
      test/sources/projects/libraries/contracts/_Interface.sol
  63. 0
      test/sources/projects/libraries/hardhat.config.js
  64. 0
      test/sources/projects/libraries/test/libraries.js
  65. 0
      test/sources/projects/matrix/.solcover.js
  66. 0
      test/sources/projects/matrix/contracts/MatrixA.sol
  67. 0
      test/sources/projects/matrix/contracts/MatrixB.sol
  68. 0
      test/sources/projects/matrix/expectedMochaOutput.json
  69. 0
      test/sources/projects/matrix/expectedTestMatrixHardhat.json
  70. 0
      test/sources/projects/matrix/expectedTestMatrixTruffle.json
  71. 0
      test/sources/projects/matrix/hardhat.config.js
  72. 0
      test/sources/projects/matrix/test/matrix_a.js
  73. 0
      test/sources/projects/matrix/test/matrix_a_b.js
  74. 0
      test/sources/projects/matrix/truffle-config.js
  75. 0
      test/sources/projects/modifiers/.solcover.js
  76. 0
      test/sources/projects/modifiers/contracts/ModifiersA.sol
  77. 0
      test/sources/projects/modifiers/contracts/ModifiersB.sol
  78. 0
      test/sources/projects/modifiers/contracts/ModifiersC.sol
  79. 0
      test/sources/projects/modifiers/hardhat.config.js
  80. 0
      test/sources/projects/modifiers/test/modifiers.js
  81. 0
      test/sources/projects/modifiers/truffle-config.js
  82. 0
      test/sources/projects/multiple-suites/.solcover.js
  83. 0
      test/sources/projects/multiple-suites/contracts/ContractA.sol
  84. 0
      test/sources/projects/multiple-suites/contracts/ContractB.sol
  85. 0
      test/sources/projects/multiple-suites/contracts/ContractC.sol
  86. 0
      test/sources/projects/multiple-suites/hardhat.config.js
  87. 0
      test/sources/projects/multiple-suites/test/contracta.js
  88. 0
      test/sources/projects/multiple-suites/test/contractb.js
  89. 0
      test/sources/projects/multiple-suites/test/contractc.js
  90. 0
      test/sources/projects/no-sources/hardhat.config.js
  91. 0
      test/sources/projects/parallel/.solcover.js
  92. 0
      test/sources/projects/parallel/contracts/ContractA.sol
  93. 0
      test/sources/projects/parallel/hardhat.config.js
  94. 0
      test/sources/projects/skipping/.solcover.js
  95. 0
      test/sources/projects/skipping/contracts/ContractA.sol
  96. 0
      test/sources/projects/skipping/contracts/skipped-folder/ContractB.sol
  97. 0
      test/sources/projects/skipping/hardhat.config.js
  98. 0
      test/sources/projects/skipping/test/contract.js
  99. 0
      test/sources/projects/solc-8/.solcover.js
  100. 0
      test/sources/projects/solc-8/contracts/Abstract_solc8.sol
  101. Some files were not shown because too many files have changed in this diff Show More

@ -49,7 +49,7 @@ jobs:
- run:
name: Zeppelin E2E
command: |
./scripts/run-zeppelin.sh
./scripts/zeppelin.sh
e2e-nomiclabs:
machine: true
steps:
@ -58,7 +58,7 @@ jobs:
- run:
name: Hardhat E2E
command: |
./scripts/run-nomiclabs.sh
./scripts/nomiclabs.sh
workflows:
version: 2
build:

@ -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": {

@ -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 \

@ -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

@ -1,20 +0,0 @@
#!/usr/bin/env bash
#
# E2E: runs sc-forks/hegic/contracts-v1 coverage and publishes html report in netlify
# for CI deployment preview. This is the netlify "build" step.
#
set -o errexit
# Clone target
rm -rf contracts-v1
git clone https://github.com/sc-forks/contracts-v1.git
cd contracts-v1
# Install solidity-coverage @ current commit
yarn
yarn add --dev https://github.com/sc-forks/solidity-coverage.git#$COMMIT_REF
cat package.json
npm run coverage

@ -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

@ -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

@ -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

@ -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

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save