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

continue e2e test cleanup #12398

Merged
merged 4 commits into from
Nov 24, 2021

Conversation

edsantiago
Copy link
Member

Some more cleanup of assertions in e2e tests.

The original intent was maintainability: make it so tests emit useful diagnostics. But in the process I discovered various tests that were NOPs. I've tried to fix those to the best of my ability, but some need further tweaking.

@edsantiago
Copy link
Member Author

Four separate commits; I recommend reviewing each independently. And, there are some FIXMEs that I need help with. TIA.

@openshift-ci openshift-ci bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Nov 23, 2021
@edsantiago edsantiago force-pushed the remove_betrue branch 2 times, most recently from 08b6b25 to 7c29d29 Compare November 23, 2021 16:50
Copy link
Member Author

@edsantiago edsantiago left a comment

Choose a reason for hiding this comment

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

See questions inline.

@@ -554,7 +542,7 @@ VOLUME /test/`, ALPINE)
Skip("Overlay mounts not supported when running in a container")
}
if rootless.IsRootless() {
if _, err := exec.LookPath("fuse_overlay"); err != nil {
if _, err := exec.LookPath("fuse-overlayfs"); err != nil {
Copy link
Member Author

Choose a reason for hiding this comment

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

This was a typo. Tests were never running rootless, because there is no such binary as fuse_overlay.

FIXME: is fuse-overlayfs needed even in the new world where overlay is supported in the kernel? Does this conditional need to change?

Copy link
Member

Choose a reason for hiding this comment

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

Yes I think this should be changed, @flouthoc @giuseppe WDYT?

Copy link
Member

Choose a reason for hiding this comment

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

I agree, we should run the tests no matter what.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes i remember changing it for some new tests https://github.com/containers/podman/pull/11650/files but it should be done across the code.

test/e2e/save_test.go Outdated Show resolved Hide resolved
test/e2e/events_test.go Outdated Show resolved Hide resolved
@Luap99
Copy link
Member

Luap99 commented Nov 23, 2021

@edsantiago I know it is tedious to fix all the lint errors but can you add this diff and fix the errors:

diff --git a/.golangci.yml b/.golangci.yml
index cf067a58c..f3338b9ae 100644
--- a/.golangci.yml
+++ b/.golangci.yml
@@ -6,7 +6,6 @@ run:
   skip-dirs:
     - contrib
     - dependencies
-    - test
   skip-files:
     - swagger.go
   modules-download-mode: readonly

@edsantiago
Copy link
Member Author

@Luap99 not in this PR: this is already close to what I consider the limit of unreviewability. I will address it in a followup PR.

@Luap99
Copy link
Member

Luap99 commented Nov 23, 2021

@edsantiago sure, thanks

@edsantiago
Copy link
Member Author

@containers/podman-maintainers PTAL, especially at my three questions.

(I'm not going to bother re-running the failed system test. It is a flake, and irrelevant for purposes of this PR)

Continue eliminating GrepString() and BeTrue(), in tiny
incremental steps. Here I take the liberty of refactoring
some hard-to-read code by adding a helper.

Signed-off-by: Ed Santiago <[email protected]>
via: sed -i -e 's/Expect(StringInSlice(\(.*\), \(.*\))).To(BeTrue())/Expect(\2)\.To(ContainElement(\1))/' test/e2e/*_test.go

Signed-off-by: Ed Santiago <[email protected]>
These were NOPs, and were testing the wrong thing (pod ID,
not container ID). Fixed manually.

Signed-off-by: Ed Santiago <[email protected]>
@edsantiago edsantiago changed the title WIP: continue e2e test cleanup continue e2e test cleanup Nov 23, 2021
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 23, 2021
That previous commit made me wonder if there are any other
instances of Expect() with no assertions.

   grep Expect test/e2e/*_test.go |egrep -v '\.(To|NotTo|Should)'

...finds a couple of handfuls, most of which are OK (continued
on the next line) but a few of which are bugs. Fix those.

Signed-off-by: Ed Santiago <[email protected]>
@rhatdan
Copy link
Member

rhatdan commented Nov 24, 2021

LGTM

Copy link
Member

@giuseppe giuseppe left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 24, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 24, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: edsantiago, giuseppe

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:
  • OWNERS [edsantiago,giuseppe]

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

@openshift-merge-robot openshift-merge-robot merged commit 4b014a3 into containers:main Nov 24, 2021
@edsantiago edsantiago deleted the remove_betrue branch November 24, 2021 11:47
@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 22, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 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.

6 participants