diff --git a/commands/service_delete_test.go b/commands/service_delete_test.go index fd41920ae..3f05f382f 100644 --- a/commands/service_delete_test.go +++ b/commands/service_delete_test.go @@ -35,7 +35,6 @@ func TestServiceDeletePreRunE(t *testing.T) { c.discardOutput() require.Equal(t, errNoID, c.preRunE(c.cmd, nil)) - c.discardOutput() c.yes = true c.all = true require.NoError(t, c.preRunE(c.cmd, nil)) diff --git a/service/volume_integration_test.go b/service/volume_integration_test.go index 414a9f4f7..8a62f6393 100644 --- a/service/volume_integration_test.go +++ b/service/volume_integration_test.go @@ -2,42 +2,41 @@ package service -// import ( -// "testing" -// "time" +import ( + "testing" -// "github.com/mesg-foundation/core/container" -// "github.com/stretchr/testify/require" -// ) + "github.com/stretchr/testify/require" +) -// // TODO: the following test doesn't work on CircleCI because we don't use "machine" -// // https://support.circleci.com/hc/en-us/articles/360007324514-How-can-I-mount-volumes-to-docker-containers- -// func TestIntegrationDeleteVolumes(t *testing.T) { -// var ( -// dependencyKey1 = "1" -// dependencyKey2 = "2" -// volumeA = "/a" -// volumeB = "/b" -// s, _ = FromService(&Service{ -// Name: "TestIntegrationDeleteVolumes", -// Dependencies: []*Dependency{ -// { -// Key: dependencyKey1, -// Image: "http-server", -// Volumes: []string{volumeA, volumeB}, -// }, -// { -// Key: dependencyKey2, -// Image: "http-server", -// VolumesFrom: []string{dependencyKey1}, -// }, -// }, -// }, ContainerOption(newIntegrationContainer(t))) -// ) -// _, err := s.Start() -// require.NoError(t, err) -// err = s.Stop() -// require.NoError(t, err) -// err = s.DeleteVolumes() -// require.NoError(t, err) -// } +func TestIntegrationDeleteVolumes(t *testing.T) { + // TODO: the following test doesn't work on CircleCI because we don't use "machine" + // https://support.circleci.com/hc/en-us/articles/360007324514-How-can-I-mount-volumes-to-docker-containers- + t.Skip("doesn't work on CircleCI because we don't use machine") + var ( + dependencyKey1 = "1" + dependencyKey2 = "2" + volumeA = "/a" + volumeB = "/b" + s, _ = FromService(&Service{ + Name: "TestIntegrationDeleteVolumes", + Dependencies: []*Dependency{ + { + Key: dependencyKey1, + Image: "http-server", + Volumes: []string{volumeA, volumeB}, + }, + { + Key: dependencyKey2, + Image: "http-server", + VolumesFrom: []string{dependencyKey1}, + }, + }, + }, ContainerOption(newIntegrationContainer(t))) + ) + _, err := s.Start() + require.NoError(t, err) + err = s.Stop() + require.NoError(t, err) + err = s.DeleteVolumes() + require.NoError(t, err) +}