Skip to content

Commit

Permalink
Fix/retain ci test stack between runs (#218)
Browse files Browse the repository at this point in the history
* Keep the stack running between test runs, use the new `cardanoDbMeta` query to determine readiness
  • Loading branch information
rhyslbw committed Jul 7, 2020
1 parent d26f06f commit 15f7971
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
5 changes: 0 additions & 5 deletions Jenkinsfile
Expand Up @@ -27,11 +27,6 @@ pipeline {
sh 'sleep 10'
sh 'TEST_MODE=e2e yarn test --ci'
}
post {
always {
sh 'docker-compose -p cardano-graphql down'
}
}
}
stage('Publish: Git Revision') {
steps {
Expand Down
3 changes: 2 additions & 1 deletion packages/api-cardano-db-hasura/hasura/docker-entrypoint.sh
Expand Up @@ -8,7 +8,8 @@ POSTGRES_USER=${POSTGRES_USER:-$(cat ${SECRET_DIR}/postgres_user)}
POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-$(cat ${SECRET_DIR}/postgres_password)}
HASURA_GRAPHQL_DATABASE_URL=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}


echo "Sleeping to ensure migrations are applied after db-sync starts"
sleep 15
/bin/pre-start.sh \
--db-url ${HASURA_GRAPHQL_DATABASE_URL} \
--hasura-cli-path /bin/hasura-cli \
Expand Down
16 changes: 8 additions & 8 deletions packages/util-dev/src/e2e_client.ts
Expand Up @@ -20,17 +20,17 @@ export const createE2EClient = async () => {
})
})
await pRetry(async () => {
await client.query({
const result = await client.query({
query: gql`query {
cardano {
tip {
number
}
currentEpoch {
number
}
cardanoDbMeta {
initialized
slotDiffFromNetworkTip
syncPercentage
}}`
})
if (result.data?.cardanoDbMeta.initialized === false) {
throw new Error(`Cardano DB is not initialized: ${JSON.stringify(result.data)}`)
}
}, {
factor: 1.75,
retries: 9,
Expand Down

0 comments on commit 15f7971

Please sign in to comment.