@@ -66,12 +66,13 @@ func TestLocalComposeUp(t *testing.T) {
66
66
})
67
67
68
68
t .Run ("check compose labels" , func (t * testing.T ) {
69
+ wd , _ := os .Getwd ()
69
70
res := c .RunDockerCmd ("inspect" , projectName + "_web_1" )
70
71
res .Assert (t , icmd.Expected {Out : `"com.docker.compose.container-number": "1"` })
71
72
res .Assert (t , icmd.Expected {Out : `"com.docker.compose.project": "compose-e2e-demo"` })
72
73
res .Assert (t , icmd.Expected {Out : `"com.docker.compose.oneoff": "False",` })
73
74
res .Assert (t , icmd.Expected {Out : `"com.docker.compose.config-hash":` })
74
- res .Assert (t , icmd.Expected {Out : `"com.docker.compose.project.config_files": ". /fixtures/sentences/compose.yaml"` })
75
+ res .Assert (t , icmd.Expected {Out : fmt . Sprintf ( `"com.docker.compose.project.config_files": "%s /fixtures/sentences/compose.yaml"` , wd ) })
75
76
res .Assert (t , icmd.Expected {Out : `"com.docker.compose.project.working_dir":` })
76
77
res .Assert (t , icmd.Expected {Out : `"com.docker.compose.service": "web"` })
77
78
res .Assert (t , icmd.Expected {Out : `"com.docker.compose.version":` })
@@ -122,7 +123,7 @@ func TestLocalComposeRun(t *testing.T) {
122
123
containerID := fields [len (fields )- 1 ]
123
124
assert .Assert (t , ! strings .HasPrefix (containerID , "run-test_front" ))
124
125
if strings .HasPrefix (containerID , "run-test_back" ) {
125
- //only the one-off container for back service
126
+ // only the one-off container for back service
126
127
assert .Assert (t , strings .HasPrefix (containerID , "run-test_back_run_" ), containerID )
127
128
truncatedSlug = strings .Replace (containerID , "run-test_back_run_" , "" , 1 )
128
129
runContainerID = containerID
@@ -200,7 +201,7 @@ func TestLocalComposeBuild(t *testing.T) {
200
201
c := NewParallelE2eCLI (t , binDir )
201
202
202
203
t .Run ("build named and unnamed images" , func (t * testing.T ) {
203
- //ensure local test run does not reuse previously build image
204
+ // ensure local test run does not reuse previously build image
204
205
c .RunDockerOrExitError ("rmi" , "build-test_nginx" )
205
206
c .RunDockerOrExitError ("rmi" , "custom-nginx" )
206
207
@@ -248,7 +249,7 @@ func TestLocalComposeVolume(t *testing.T) {
248
249
const projectName = "compose-e2e-volume"
249
250
250
251
t .Run ("up with build and no image name, volume" , func (t * testing.T ) {
251
- //ensure local test run does not reuse previously build image
252
+ // ensure local test run does not reuse previously build image
252
253
c .RunDockerOrExitError ("rmi" , "compose-e2e-volume_nginx" )
253
254
c .RunDockerOrExitError ("volume" , "rm" , projectName + "_staticVol" )
254
255
c .RunDockerOrExitError ("volume" , "rm" , "myvolume" )
@@ -263,14 +264,14 @@ func TestLocalComposeVolume(t *testing.T) {
263
264
t .Run ("check container volume specs" , func (t * testing.T ) {
264
265
res := c .RunDockerCmd ("inspect" , "compose-e2e-volume_nginx2_1" , "--format" , "{{ json .Mounts }}" )
265
266
output := res .Stdout ()
266
- //nolint
267
+ // nolint
267
268
assert .Assert (t , strings .Contains (output , `"Destination":"/usr/src/app/node_modules","Driver":"local","Mode":"","RW":true,"Propagation":""` ), output )
268
269
})
269
270
270
271
t .Run ("check container bind-mounts specs" , func (t * testing.T ) {
271
272
res := c .RunDockerCmd ("inspect" , "compose-e2e-volume_nginx_1" , "--format" , "{{ json .HostConfig.Mounts }}" )
272
273
output := res .Stdout ()
273
- //nolint
274
+ // nolint
274
275
assert .Assert (t , strings .Contains (output , `"Type":"bind"` ))
275
276
assert .Assert (t , strings .Contains (output , `"Target":"/usr/share/nginx/html"` ))
276
277
})
0 commit comments