Run integration tests in CI

This commit is contained in:
Chris Clark
2015-10-20 14:10:30 -07:00
parent 3fbde86548
commit 2c7ce4a107
2 changed files with 17 additions and 4 deletions

View File

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

View File

@@ -12,7 +12,7 @@ function loadWallet() {
try {
const walletRaw = fs.readFileSync(secretPath, {encoding: 'utf8'}).trim();
return JSON.parse(walletRaw);
} catch(e) {
} catch (e) {
return null;
}
}
@@ -20,6 +20,14 @@ function loadWallet() {
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');
}