Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check container is ready in e2e-test ci job #223

Merged
merged 4 commits into from
Oct 20, 2022
Merged

Conversation

leighmcculloch
Copy link
Member

What

Check container is ready in e2e-test ci job by checking if the history ledgers is greater than 0.

Why

I noticed a TODO in here when working in the same file. We did this in the starlight project by adding a simple curl and check on the number of history ledgers ingested. Not sure if that is sufficient here, but I think it might be sufficient.

@leighmcculloch leighmcculloch marked this pull request as ready for review October 19, 2022 20:57
- run: docker run -d -p 8000:8000 stellar/quickstart:soroban-dev --standalone --enable-soroban-rpc --enable-core-artificially-accelerate-time-for-testing --protocol-version 20 && sleep 15
- run: while ! [ "$(curl -s --fail localhost:8000 | jq '.history_latest_ledger')" -gt 0 ]; do echo waiting; sleep 1; done
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you may want to merge this with the prior command

Copy link
Member Author

@leighmcculloch leighmcculloch Oct 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather keep it separate so that it is clear in the GitHub Action when the container has started vs the build is waiting for the container to be ready. That seemed to work well here:
https://github.com/stellar/starlight/blob/919096552e44eec5ec3fd6278922396926239874/.github/workflows/sdk.yml#L59-L62

What do we get out of merging it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No strong opinions, I think it's easier to read if done in the same step (spawn the docker container and make sure it's working).

Co-authored-by: Alfonso Acosta <[email protected]>
@leighmcculloch leighmcculloch enabled auto-merge (squash) October 20, 2022 17:04
@leighmcculloch leighmcculloch merged commit 7d5ee19 into main Oct 20, 2022
@leighmcculloch leighmcculloch deleted the checkcontainer branch October 20, 2022 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants