-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
99 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export const PlayWriteInterfaceName = '_uui_playwrite_interface'; | ||
export const PlayWrightInterfaceName = '_uui_playwright_interface'; | ||
|
||
export const SCREENSHOT_WIDTH_LIMIT = 1280; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
.report | ||
.Dockerfile | ||
.docker-compose.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,42 @@ | ||
import { generateDockerfile } from '../dockerTemplates/Dockerfile'; | ||
import { generateDockerCompose } from '../dockerTemplates/docker-compose.yml'; | ||
import { getCwd, spawnProcessSync, hasCliArg } from '../cliUtils'; | ||
import { CLI_ARGS, YARN_TASKS } from '../constants'; | ||
import { spawnProcessSync, hasCliArg } from '../cliUtils'; | ||
import { CLI_ARGS, DOCKER_FILES, DOCKER_IMAGE_TAGS, YARN_TASKS } from '../constants'; | ||
import { ip } from 'address'; | ||
|
||
main(); | ||
|
||
export function main() { | ||
createDockerFiles(); | ||
runDockerCompose(); | ||
} | ||
|
||
function runDockerCompose() { | ||
function main() { | ||
const updateSnapshots = hasCliArg(CLI_ARGS.PW_DOCKER_UPDATE_SNAPSHOTS); | ||
const dockerFile = DOCKER_FILES.DOCKER_FILE; | ||
const imageTag = DOCKER_IMAGE_TAGS.TEST; | ||
spawnProcessSync({ | ||
cmd: 'yarn', | ||
args: [ | ||
YARN_TASKS.DOCKER_CLI_BUILD, | ||
'-t', | ||
imageTag, | ||
'-f', | ||
dockerFile, | ||
'.', | ||
], | ||
cwd: process.cwd(), | ||
}); | ||
spawnProcessSync({ | ||
cmd: 'yarn', | ||
args: [YARN_TASKS.DOCKER], | ||
cwd: getCwd({ isInsideMonorepo: false }), | ||
args: [ | ||
YARN_TASKS.DOCKER_CLI_RUN, | ||
'-e', | ||
'UUI_IS_DOCKER=true', | ||
'-e', | ||
`UUI_APP_BASE_URL_FALLBACK=${getBaseUrlFallback()}`, | ||
imageTag, | ||
'yarn', | ||
updateSnapshots ? YARN_TASKS.TEST_E2E_UPDATE : YARN_TASKS.TEST_E2E, | ||
], | ||
cwd: process.cwd(), | ||
}); | ||
} | ||
|
||
function createDockerFiles() { | ||
const updateSnapshots = hasCliArg(CLI_ARGS.PW_DOCKER_UPDATE); | ||
generateDockerfile({ updateSnapshots }); | ||
generateDockerCompose({ updateSnapshots }); | ||
function getBaseUrlFallback() { | ||
const currentMachineIpv4 = ip(); | ||
return currentMachineIpv4 ? `http://${currentMachineIpv4}:3000` : ''; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,18 @@ | ||
export const CLI_ARGS = { | ||
PW_DOCKER_UPDATE: '--update', | ||
SHOW_REPORT: 'show-report', | ||
PW_DOCKER_UPDATE_SNAPSHOTS: '--update-snapshots', | ||
}; | ||
export const YARN_TASKS = { | ||
DOCKER: 'docker', | ||
DOCKER_CLI_BUILD: 'docker-cli-build', | ||
DOCKER_CLI_RUN: 'docker-cli-run', | ||
TEST_E2E: 'test-e2e', | ||
TEST_E2E_UPDATE: 'test-e2e-update', | ||
}; | ||
export const NPX_TASKS = { | ||
PLAYWRIGHT: 'playwright', | ||
}; | ||
export const DOCKER_IMAGE_NAMES = { | ||
TEST: 'docker-e2e-test', | ||
TEST_UPDATE: 'docker-e2e-test-update', | ||
export const DOCKER_IMAGE_TAGS = { | ||
TEST: 'uui-e2e-test', | ||
}; | ||
export const DOCKER_FILES = { | ||
DOCKER_FILE: '.Dockerfile', | ||
DOCKER_COMPOSE: '.docker-compose.yml', | ||
DOCKER_FILE: 'test.Dockerfile', | ||
}; |
This file was deleted.
Oops, something went wrong.
32 changes: 0 additions & 32 deletions
32
uui-e2e-tests/scripts/dockerTemplates/docker-compose.yml.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM node:20 | ||
|
||
WORKDIR /app | ||
|
||
COPY package.json ./ | ||
COPY tsconfig.json ./ | ||
|
||
RUN yarn | ||
RUN npx playwright install --with-deps chromium webkit | ||
|
||
CMD [ "yarn", "<placeholder>" ] |