From cd10088fdeaa13965c53e63a19e9f3d6927552c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Niedzielski?= Date: Sat, 13 Jul 2019 13:40:40 +0200 Subject: [PATCH] Fix workdir test failing on CircleCI See: https://support.circleci.com/hc/en-us/articles/360007324514-How-can-I-mount-volumes-to-docker-containers- --- test/index.test.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/index.test.js b/test/index.test.js index 412b7463f..9340a6561 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -123,14 +123,18 @@ describe('starts containers properly with --build and --timeout options', () => test('ensure container command executed with --workdir command option', async () => { await compose.down({ cwd: path.join(__dirname), log: logOutput, config: 'docker-compose-42.yml' }); - await compose.run('some-service', 'cat hello.txt', { + const result = await compose.run('some-service', 'pwd', { cwd: path.join(__dirname), log: true, config: 'docker-compose-42.yml', composeOptions: [ '--verbose' ], - commandOptions: [ '--workdir', '/mountedvolume/nested/dir' ] + + // Alpine has "/" as default + commandOptions: [ '--workdir', '/home/root' ] }); + expect(result.out).toBe('/home/root\n'); + await compose.down({ cwd: path.join(__dirname), log: logOutput, config: 'docker-compose-42.yml' }); });