Skip to content

Commit

Permalink
Run integration tests in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Clark committed Oct 20, 2015
1 parent 8a1bc23 commit 6219daa
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
11 changes: 8 additions & 3 deletions scripts/ci.sh
Expand Up @@ -33,23 +33,28 @@ unittest() {
rm -rf test-compiled
}

integrationtest() {
mocha test/integration/integration-test.js
}

oneNode() {
lint
typecheck
unittest
integrationtest
}

twoNodes() {
case "$NODE_INDEX" in
0) lint && unittest;;
1) typecheck;;
0) lint && integrationtest;;
1) typecheck && unittest;;
*) echo "ERROR: invalid usage"; exit 2;;
esac
}

threeNodes() {
case "$NODE_INDEX" in
0) lint;;
0) lint && integrationtest;;
1) typecheck;;
2) unittest;;
*) echo "ERROR: invalid usage"; exit 2;;
Expand Down
10 changes: 9 additions & 1 deletion test/integration/wallet.js
Expand Up @@ -12,14 +12,22 @@ function loadWallet() {
try {
const walletRaw = fs.readFileSync(secretPath, {encoding: 'utf8'}).trim();
return JSON.parse(walletRaw);
} catch(e) {
} catch (e) {
return null;
}
}

const WALLET = loadWallet();

function getTestKey(key) {
if (process.env.TEST_ADDRESS && process.env.TEST_SECRET) {
if (key === 'address') {
return process.env.TEST_ADDRESS;
}
if (key === 'secret') {
return process.env.TEST_SECRET;
}
}
if (WALLET === null) {
throw new Error('Could not find .ripple_wallet file in home directory');
}
Expand Down

0 comments on commit 6219daa

Please sign in to comment.