From fad32341975636bd1e39bcf87af01213e509aca1 Mon Sep 17 00:00:00 2001 From: Saad <38024451+sdadn@users.noreply.github.com> Date: Wed, 3 Apr 2024 09:33:34 -0500 Subject: [PATCH] updated terra-functional-testing to support docker compose v2 --- packages/terra-functional-testing/CHANGELOG.md | 3 +++ .../src/services/wdio-selenium-docker-service.js | 4 ++-- .../jest/services/wdio-selenium-docker-service.test.js | 6 +++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/terra-functional-testing/CHANGELOG.md b/packages/terra-functional-testing/CHANGELOG.md index 964adfea9..e858a91c7 100644 --- a/packages/terra-functional-testing/CHANGELOG.md +++ b/packages/terra-functional-testing/CHANGELOG.md @@ -2,6 +2,9 @@ ## Unreleased +* Changed + * Updated to support Docker Compose V2. + ## 4.7.0 - (March 8, 2024) * Added diff --git a/packages/terra-functional-testing/src/services/wdio-selenium-docker-service.js b/packages/terra-functional-testing/src/services/wdio-selenium-docker-service.js index aed68e114..d7f74d627 100644 --- a/packages/terra-functional-testing/src/services/wdio-selenium-docker-service.js +++ b/packages/terra-functional-testing/src/services/wdio-selenium-docker-service.js @@ -91,7 +91,7 @@ class SeleniumDockerService { const envVars = this.seleniumVersion ? `TERRA_SELENIUM_DOCKER_VERSION=${this.seleniumVersion} ` : ''; - await exec(`${envVars}docker-compose -f "${this.getDockerComposeFilePath()}" up -d`); + await exec(`${envVars}docker compose -f "${this.getDockerComposeFilePath()}" up -d`); await this.waitForSeleniumHubReady(); logger.info('Successfully started the docker selenium hub.'); @@ -126,7 +126,7 @@ class SeleniumDockerService { if (!this.keepAliveSeleniumDockerService && !this.disableSeleniumService) { logger.info('Shutting down the docker selenium hub...'); - await exec(`docker-compose -f "${this.getDockerComposeFilePath()}" down`); + await exec(`docker compose -f "${this.getDockerComposeFilePath()}" down`); } } } diff --git a/packages/terra-functional-testing/tests/jest/services/wdio-selenium-docker-service.test.js b/packages/terra-functional-testing/tests/jest/services/wdio-selenium-docker-service.test.js index 1b712f557..7e5b1b327 100644 --- a/packages/terra-functional-testing/tests/jest/services/wdio-selenium-docker-service.test.js +++ b/packages/terra-functional-testing/tests/jest/services/wdio-selenium-docker-service.test.js @@ -143,7 +143,7 @@ describe('WDIO Selenium Docker Service', () => { service.startSeleniumHub(); - expect(mockExec).toHaveBeenCalledWith('docker-compose -f "mock-compose-path" up -d'); + expect(mockExec).toHaveBeenCalledWith('docker compose -f "mock-compose-path" up -d'); }); it('should start the selenium hub with the specified version', () => { @@ -154,7 +154,7 @@ describe('WDIO Selenium Docker Service', () => { service.startSeleniumHub(); - expect(mockExec).toHaveBeenCalledWith('TERRA_SELENIUM_DOCKER_VERSION=1234 docker-compose -f "mock-compose-path" up -d'); + expect(mockExec).toHaveBeenCalledWith('TERRA_SELENIUM_DOCKER_VERSION=1234 docker compose -f "mock-compose-path" up -d'); }); }); @@ -225,7 +225,7 @@ describe('WDIO Selenium Docker Service', () => { await service.onComplete(); - expect(mockExec).toHaveBeenCalledWith('docker-compose -f "mock-compose-path" down'); + expect(mockExec).toHaveBeenCalledWith('docker compose -f "mock-compose-path" down'); }); }); });