Skip to content

Commit

Permalink
Merge pull request #795 from HusterWan/wanziren/optimize-update-command
Browse files Browse the repository at this point in the history
test: fix ci test
  • Loading branch information
HusterWan authored Mar 2, 2018
2 parents 0a6f76b + a62168b commit ce2cfc4
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 11 deletions.
1 change: 1 addition & 0 deletions test/cli_alikernel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

"github.com/alibaba/pouch/test/command"
"github.com/alibaba/pouch/test/environment"

"github.com/go-check/check"
"github.com/gotestyourself/gotestyourself/icmd"
)
Expand Down
2 changes: 1 addition & 1 deletion test/cli_create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/gotestyourself/gotestyourself/icmd"
)

// PouchCreateSuite is the test suite for help CLI.
// PouchCreateSuite is the test suite for create CLI.
type PouchCreateSuite struct{}

func init() {
Expand Down
2 changes: 1 addition & 1 deletion test/cli_images_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"github.com/pkg/errors"
)

// PouchImagesSuite is the test suite for help CLI.
// PouchImagesSuite is the test suite for images CLI.
type PouchImagesSuite struct{}

func init() {
Expand Down
2 changes: 1 addition & 1 deletion test/cli_ps_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/gotestyourself/gotestyourself/icmd"
)

// PouchPsSuite is the test suite for help CLI.
// PouchPsSuite is the test suite for ps CLI.
type PouchPsSuite struct{}

func init() {
Expand Down
2 changes: 1 addition & 1 deletion test/cli_pull_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/gotestyourself/gotestyourself/icmd"
)

// PouchPullSuite is the test suite for help CLI.
// PouchPullSuite is the test suite for pull CLI.
type PouchPullSuite struct{}

func init() {
Expand Down
2 changes: 1 addition & 1 deletion test/cli_rmi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/gotestyourself/gotestyourself/icmd"
)

// PouchRmiSuite is the test suite for help CLI.
// PouchRmiSuite is the test suite for rmi CLI.
type PouchRmiSuite struct{}

func init() {
Expand Down
2 changes: 1 addition & 1 deletion test/cli_run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/gotestyourself/gotestyourself/icmd"
)

// PouchRunSuite is the test suite for help CLI.
// PouchRunSuite is the test suite for run CLI.
type PouchRunSuite struct{}

func init() {
Expand Down
2 changes: 1 addition & 1 deletion test/cli_start_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/kr/pty"
)

// PouchStartSuite is the test suite for help CLI.
// PouchStartSuite is the test suite for start CLI.
type PouchStartSuite struct{}

func init() {
Expand Down
2 changes: 1 addition & 1 deletion test/cli_stop_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/gotestyourself/gotestyourself/icmd"
)

// PouchStopSuite is the test suite for help CLI.
// PouchStopSuite is the test suite for stop CLI.
type PouchStopSuite struct{}

func init() {
Expand Down
2 changes: 1 addition & 1 deletion test/cli_unpause_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/gotestyourself/gotestyourself/icmd"
)

// PouchUnpauseSuite is the test suite for help CLI.
// PouchUnpauseSuite is the test suite for unpause CLI.
type PouchUnpauseSuite struct{}

func init() {
Expand Down
12 changes: 11 additions & 1 deletion test/cli_update_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/gotestyourself/gotestyourself/icmd"
)

// PouchUpdateSuite is the test suite for help CLI.
// PouchUpdateSuite is the test suite for update CLI.
type PouchUpdateSuite struct{}

func init() {
Expand Down Expand Up @@ -70,6 +70,8 @@ func (suite *PouchUpdateSuite) TestUpdateCpu(c *check.C) {
}

c.Assert(metaJSON.HostConfig.CPUShares, check.Equals, int64(40))

command.PouchRun("rm", "-f", name).Assert(c, icmd.Success)
}

// TestUpdateRunningContainer is to verify the correctness of updating a running container.
Expand Down Expand Up @@ -108,6 +110,8 @@ func (suite *PouchUpdateSuite) TestUpdateRunningContainer(c *check.C) {
}

c.Assert(metaJSON.HostConfig.Memory, check.Equals, int64(524288000))

command.PouchRun("rm", "-f", name).Assert(c, icmd.Success)
}

// TestUpdateStoppedContainer is to verify the correctness of updating a stopped container.
Expand Down Expand Up @@ -148,6 +152,8 @@ func (suite *PouchUpdateSuite) TestUpdateStoppedContainer(c *check.C) {
}

c.Assert(metaJSON.HostConfig.Memory, check.Equals, int64(524288000))

command.PouchRun("rm", "-f", name).Assert(c, icmd.Success)
}

// TestUpdateContainerInvalidValue is to verify the correctness of updating a container with invalid value.
Expand All @@ -163,6 +169,8 @@ func (suite *PouchUpdateSuite) TestUpdateContainerInvalidValue(c *check.C) {
if out := res.Combined(); !strings.Contains(out, expectString) {
c.Fatalf("unexpected output %s expected %s", out, expectString)
}

command.PouchRun("rm", "-f", name).Assert(c, icmd.Success)
}

// TestUpdateContainerWithoutFlag is to verify the correctness of updating a container without any flag.
Expand All @@ -172,4 +180,6 @@ func (suite *PouchUpdateSuite) TestUpdateContainerWithoutFlag(c *check.C) {
command.PouchRun("run", "-d", "-m", "300M", "--name", name, busyboxImage).Assert(c, icmd.Success)

command.PouchRun("update", name).Assert(c, icmd.Success)

command.PouchRun("rm", "-f", name).Assert(c, icmd.Success)
}
2 changes: 1 addition & 1 deletion test/cli_version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/gotestyourself/gotestyourself/icmd"
)

// PouchVersionSuite is the test suite for help CLI.
// PouchVersionSuite is the test suite for version CLI.
type PouchVersionSuite struct{}

func init() {
Expand Down

0 comments on commit ce2cfc4

Please sign in to comment.