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

Request: some kind of integration test during CI? #84

Closed
mac-chaffee opened this issue Jul 30, 2020 · 3 comments
Closed

Request: some kind of integration test during CI? #84

mac-chaffee opened this issue Jul 30, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@mac-chaffee
Copy link
Contributor

mac-chaffee commented Jul 30, 2020

Description
Given #78 was discovered by a manual integration test, what do you think of a contribution to add some kind of integration test in github actions?

The general idea would be to compile and run docuum with a low threshold, pull a few images, then assert the oldest image was removed.

Not super familiar with the restrictions github actions places on docker access, but if I were to run the test locally, it would be:

#!/bin/bash
set -Eeuo pipefail

cargo run -- "--threshold=50MB" &

# ~27MB
docker run debian@sha256:05f7608c53541eab93132a7ed1de94f6881d1041b16a91e3294068e05ceba546 true
# ~2MB
docker run alpine@sha256:a15790640a6690aa1730c38cf0a440e2aa44aaca9b0e8931a9f2b0d7cc90fd65 true
# ~27MB
docker run ubuntu@sha256:60f560e52264ed1cb7829a0d59b1ee7740d7580e0eb293aca2d722136edb1e24 true

sleep 2

# Assert alpine and ubuntu still exist
docker inspect alpine@sha256:a15790640a6690aa1730c38cf0a440e2aa44aaca9b0e8931a9f2b0d7cc90fd65 > /dev/null
docker inspect ubuntu@sha256:60f560e52264ed1cb7829a0d59b1ee7740d7580e0eb293aca2d722136edb1e24 > /dev/null
# Assert debian was removed
! docker inspect debian@sha256:05f7608c53541eab93132a7ed1de94f6881d1041b16a91e3294068e05ceba546 > /dev/null || { echo "The debian image should have been deleted."; false; }

kill $!

Alternatives considered

  • Could perform the test inside rust code (rather than bash scripting). More verbose, but safer.
  • If there's no easy way to start with a clean, image-free docker daemon inside github actions, maybe https://hub.docker.com/_/docker could be used?
  • Other testing strategies?
@mac-chaffee mac-chaffee added the enhancement New feature or request label Jul 30, 2020
@mac-chaffee mac-chaffee changed the title Some kind of integration test during CI Request: some kind of integration test during CI? Jul 30, 2020
@stepchowfun
Copy link
Owner

stepchowfun commented Jul 30, 2020

I think this is a fantastic idea.

In the past week or so, there has been quite a bit of activity in this repo: various PRs, feature requests, etc. Unfortunately it's starting to overwhelm me (since I have a full-time job that is unrelated to Docuum), but I'd love to do this as soon as I have time. Alternatively, I would welcome a PR for it.

I think the easiest way to implement this would be to simply add a new task in toast.yml. Then we could just run something like toast run-integration-tests to run the tests locally and in CI.

@mac-chaffee
Copy link
Contributor Author

Awesome, I can start exploring as I find time too 👍

@mac-chaffee
Copy link
Contributor Author

Addressed in #114 , I just forgot to close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants