Skip to content

Remove some checkers and use gotest.tools#39001

Merged
cpuguy83 merged 2 commits intomoby:masterfrom
thaJeztah:reduce_checkers
Apr 9, 2019
Merged

Remove some checkers and use gotest.tools#39001
cpuguy83 merged 2 commits intomoby:masterfrom
thaJeztah:reduce_checkers

Conversation

@thaJeztah
Copy link
Member

found some WIP changes in my stash, so let me push it as a PR 😅

@codecov
Copy link

codecov bot commented Apr 4, 2019

Codecov Report

Merging #39001 into master will increase coverage by 0.01%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master   #39001      +/-   ##
==========================================
+ Coverage   36.89%   36.91%   +0.01%     
==========================================
  Files         613      613              
  Lines       45421    45421              
==========================================
+ Hits        16759    16766       +7     
+ Misses      26370    26365       -5     
+ Partials     2292     2290       -2

@thaJeztah thaJeztah force-pushed the reduce_checkers branch 11 times, most recently from 48404cf to b279065 Compare April 4, 2019 18:25
@thaJeztah thaJeztah changed the title Remove some checkers and use gotest.tools [WIP] Remove some checkers and use gotest.tools Apr 4, 2019
@thaJeztah thaJeztah force-pushed the reduce_checkers branch 9 times, most recently from 678a266 to 55895d4 Compare April 5, 2019 00:13
@thaJeztah thaJeztah changed the title [WIP] Remove some checkers and use gotest.tools Remove some checkers and use gotest.tools Apr 5, 2019
@thaJeztah
Copy link
Member Author

ping @vdemeester @yongtang @cpuguy83 PTAL

Signed-off-by: Sebastiaan van Stijn <[email protected]>
Copy link
Member Author

@thaJeztah thaJeztah Apr 5, 2019

Choose a reason for hiding this comment

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

Interesting; looks like this was incorrect on multiple levels;

  • err is actually an exitCode (int), so checking for nil / not-nil doesn't really make sense
  • I rewrote it to check for a non-zero exit code (as that's what the code above appeared to be checking for), but it actually should run succesfully. The test passed, because 0 != nil 🤷‍♂️

I'll fix my rewrite, as it's currently failing because of the above;

02:53:53 FAIL: docker_cli_restart_test.go:80: DockerSuite.TestRestartDisconnectedContainer
02:53:53 
02:53:53 assertion failed: exitCode is 0

@thaJeztah
Copy link
Member Author

whoop, green!

@vdemeester ptal 🤗🙈🙊🙉

Copy link
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

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

LGTM 🐯

A comment though : we should document why we are using gotest.tools assert instead of go-check functions. Also, we may want to switch to testing.T at some point 💃

TimeEquals = shakers.TimeEquals
True = shakers.True
TimeIgnore = shakers.TimeIgnore
Contains = shakers.Contains
Copy link
Member

Choose a reason for hiding this comment

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

Can we get rid of all of those ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, we should; some of these were used as part of a waitForSomething loops, so I had to look into those (didn't come round to that yet); thought to at least get some of this stuff unused, to (to an extent) help migrating these tests to the new suite.

Still a lot left to clean up though 😅

Copy link
Member

@cpuguy83 cpuguy83 left a comment

Choose a reason for hiding this comment

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

LGTM

@cpuguy83 cpuguy83 merged commit e245856 into moby:master Apr 9, 2019
@thaJeztah thaJeztah deleted the reduce_checkers branch April 9, 2019 18:01
@thaJeztah
Copy link
Member Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants