Skip to content

Commit

Permalink
Add integration test step in circle CI config
Browse files Browse the repository at this point in the history
  • Loading branch information
Marccio Silva committed Jul 30, 2021
1 parent 45c06c4 commit 4337471
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 4 deletions.
15 changes: 12 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ jobs:
# documented at https://circleci.com/docs/2.0/circleci-images/
# - image: circleci/mongo:3.4.4
- image: trufflesuite/ganache-cli
command: ganache-cli -i 5777 -l 6700000
command: ganache-cli -i 5777 -l 6700000 -k istanbul
- image: trufflesuite/ganache-cli
command: ganache-cli -i 5776 -p 8546 -k istanbul
steps:
- checkout
# Download and cache dependencies
Expand All @@ -19,6 +21,7 @@ jobs:
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run: cd bridge && npm ci
- run: cd federator && npm ci
- save_cache:
paths:
- bridge/node_modules
Expand All @@ -29,12 +32,18 @@ jobs:
cd bridge
npm run lint
- run:
name: contracts migrate
name: deploy contracts in development and mirror
command: |
cd bridge
npm run migrate
npm run deployLocalIntegrationTest
- run:
name: contracts integration test
command: |
cd federator
npm run integrationTest
- run:
name: contracts test
command: |
cd bridge
npm test
12 changes: 12 additions & 0 deletions federator/config/test.local.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const fs = require('fs');
module.exports = {
mainchain: require('./development.json'), //the json containing the smart contract addresses in rsk
sidechain: require('./mirrorDevelopment.json'), //the json containing the smart contract addresses in eth
runEvery: 2, // In minutes,
confirmations: 0, // Number of blocks before processing it, if working with ganache set as 0
privateKey: fs.readFileSync(`${__dirname}/test.local.federator.key`, 'utf8'),
storagePath: './db',
etherscanApiKey: '',
runHeartbeatEvery: 1, // In hours
endpointsPort: 5000, // Server port
}
Empty file.
3 changes: 2 additions & 1 deletion federator/integrationTest/integrationTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ const Web3 = require('web3');
const log4js = require('log4js');

//configurations
const config = require('../config/config.js');
// TODO: rename file or explain why it's used here.
const config = require('../config/test.local.config.js');
const logConfig = require('../config/log-config.json');
const abiBridge = require('../../abis/Bridge.json');
const abiMainToken = require('../../abis/ERC677.json');
Expand Down

0 comments on commit 4337471

Please sign in to comment.