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

Add new integration testing flow #189

Merged
merged 1 commit into from
Dec 16, 2021

Conversation

cgwalters
Copy link
Member

The core idea here is that we take our built binary and inject
it into a fcos container image, where we can do further testing.

For now just to prove this out I've added an internal testutils
command.

(I think I'd like to write more tests in Rust, but to do that
correctly we also want a bin-unit-tests feature like rpm-ostree
has, which can come later)

@cgwalters cgwalters force-pushed the ci-in-container branch 3 times, most recently from 1d5d790 to c9b81b2 Compare December 16, 2021 20:28

fn is_container() -> bool {
// https://stackoverflow.com/questions/20010199/how-to-determine-if-a-process-runs-inside-lxc-docker
for p in ["/run/.containerenv", "/.dockerenv"] {
Copy link
Member Author

Choose a reason for hiding this comment

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

OK this was fun. I wish I could add a comment on https://stackoverflow.com/questions/20010199/how-to-determine-if-a-process-runs-inside-lxc-docker but apparently I don't have enough reputation.

@cgwalters
Copy link
Member Author

The thing where GH actions gives you a full VM but makes it trivial to run in a (potentially privileged) container there, or jump between containers is actually fairly powerful.

This is proving out "integration tests" that jump from a build environment into another container.

The main thought here is that with this we can start on #159 and because we'll now need to be testing ostree-rs-ext inside a container.

That said, we clearly also want VM tests.

The core idea here is that we take our built binary and inject
it into a fcos container image, where we can do further testing.

For now just to prove this out I've added an internal testutils
command.

(I think I'd like to write more tests in Rust, but to do that
 correctly we also want a `bin-unit-tests` feature like rpm-ostree
 has, which can come later)
Copy link
Member

@jmarrero jmarrero left a comment

Choose a reason for hiding this comment

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

lgtm

@cgwalters cgwalters merged commit cb45b45 into ostreedev:main Dec 16, 2021
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.

None yet

2 participants