Skip to content

Commit

Permalink
Uncomment tests + remove discardOutput call
Browse files Browse the repository at this point in the history
  • Loading branch information
krhubert committed Dec 5, 2018
1 parent 669d864 commit a0b2da9
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 38 deletions.
1 change: 0 additions & 1 deletion commands/service_delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
73 changes: 36 additions & 37 deletions service/volume_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

0 comments on commit a0b2da9

Please sign in to comment.