-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: Add Dockerfile for easily updating snapshots (#1071)
- Updated README to include new instructions on how to update snapshots - Add snapshots for mac that weren't previously included - Tested on M1 MacBook Pro - Fixes #960
- Loading branch information
Showing
32 changed files
with
165 additions
and
69 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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Just copy the .gitignore file for files we don't want to copy to the docker image | ||
|
||
# dependencies | ||
/node_modules | ||
|
||
# testing | ||
/coverage | ||
|
||
# production | ||
/build | ||
/dist | ||
|
||
# misc | ||
.vscode/* | ||
!.vscode/settings.json | ||
!.vscode/tasks.json | ||
!.vscode/launch.json | ||
!.vscode/extensions.json | ||
!.vscode/*.code-snippets | ||
.DS_Store | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
.project | ||
.settings/ | ||
.eslintcache | ||
.stylelintcache | ||
lerna-debug.log | ||
Lerna-Profile-*.json | ||
|
||
/public/vs | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
src/**/*.css | ||
|
||
tsconfig.tsbuildinfo | ||
packages/*/package-lock.json | ||
/test-results/ | ||
/playwright-report/ | ||
/playwright/.cache/ | ||
|
||
# Ignore Dockerfile as well, since we don't need to copy that into the snapshot container | ||
Dockerfile | ||
|
||
# Tests are copied to the docker container, as it modifies them | ||
/tests |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import DefaultConfig from './playwright.config'; | ||
|
||
const config: PlaywrightTestConfig = { | ||
...DefaultConfig, | ||
snapshotDir: '/tests', | ||
}; | ||
|
||
export default config; |
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,6 @@ | ||
// Script will skip the postinstall script if `SKIP_POSTINSTALL` env variable is set | ||
if (process.env.SKIP_POSTINSTALL) { | ||
process.exit(0); | ||
} else { | ||
process.exit(1); | ||
} |
Binary file modified
BIN
+6.36 KB
(110%)
tests/figure.spec.ts-snapshots/can-open-a-simple-figure-1-chromium-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+18.7 KB
(130%)
tests/figure.spec.ts-snapshots/can-open-a-simple-figure-1-firefox-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+9.08 KB
(120%)
tests/figure.spec.ts-snapshots/can-open-a-simple-figure-1-webkit-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+63.5 KB
tests/figure.spec.ts-snapshots/can-set-point-shape-and-size-1-chromium-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+72.7 KB
tests/figure.spec.ts-snapshots/can-set-point-shape-and-size-1-firefox-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+70.2 KB
tests/figure.spec.ts-snapshots/can-set-point-shape-and-size-1-webkit-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+7.43 KB
(120%)
tests/table.spec.ts-snapshots/can-open-a-simple-table-1-chromium-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+9.45 KB
(120%)
tests/table.spec.ts-snapshots/can-open-a-simple-table-1-firefox-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+12.7 KB
(120%)
tests/table.spec.ts-snapshots/can-open-a-simple-table-1-webkit-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+34.8 KB
...c.ts-snapshots/can-open-a-table-with-column-header-groups-1-chromium-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+43.7 KB
...ec.ts-snapshots/can-open-a-table-with-column-header-groups-1-firefox-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+58.5 KB
...pec.ts-snapshots/can-open-a-table-with-column-header-groups-1-webkit-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+8.14 KB
(130%)
...spec.ts-snapshots/tests-table-operations-advanced-filters-1-chromium-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+9.38 KB
(130%)
....spec.ts-snapshots/tests-table-operations-advanced-filters-1-firefox-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+13.1 KB
(130%)
...e.spec.ts-snapshots/tests-table-operations-advanced-filters-1-webkit-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+0 Bytes
(100%)
...le.spec.ts-snapshots/tests-table-operations-advanced-filters-1-webkit-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+6.02 KB
(120%)
tests/table.spec.ts-snapshots/tests-table-operations-go-to-1-chromium-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+7.38 KB
(120%)
tests/table.spec.ts-snapshots/tests-table-operations-go-to-1-firefox-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+60 Bytes
(100%)
tests/table.spec.ts-snapshots/tests-table-operations-go-to-1-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+8.28 KB
(120%)
tests/table.spec.ts-snapshots/tests-table-operations-go-to-1-webkit-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-28 Bytes
(100%)
tests/table.spec.ts-snapshots/tests-table-operations-go-to-1-webkit-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+8.15 KB
(130%)
...k-filters-with-the-advanced-filters-in-above-test-applied-1-chromium-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+9.02 KB
(120%)
...ck-filters-with-the-advanced-filters-in-above-test-applied-1-firefox-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+12.7 KB
(130%)
...ick-filters-with-the-advanced-filters-in-above-test-applied-1-webkit-darwin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-11 Bytes
(100%)
...uick-filters-with-the-advanced-filters-in-above-test-applied-1-webkit-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,70 @@ | ||
# syntax=docker/dockerfile:1 | ||
# Dockerfile for updating the snapshots. | ||
# Expects to be run with `web-client-ui` root dir mounted in the `/work/` directory, and with the `--network host` flag | ||
FROM mcr.microsoft.com/playwright:v1.30.0-focal | ||
WORKDIR /work/ | ||
|
||
# Update packages list and install some build tools | ||
RUN set -eux; \ | ||
apt-get update; \ | ||
apt-get install build-essential --yes; | ||
|
||
# Copy just the .nvmrc first and install nvm/node/npm first as these will change the least often | ||
# https://docs.docker.com/build/cache/ | ||
COPY .nvmrc . | ||
|
||
# Set the default shell so the correct node/npm is used after install | ||
# https://stackoverflow.com/a/60137919 | ||
SHELL ["/bin/bash", "--login", "-i", "-c"] | ||
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash | ||
RUN source /root/.bashrc && nvm install | ||
SHELL ["/bin/bash", "--login", "-c"] | ||
|
||
# Next copy just the package.json and package-lock.json files over so we can install dependencies and cache at this layer | ||
# Doesn't seem to be an easy way to copy it with a glob and retain the directory structure. | ||
# Will need to add new packages here when they are created. | ||
# https://stackoverflow.com/questions/49939960/docker-copy-files-using-glob-pattern#comment106088784_49940132 | ||
COPY package.json package-lock.json skip.js . | ||
COPY packages/babel-preset/package.json packages/babel-preset/ | ||
COPY packages/chart/package.json packages/chart/ | ||
COPY packages/embed-chart/package.json packages/embed-chart/ | ||
COPY packages/embed-grid/package.json packages/embed-grid/ | ||
COPY packages/filters/package.json packages/filters/ | ||
COPY packages/golden-layout/package.json packages/golden-layout/ | ||
COPY packages/mocks/package.json packages/mocks/ | ||
COPY packages/prettier-config/package.json packages/prettier-config/ | ||
COPY packages/react-hooks/package.json packages/react-hooks/ | ||
COPY packages/tsconfig/package.json packages/tsconfig/ | ||
COPY packages/utils/package.json packages/utils/ | ||
COPY packages/storage/package.json packages/storage/ | ||
COPY packages/dashboard/package.json packages/dashboard/ | ||
COPY packages/stylelint-config/package.json packages/stylelint-config/ | ||
COPY packages/components/package.json packages/components/ | ||
COPY packages/dashboard-core-plugins/package.json packages/dashboard-core-plugins/ | ||
COPY packages/eslint-config/package.json packages/eslint-config/ | ||
COPY packages/jsapi-shim/package.json packages/jsapi-shim/ | ||
COPY packages/iris-grid/package.json packages/iris-grid/ | ||
COPY packages/icons/package.json packages/icons/ | ||
COPY packages/log/package.json packages/log/ | ||
COPY packages/pouch-storage/package.json packages/pouch-storage/ | ||
COPY packages/file-explorer/package.json packages/file-explorer/ | ||
COPY packages/redux/package.json packages/redux/ | ||
COPY packages/jsapi-components/package.json packages/jsapi-components/ | ||
COPY packages/code-studio/package.json packages/code-studio/ | ||
COPY packages/jsapi-utils/package.json packages/jsapi-utils/ | ||
COPY packages/console/package.json packages/console/ | ||
COPY packages/grid/package.json packages/grid/ | ||
|
||
# Disable the postinstall script, or npm ci will try and build and the files won't be there | ||
# We don't need the postinstall since we're going to rebuild right after | ||
# RUN npm pkg set scripts.postinstall="echo no-postinstall" | ||
RUN SKIP_POSTINSTALL=1 npm ci | ||
|
||
# Copy the web-client-ui src folder to the docker image | ||
# We do this last because the source files are the most likely to change | ||
# This requires the Dockerfile to be built in the context of the root of the web-client-ui repository | ||
# https://stackoverflow.com/a/34300129 | ||
COPY . . | ||
|
||
# Now build the app. We only need the code-studio built for e2e tests. | ||
RUN VITE_CORE_API_URL=http://host.docker.internal:10000/jsapi npm run build:app |