Skip to content

Commit 3568a0d

Browse files
committed
Move snapshots into a submodule, add saving a testing result artifact
Signed-off-by: George <bulakh.96@gmail.com>
1 parent 9fe16b6 commit 3568a0d

File tree

41 files changed

+87
-81
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+87
-81
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,12 @@ jobs:
9393
run: earthly --verbose -P --ci +all-tests
9494
env:
9595
NEXT_PUBLIC_MUIX_PRO_KEY: ${{ secrets.muix_license }}
96+
97+
- uses: actions/upload-artifact@v3
98+
if: always()
99+
with:
100+
name: playwright-artifacts
101+
path: playwright-artifacts/
102+
retention-days: 10
103+
- name: Remove test artifacts from the CI machine
104+
run: rm -f playwright-artifacts/*

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,6 @@ __pycache__
5656

5757
# clone of the benchmark repo
5858
gh-pages
59+
60+
# Playwright
61+
playwright-artifacts/

.gitmodules

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

Earthfile

Lines changed: 35 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION 0.7
1+
VERSION --try 0.7
22
FROM ubuntu:22.04
33

44
RUN apt-get update && apt-get install --yes sudo
@@ -99,6 +99,7 @@ build-webui:
9999
COPY web-console/next.config.js ./web-console/next.config.js
100100
COPY web-console/next.d.ts ./web-console/next.d.ts
101101
COPY web-console/tsconfig.json ./web-console/tsconfig.json
102+
COPY web-console/.env ./web-console/.env
102103

103104
RUN cd web-console && yarn format:check
104105
RUN cd web-console && yarn build
@@ -542,13 +543,13 @@ test-docker-compose-stable:
542543
--load ghcr.io/feldera/pipeline-manager:latest=+build-pipeline-manager-container \
543544
--pull ghcr.io/feldera/demo-container:0.6.0
544545
RUN COMPOSE_HTTP_TIMEOUT=120 SECOPS_DEMO_ARGS="--prepare-args 200000" RUST_LOG=debug,tokio_postgres=info docker-compose -f docker-compose.yml --profile demo up --force-recreate --exit-code-from demo && \
545-
# This should run the latest version of the code and in the process, trigger a migration.
546+
# This should run the latest version of the code and in the process, trigger a migration.
546547
COMPOSE_HTTP_TIMEOUT=120 SECOPS_DEMO_ARGS="--prepare-args 200000" FELDERA_VERSION=latest RUST_LOG=debug,tokio_postgres=info docker-compose -f docker-compose.yml up -d db pipeline-manager redpanda && \
547548
sleep 10 && \
548549
# Exercise a few simple workflows in the API
549550
curl http://localhost:8080/v0/programs && \
550551
curl http://localhost:8080/v0/pipelines && \
551-
curl http://localhost:8080/v0/connectors
552+
curl http://localhost:8080/v0/connectors
552553
END
553554

554555
test-debezium:
@@ -608,29 +609,46 @@ integration-tests:
608609
ui-playwright-container:
609610
FROM +install-deps
610611
COPY web-console .
612+
COPY deploy/docker-compose.yml .
613+
COPY deploy/.env .
611614
WORKDIR web-console
612615
RUN yarn install
613616
RUN yarn playwright install
614617
RUN yarn playwright install-deps
615618
ENV CI=true
616-
ENV PLAYWRIGHT_API_ORIGIN=http://pipeline-manager:8080
617-
ENV PLAYWRIGHT_APP_ORIGIN=http://pipeline-manager:8080
619+
ENV PLAYWRIGHT_API_ORIGIN=http://localhost:8080/
620+
ENV PLAYWRIGHT_APP_ORIGIN=http://localhost:8080/
618621
ENV DISPLAY=
619-
ENTRYPOINT ["yarn", "playwright", "test"]
620-
SAVE IMAGE uitest:latest
622+
623+
# Install docker compose - earthly can do this automatically, but it installs an older version
624+
ENV DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
625+
RUN mkdir -p $DOCKER_CONFIG/cli-plugins
626+
RUN curl -SL https://github.com/docker/compose/releases/download/v2.24.0-birthday.10/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose
627+
RUN chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose
628+
629+
# Install zip to prepare test artifacts for export
630+
RUN apt-get install -y zip
621631

622632
ui-playwright-tests:
623-
FROM earthly/dind:alpine
624-
COPY deploy/docker-compose.yml .
625-
COPY deploy/.env .
633+
FROM +ui-playwright-container
634+
626635
ENV FELDERA_VERSION=latest
627-
WITH DOCKER --pull postgres \
628-
--load ghcr.io/feldera/pipeline-manager:latest=+build-pipeline-manager-container \
629-
--compose docker-compose.yml \
630-
--service db \
631-
--service pipeline-manager \
632-
--load uitest:latest=+ui-playwright-container
633-
RUN sleep 5 && docker run --env-file .env --network default_default uitest:latest
636+
637+
TRY
638+
WITH DOCKER --pull postgres \
639+
--load ghcr.io/feldera/pipeline-manager:latest=+build-pipeline-manager-container \
640+
--compose ../docker-compose.yml \
641+
--service db \
642+
--service pipeline-manager
643+
RUN if yarn playwright test; then exit_code=0; else exit_code=$?; fi \
644+
&& cd /dbsp \
645+
&& zip -r playwright-report.zip playwright-report \
646+
&& zip -r test-results.zip test-results \
647+
&& exit $exit_code
648+
END
649+
FINALLY
650+
SAVE ARTIFACT --if-exists playwright-report.zip AS LOCAL ./playwright-artifacts/
651+
SAVE ARTIFACT --if-exists test-results.zip AS LOCAL ./playwright-artifacts/
634652
END
635653

636654
benchmark:

web-console/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
"format:check": "prettier --check \"src/**/*.{js,jsx,ts,tsx}\"",
2525
"generate-openapi": "cargo run --bin pipeline-manager -- --dump-openapi && openapi --input ./openapi.json --output ./src/lib/services/manager && rm ./openapi.json",
2626
"test": "PLAYWRIGHT_API_ORIGIN=http://localhost:8080/ PLAYWRIGHT_APP_ORIGIN=http://localhost:8080/ DISPLAY= yarn playwright test",
27-
"test:ui": "PLAYWRIGHT_API_ORIGIN=http://localhost:8080/ PLAYWRIGHT_APP_ORIGIN=http://localhost:8080/ DISPLAY= yarn playwright test --ui-port=0"
27+
"test:ui": "PLAYWRIGHT_API_ORIGIN=http://localhost:8080/ PLAYWRIGHT_APP_ORIGIN=http://localhost:8080/ DISPLAY= yarn playwright test --ui-port=0",
28+
"test:report": "yarn playwright show-report"
2829
},
2930
"//": [
3031
"See `yarn playwright --help` for Playwright commands",

web-console/playwright-snapshots

Submodule playwright-snapshots added at 4cd8430

web-console/playwright.config.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@ export default defineConfig({
1919
/* Fail the build on CI if you accidentally left test.only in the source code. */
2020
forbidOnly: !!process.env.CI,
2121
/* Retry on CI only */
22-
retries: process.env.CI ? 2 : 0,
22+
retries: process.env.CI ? 0 : 0,
2323
/* Opt out of parallel tests on CI. */
2424
workers: process.env.CI ? 1 : 1 /* undefined */,
2525
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
2626
reporter: 'html',
27+
snapshotDir: 'playwright-snapshots',
2728
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
2829
use: {
2930
/* Base URL to use in actions like `await page.goto('/')`. */
@@ -52,11 +53,11 @@ export default defineConfig({
5253
// dependencies: ['setup'],
5354
// },
5455

55-
{
56-
name: 'webkit',
57-
use: { ...devices['Desktop Safari'] },
58-
dependencies: ['setup'],
59-
},
56+
// {
57+
// name: 'webkit',
58+
// use: { ...devices['Desktop Safari'] },
59+
// dependencies: ['setup'],
60+
// },
6061

6162
/* Test against mobile viewports. */
6263
// {

web-console/tests/e2e/demoAccrual.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const programName = 'Accrual demo'
1010
const pipelineName = 'Accrual demo'
1111

1212
test('Accrual demo test', async ({ page, request }) => {
13-
test.setTimeout(150000)
13+
test.setTimeout(240000)
1414
await page.goto(appOrigin)
1515

1616
await test.step('Create a program', async () => {
@@ -22,7 +22,7 @@ test('Accrual demo test', async ({ page, request }) => {
2222
await page.getByTestId('box-program-code-wrapper').getByRole('textbox').blur()
2323
await page.getByTestId('box-save-saved').waitFor()
2424
await page.getByTestId('box-compile-status-success').waitFor()
25-
await expect(page).toHaveScreenshot('saved sql program.png')
25+
await expect(page).toHaveScreenshot('saved-sql-program.png')
2626
})
2727

2828
const pipelineUUID = await test.step('Create a pipeline', async () => {
@@ -45,8 +45,8 @@ test('Accrual demo test', async ({ page, request }) => {
4545
await test.step('Start the pipeline', async () => {
4646
await page.getByTestId('button-breadcrumb-pipelines').click()
4747
await page.getByTestId(`box-pipeline-actions-${pipelineName}`).waitFor()
48-
await expect(page).toHaveScreenshot('compiling program binary.png')
49-
await page.getByTestId(`box-pipeline-${pipelineName}-status-Inactive`).waitFor({ timeout: 90000 })
48+
await expect(page).toHaveScreenshot('compiling-program-binary.png')
49+
await page.getByTestId(`box-pipeline-${pipelineName}-status-Inactive`).waitFor({ timeout: 180000 })
5050
await page.getByTestId(`box-pipeline-actions-${pipelineName}`).getByTestId('button-start').click()
5151
await page.getByTestId(`box-pipeline-${pipelineName}-status-Running`).waitFor({ timeout: 10000 })
5252
})
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)