-
Notifications
You must be signed in to change notification settings - Fork 949
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
test: split cli_run_test into several files #1385
Conversation
f647600
to
6a888fb
Compare
Codecov Report
@@ Coverage Diff @@
## master #1385 +/- ##
=======================================
Coverage 38.55% 38.55%
=======================================
Files 248 248
Lines 16516 16516
=======================================
Hits 6368 6368
Misses 9328 9328
Partials 820 820
|
test/cli_run_blkio_test.go
Outdated
|
||
// test if cgroup has record the real value | ||
containerID := result[0].ID | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why use block here?
test/cli_run_blkio_test.go
Outdated
c.Assert(result[0].HostConfig.BlkioWeightDevice[0].Path, check.Equals, testDisk) | ||
c.Assert(result[0].HostConfig.BlkioWeightDevice[0].Weight, check.Equals, uint16(100)) | ||
|
||
// test if cgroup has record the real value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the comment since it is useless code
test/cli_run_cgroup_test.go
Outdated
if !strings.Contains(string(out), "314572800") { | ||
c.Fatalf("unexpected output %s expected %s\n", string(out), "314572800") | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the empty line
test/cli_run_cgroup_test.go
Outdated
|
||
} | ||
|
||
// TestRunInvalidCgroupParent checks that a specially-crafted cgroup parent doesn't cause Docker to crash or start modifying /. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docker?
test/cli_run_cgroup_test.go
Outdated
} | ||
|
||
func testRunInvalidCgroupParent(c *check.C, cgroupParent, cleanCgroupParent, name string) { | ||
command.PouchRun("run", "-m", "300M", "--cgroup-parent", cgroupParent, "--name", name, busyboxImage, "cat", "/proc/self/cgroup").Assert(c, icmd.Success) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we follow the guide about keeping the line around 80 chars? It can help us to read the code.
b9b43a2
to
6f12e19
Compare
Signed-off-by: letty <[email protected]>
LGTM Nice! @Letty5411 |
Signed-off-by: letty [email protected]
Ⅰ. Describe what this PR did
Fix error usage of package
command
in cli_run_test.go. And separate this file into several files.Ⅱ. Does this pull request fix one issue?
Ⅲ. Describe how you did it
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews