Fix circle/ci

truffle-plugin
cgewecke 5 years ago
parent c8de349fec
commit d9353b6814
  1. 18
      .circleci/config.yml
  2. 4
      .gitignore
  3. 4
      dist/truffle.plugin.js
  4. 8
      package.json
  5. 3
      temp/.solcover.js
  6. 14
      temp/assets/SimpleError.sol
  7. 1
      temp/assets/asset.js
  8. 25
      temp/contracts/Migrations.sol
  9. 6
      temp/contracts/SimpleError.sol
  10. 4
      temp/migrations/1_initial.js
  11. 4
      temp/migrations/2_deploy.js
  12. 10
      temp/test/simple.js
  13. 86
      temp/truffle-config.js
  14. 1
      test/integration/truffle/test/.marker
  15. 2
      test/units/app.js
  16. 4
      test/util/integration.truffle.js
  17. 9652
      yarn.lock

@ -14,14 +14,18 @@ step_install_nvm: &step_install_nvm
echo "[ -s \"$NVM_DIR/nvm.sh\" ] && . \"$NVM_DIR/nvm.sh\"" >> $BASH_ENV
jobs:
unit-test:
docker:
- image: circleci/node:8.15.0
machine: true
steps:
- checkout
- <<: *step_install_nvm
- run:
name: Delete any old node_modules
command: |
rm -rf node_modules/
- run:
name: Install yarn
command: |
npm install -g yarn
- run:
name: Install dependencies
command: |
@ -30,12 +34,10 @@ jobs:
name: Run tests
command: |
npm run test-cov
# TODO: Re-enable
#- run:
# name: Upload coverage
# command: |
# bash <(curl -s https://codecov.io/bash)
- run:
name: Upload coverage
command: |
bash <(curl -s https://codecov.io/bash)
# This works but takes a while....
e2e-colony:

4
.gitignore vendored

@ -5,4 +5,6 @@ node_modules/
.DS_Store
test/artifacts
test/cache
yarn.lock
yarn.lock
temp
.nyc_output/

@ -33,7 +33,7 @@ const Web3 = require('web3');
const util = require('util');
const ganache = require('ganache-core-sc');
module.exports = async function(truffleConfig){
async function plugin(truffleConfig){
let app;
let error;
let testsErrored = false;
@ -152,4 +152,4 @@ const paths = {
}
}
module.exports = plugin;

@ -8,8 +8,11 @@
"test": "test"
},
"scripts": {
"test": "mocha test/units --timeout 70000 --no-warnings --exit",
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- test/units --timeout 70000 --exit"
"nyc": "SILENT=true nyc --exclude '**/sc_temp/**' --exclude '**/test/**'",
"nyc:ci": "SILENT=true nyc --reporter=lcov --exclude '**/sc_temp/**' --exclude '**/test/**'",
"test": "npm run nyc -- mocha test/units --timeout 70000 --no-warnings --exit",
"test:debug": "mocha test/units --timeout 70000 --no-warnings --exit",
"test-cov": "npm run nyc:ci -- mocha test/units --timeout 70000 --no-warnings --exit"
},
"homepage": "https://github.com/sc-forks/solidity-coverage",
"repository": {
@ -36,6 +39,7 @@
"@nomiclabs/buidler-web3": "^1.0.0-beta.8",
"decache": "^4.5.1",
"mocha": "5.2.0",
"nyc": "^14.1.1",
"solc": "^0.5.10",
"truffle": "^5.0.31",
"truffle-config": "^1.1.18"

@ -1,3 +0,0 @@
module.exports = {
"silent": true
}

@ -1,14 +0,0 @@
// This contract should throw a parse error in instrumentSolidity.js
pragma solidity ^0.5.0;
contract SimpleError {
uint x = 0;
function test(uint val) public {
x = x + val // <-- no semi-colon
}
function getX() public returns (uint){
return x;
}
}

@ -1 +0,0 @@
module.exports = { value: true };

@ -1,25 +0,0 @@
pragma solidity >=0.4.22 <0.6.0;
contract Migrations {
address public owner;
uint public last_completed_migration;
modifier restricted() {
if (msg.sender == owner) { _; }
}
constructor() public {
owner = msg.sender;
}
function setCompleted(uint completed) public restricted {
last_completed_migration = completed;
}
function upgrade(address new_address) public restricted {
Migrations upgraded = Migrations(new_address);
upgraded.setCompleted(last_completed_migration);
}
}

@ -1,6 +0,0 @@
pragma solidity ^0.5.0;
contract Test {
address a;
address a;
}

@ -1,4 +0,0 @@
const Migrations = artifacts.require('./Migrations.sol');
module.exports = async function(deployer) {
await deployer.deploy(Migrations);
};

@ -1,4 +0,0 @@
const A = artifacts.require("SimpleError");
module.exports = function(deployer) { deployer.deploy(A) };

@ -1,10 +0,0 @@
const Simple = artifacts.require('Simple');
contract('Simple', () => {
it('should set x to 5', async function(){
const simple = await Simple.deployed()
await simple.test(5);
const val = await simple.getX.call();
assert.equal(val.toNumber(), 5);
});
});

@ -1,86 +0,0 @@
module.exports = {
"_deepCopy": [
"compilers"
],
"_values": {
"truffle_directory": "/Users/cgewecke/code/sc-forks/v2/solidity-coverage/node_modules",
"working_directory": "/Users/cgewecke/code/sc-forks/v2/solidity-coverage",
"networks": {},
"verboseRpc": false,
"gas": null,
"gasPrice": null,
"from": null,
"confirmations": 0,
"timeoutBlocks": 0,
"production": false,
"skipDryRun": false,
"build": null,
"resolver": null,
"artifactor": null,
"ethpm": {
"ipfs_host": "ipfs.infura.io",
"ipfs_protocol": "https",
"registry": "0x8011df4830b4f696cd81393997e5371b93338878",
"install_provider_uri": "https://ropsten.infura.io/truffle"
},
"compilers": {
"solc": {
"settings": {
"optimizer": {
"enabled": false,
"runs": 200
}
}
},
"vyper": {}
},
"logger": {}
},
"truffle_directory": "/Users/cgewecke/code/sc-forks/v2/solidity-coverage/node_modules",
"working_directory": "/Users/cgewecke/code/sc-forks/v2/solidity-coverage/temp",
"networks": {
"development": {
"host": "localhost",
"port": 8545,
"network_id": "*"
}
},
"verboseRpc": false,
"build": null,
"resolver": null,
"artifactor": null,
"ethpm": {
"ipfs_host": "ipfs.infura.io",
"ipfs_protocol": "https",
"registry": "0x8011df4830b4f696cd81393997e5371b93338878",
"install_provider_uri": "https://ropsten.infura.io/truffle"
},
"logger": {},
"compilers": {
"solc": {
"version": "0.5.3",
"settings": {
"optimizer": {}
}
}
},
"build_directory": "/Users/cgewecke/code/sc-forks/v2/solidity-coverage/temp/build",
"contracts_directory": "/Users/cgewecke/code/sc-forks/v2/solidity-coverage/temp/contracts",
"contracts_build_directory": "/Users/cgewecke/code/sc-forks/v2/solidity-coverage/temp/build/contracts",
"migrations_directory": "/Users/cgewecke/code/sc-forks/v2/solidity-coverage/temp/migrations",
"migrations_file_extension_regexp": {},
"test_directory": "/Users/cgewecke/code/sc-forks/v2/solidity-coverage/temp/test",
"test_file_extension_regexp": {},
"example_project_directory": "/Users/cgewecke/code/sc-forks/v2/solidity-coverage/node_modules/example",
"network_id": null,
"from": null,
"gas": 6721975,
"gasPrice": 20000000000,
"provider": null,
"confirmations": 0,
"production": false,
"timeoutBlocks": 0,
"mocha": {
"reporter": "dot"
}
}

@ -0,0 +1 @@
// because circle won't copy the folder w/out contents

@ -46,7 +46,7 @@ describe('app', function() {
solcoverConfig.silent = true;
})
//afterEach(() => mock.clean());
afterEach(() => mock.clean());
it('simple contract: should generate coverage, cleanup & exit(0)', async function(){
assertCleanInitialState();

@ -9,7 +9,7 @@ const shell = require('shelljs');
const TruffleConfig = require('truffle-config');
const decache = require('decache');
const temp = './temp';
const temp = './sc_temp';
const truffleConfigName = 'truffle-config.js';
const configPath = `${temp}/.solcover.js`;
const testPath = './test/sources/js/';
@ -155,7 +155,7 @@ function installDouble(contracts, test, config) {
function clean() {
shell.config.silent = true;
shell.rm('-Rf', 'temp');
shell.rm('-Rf', temp);
shell.rm('-Rf', 'coverage');
shell.rm('coverage.json');

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save