Skip to content

*_test.go: fix test conditions#1117

Merged
estesp merged 1 commit intocontainerd:masterfrom
AkihiroSuda:fix-root-test
Jun 30, 2017
Merged

*_test.go: fix test conditions#1117
estesp merged 1 commit intocontainerd:masterfrom
AkihiroSuda:fix-root-test

Conversation

@AkihiroSuda
Copy link
Copy Markdown
Member

  • add testutil.RequiresRoot() to TestMain
  • moved if testing.Short{ t.Skip() } from each of the tests into a
    common newClient()

Signed-off-by: Akihiro Suda [email protected]

@codecov-io
Copy link
Copy Markdown

codecov-io commented Jun 29, 2017

Codecov Report

Merging #1117 into master will decrease coverage by 19.8%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##           master    #1117       +/-   ##
===========================================
- Coverage   54.51%   34.71%   -19.81%     
===========================================
  Files          16       28       +12     
  Lines        1229     2322     +1093     
===========================================
+ Hits          670      806      +136     
- Misses        386     1341      +955     
- Partials      173      175        +2
Impacted Files Coverage Δ
io_unix.go 0% <0%> (ø)
io.go 0% <0%> (ø)
client_unix.go 0% <0%> (ø)
spec_unix.go 60.74% <0%> (ø)
image.go 0% <0%> (ø)
process.go 0% <0%> (ø)
client.go 0.78% <0%> (ø)
grpc.go 0% <0%> (ø)
task.go 0% <0%> (ø)
spec.go 33.33% <0%> (ø)
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8a00710...eeb74d4. Read the comment docs.

Comment thread testutil/helpers.go Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why are you taking stderr and the os.Exit functions to this? Wouldn't it always be the same for testing?

- add `testutil.RequiresRoot()` to TestMain
- moved `if testing.Short{ t.Skip() }` from each of the tests into a
common `newClient()`

Signed-off-by: Akihiro Suda <[email protected]>
@AkihiroSuda
Copy link
Copy Markdown
Member Author

@crosbymichael ok, updated PR

@crosbymichael
Copy link
Copy Markdown
Member

LGTM

Copy link
Copy Markdown
Member

@estesp estesp left a comment

Choose a reason for hiding this comment

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

LGTM

@estesp estesp merged commit 3332042 into containerd:master Jun 30, 2017
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.

4 participants