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

test: split cli_run_test into several files #1385

Merged
merged 1 commit into from
May 24, 2018

Conversation

Letty5411
Copy link
Contributor

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

@Letty5411 Letty5411 changed the title test: refine cli_run_test with sperated files test: split cli_run_test into several files May 23, 2018
@Letty5411 Letty5411 force-pushed the 0523-test branch 3 times, most recently from f647600 to 6a888fb Compare May 23, 2018 07:18
@codecov-io
Copy link

codecov-io commented May 23, 2018

Codecov Report

Merging #1385 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1385   +/-   ##
=======================================
  Coverage   38.55%   38.55%           
=======================================
  Files         248      248           
  Lines       16516    16516           
=======================================
  Hits         6368     6368           
  Misses       9328     9328           
  Partials      820      820
Impacted Files Coverage Δ
daemon/containerio/container_io.go 59.74% <0%> (-1.3%) ⬇️
daemon/logger/jsonfile/utils.go 71.66% <0%> (+1.66%) ⬆️


// test if cgroup has record the real value
containerID := result[0].ID
{
Copy link
Contributor

Choose a reason for hiding this comment

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

Why use block here?

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
Copy link
Contributor

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

if !strings.Contains(string(out), "314572800") {
c.Fatalf("unexpected output %s expected %s\n", string(out), "314572800")
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Remove the empty line


}

// TestRunInvalidCgroupParent checks that a specially-crafted cgroup parent doesn't cause Docker to crash or start modifying /.
Copy link
Contributor

Choose a reason for hiding this comment

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

Docker?

}

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)
Copy link
Contributor

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.

@fuweid fuweid self-assigned this May 23, 2018
@Letty5411 Letty5411 force-pushed the 0523-test branch 2 times, most recently from b9b43a2 to 6f12e19 Compare May 24, 2018 02:12
@fuweid
Copy link
Contributor

fuweid commented May 24, 2018

LGTM

Nice! @Letty5411

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