Skip to content

Commit 909e323

Browse files
committed
Remove playwright-snapshots submodule, instead clone it during test build in earthly
Signed-off-by: George <bulakh.96@gmail.com>
1 parent bdf7266 commit 909e323

6 files changed

Lines changed: 15 additions & 8 deletions

File tree

.arg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# File used by earthly
2+
PLAYWRIGHT_SNAPSHOTS_COMMIT=4cd8430

.github/workflows/ci.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,8 @@ jobs:
9090
run: earthly --version
9191

9292
- name: Run CI
93+
# run: earthly --verbose -P --ci --env-file-path .ci.env +all-tests
9394
run: earthly --verbose -P --ci +all-tests
94-
env:
95-
NEXT_PUBLIC_MUIX_PRO_KEY: ${{ secrets.muix_license }}
9695

9796
- uses: actions/upload-artifact@v3
9897
if: always()

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,5 @@ __pycache__
5858
gh-pages
5959

6060
# Playwright
61-
playwright-artifacts/
61+
playwright-artifacts/
62+
playwright-snapshots/

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
[submodule "web-console/playwright-snapshots"]
2-
path = web-console/playwright-snapshots
3-
url = https://github.com/feldera/playwright-snapshots.git

Earthfile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,15 @@ ui-playwright-container:
611611
COPY web-console .
612612
COPY deploy/docker-compose.yml .
613613
COPY deploy/.env .
614+
615+
# Pull playwright-snapshots for visual regression testing
616+
# It was decided it's better to clone the snapshots repo during the build rather than have it as a submodule
617+
ARG PLAYWRIGHT_SNAPSHOTS_COMMIT
618+
RUN echo PLAYWRIGHT_SNAPSHOTS_COMMIT=$PLAYWRIGHT_SNAPSHOTS_COMMIT
619+
GIT CLONE https://github.com/feldera/playwright-snapshots.git playwright-snapshots
620+
# [ -n "..." ] syntax returns true if the string is not empty, in which case the commands after `&&` execute
621+
RUN [ -n "$PLAYWRIGHT_SNAPSHOTS_COMMIT" ] && cd playwright-snapshots && git checkout $PLAYWRIGHT_SNAPSHOTS_COMMIT
622+
614623
WORKDIR web-console
615624
RUN yarn install
616625
RUN yarn playwright install
@@ -631,7 +640,6 @@ ui-playwright-container:
631640

632641
ui-playwright-tests:
633642
FROM +ui-playwright-container
634-
635643
ENV FELDERA_VERSION=latest
636644

637645
TRY
@@ -640,6 +648,7 @@ ui-playwright-tests:
640648
--compose ../docker-compose.yml \
641649
--service db \
642650
--service pipeline-manager
651+
# We zip artifacts regardless of test success or error, and then we complete the command preserving test's exit_code
643652
RUN if yarn playwright test; then exit_code=0; else exit_code=$?; fi \
644653
&& cd /dbsp \
645654
&& zip -r playwright-report.zip playwright-report \

web-console/playwright-snapshots

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)