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 test suite for build #4464

Merged
merged 1 commit into from Nov 19, 2019
Merged

Add new test suite for build #4464

merged 1 commit into from Nov 19, 2019

Conversation

TomSweeneyRedHat
Copy link
Member

@TomSweeneyRedHat TomSweeneyRedHat commented Nov 6, 2019

Most build testing should be done in Buildah's test
suites, but we should have a minimal amount of tests,
especially testing the parts that are different like
layers and squash. Also the CLI argument handling
of things like the context directory that we've had
issues reported.

This first chunk does a basic test and then checks for
context directory being a file and squash iterations.

More to be added as time goes by.

Signed-off-by: TomSweeneyRedHat tsweeney@redhat.com

@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 6, 2019
@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: TomSweeneyRedHat

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M and removed size/M labels Nov 6, 2019
@TomSweeneyRedHat TomSweeneyRedHat removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 9, 2019
@TomSweeneyRedHat TomSweeneyRedHat changed the title WIP - Add new test suite for build Add new test suite for build Nov 10, 2019
@TomSweeneyRedHat
Copy link
Member Author

Finally happy green test buttons. This is GTG with a couple LGTM's

@rhatdan
Copy link
Member

rhatdan commented Nov 11, 2019

podmanTest.Cleanup()
f := CurrentGinkgoTestDescription()
processTestResult(f)

Copy link
Member

Choose a reason for hiding this comment

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

since I can't seem to find much else...I might as well complain about this extraneous whitespace 😀

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed

@cevich
Copy link
Member

cevich commented Nov 11, 2019

I see a bunch of other build-related directories under test/build/, might you consider putting the new files there? My fear is having that and test/e2e/build might be confusing to other developers/maintainers.


})

It("podman build basic alpine", func() {
Copy link
Member

Choose a reason for hiding this comment

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

Mind changing the name and/or adding a quick comment for this test: It took me a moment to realize the rmi (below) is a secondary test...verifying a ancestor image is removable. It's a small thing, but might save someone else 2 minutes of head-scratching.

Copy link
Member Author

Choose a reason for hiding this comment

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

That's interesting. I basically created this test as a "simple as it can get" to make sure it would work build and did the rmi soley to clean stuff up after. Will comment and/or rename.

Copy link
Member Author

Choose a reason for hiding this comment

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

I tweaked the name and added a comment.


session = podmanTest.PodmanNoCache([]string{"rmi", "-a", "-f"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
Copy link
Member

Choose a reason for hiding this comment

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

There's a lot of duplication here, can it be simplified at all (for example) by feeding a list of string-lists, to a local function?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure how to shrink this down, but could be suffering with late evening brain. Maybe we can chat/point sometime over the next day or two on break?

Copy link
Member Author

Choose a reason for hiding this comment

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

We didn't get a chance to chat in the F2F, If you've tips on condensing, happy to take them, but I'm not seeing it. If there are no other concerns, could we get this in and address in a follow up?

@cevich
Copy link
Member

cevich commented Nov 11, 2019

okay done looking. I appreciate the commit note about these only being basic tests, and explaining why.

IMHO, the two near-by build directories bothers my sensibilities the most, so that's all I'd really like fixed, unless there's some good reason for it. But I KNOW @edsantiago is gunna say something about the code duplication...so probably better fix that before his plane lands 😄

Nice work Tom, clear and easy to read.

@TomSweeneyRedHat
Copy link
Member Author

@cevich re: build directory. Short story, it's staying as if for now, long story, get yourself some popcorn. When we first developed the test suites for build, we weren't able to easily call and run buildah commands from within the test harness. So I created test/test_podman_build.sh and then created the test/build directory to hold all of the various Dockerfiles that it required. When we wanted to run a "build test" we did so 'by hand' outside of the CI. Then the good knight Sir Baude came to our little village and slew all of the test dragons that were plaguing our fair test harness. I recently came to the conclusion that we could now write e2e tests for the build process that would be part of the CI tests and then our village would be safe from all future dragons.

So at this point, I think I'm going to eventually translate the tests from that build script into e2e tests in this new build_test.go file. Once that's complete I can either delete or move the old tests to a new location if you prefer, but for now I'd rather not touch that dragon in case it angrily awakens.

Most build testing should be done in Buildah's test
suites, but we should have a minimal amount of tests,
especially testing the parts that are different like
layers and squash.  Also the CLI argument handling
of things like the context directory that we've had
issues reported.

This first chunk does a basic test and then checks for
context directory being a file and squash iterations.

More to be added as time goes by.

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
@TomSweeneyRedHat
Copy link
Member Author

Happy green tests buttons. @cevich and @edsantiago PTAL

@edsantiago
Copy link
Collaborator

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 19, 2019
@openshift-merge-robot openshift-merge-robot merged commit c673ff8 into containers:master Nov 19, 2019
@TomSweeneyRedHat TomSweeneyRedHat deleted the dev/tsweeney/buildtest branch January 8, 2020 18:43
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 25, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants