@@ -96,26 +96,42 @@ func TestStartStop(t *testing.T) {
96
96
})
97
97
}
98
98
99
- func TestStopWithDependencies (t * testing.T ) {
99
+ func TestStartStopWithDependencies (t * testing.T ) {
100
100
c := NewParallelE2eCLI (t , binDir )
101
- const projectName = "e2e-stop-with-dependencies"
101
+ const projectName = "e2e-start- stop-with-dependencies"
102
102
103
103
defer c .RunDockerComposeCmd ("--project-name" , projectName , "rm" , "-fsv" )
104
104
105
105
t .Run ("Up" , func (t * testing.T ) {
106
106
res := c .RunDockerComposeCmd ("-f" , "./fixtures/dependencies/compose.yaml" , "--project-name" , projectName , "up" , "-d" )
107
- assert .Assert (t , strings .Contains (res .Combined (), "Container e2e-stop-with-dependencies-foo-1 Started" ), res .Combined ())
108
- assert .Assert (t , strings .Contains (res .Combined (), "Container e2e-stop-with-dependencies-bar-1 Started" ), res .Combined ())
107
+ assert .Assert (t , strings .Contains (res .Combined (), "Container e2e-start- stop-with-dependencies-foo-1 Started" ), res .Combined ())
108
+ assert .Assert (t , strings .Contains (res .Combined (), "Container e2e-start- stop-with-dependencies-bar-1 Started" ), res .Combined ())
109
109
})
110
110
111
111
t .Run ("stop foo" , func (t * testing.T ) {
112
112
res := c .RunDockerComposeCmd ("--project-name" , projectName , "stop" , "foo" )
113
113
114
- assert .Assert (t , strings .Contains (res .Combined (), "Container e2e-stop-with-dependencies-foo-1 Stopped" ), res .Combined ())
114
+ assert .Assert (t , strings .Contains (res .Combined (), "Container e2e-start- stop-with-dependencies-foo-1 Stopped" ), res .Combined ())
115
115
116
116
res = c .RunDockerComposeCmd ("--project-name" , projectName , "ps" , "--status" , "running" )
117
- assert .Assert (t , strings .Contains (res .Combined (), "e2e-stop-with-dependencies-bar-1" ), res .Combined ())
118
- assert .Assert (t , ! strings .Contains (res .Combined (), "e2e-stop-with-dependencies-foo-1" ), res .Combined ())
117
+ assert .Assert (t , strings .Contains (res .Combined (), "e2e-start- stop-with-dependencies-bar-1" ), res .Combined ())
118
+ assert .Assert (t , ! strings .Contains (res .Combined (), "e2e-start- stop-with-dependencies-foo-1" ), res .Combined ())
119
119
})
120
120
121
+ t .Run ("start foo" , func (t * testing.T ) {
122
+ res := c .RunDockerComposeCmd ("--project-name" , projectName , "stop" )
123
+ assert .Assert (t , strings .Contains (res .Combined (), "Container e2e-start-stop-with-dependencies-bar-1 Stopped" ), res .Combined ())
124
+
125
+ res = c .RunDockerComposeCmd ("--project-name" , projectName , "start" , "foo" )
126
+ assert .Assert (t , strings .Contains (res .Combined (), "Container e2e-start-stop-with-dependencies-bar-1 Started" ), res .Combined ())
127
+ assert .Assert (t , strings .Contains (res .Combined (), "Container e2e-start-stop-with-dependencies-foo-1 Started" ), res .Combined ())
128
+
129
+ res = c .RunDockerComposeCmd ("--project-name" , projectName , "ps" , "--status" , "running" )
130
+ assert .Assert (t , strings .Contains (res .Combined (), "e2e-start-stop-with-dependencies-bar-1" ), res .Combined ())
131
+ assert .Assert (t , strings .Contains (res .Combined (), "e2e-start-stop-with-dependencies-foo-1" ), res .Combined ())
132
+ })
133
+
134
+ t .Run ("down" , func (t * testing.T ) {
135
+ _ = c .RunDockerComposeCmd ("--project-name" , projectName , "down" )
136
+ })
121
137
}
0 commit comments