From 8527e60e018b071b8d7fc27ab6ebff9952aa932d Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Wed, 19 Jul 2023 09:52:51 -0700 Subject: [PATCH 1/8] Move playwright stuff into its own directory --- package-lock.json => playwright-tests/package-lock.json | 0 package.json => playwright-tests/package.json | 0 playwright.config.js => playwright-tests/playwright.config.js | 2 +- 3 files changed, 1 insertion(+), 1 deletion(-) rename package-lock.json => playwright-tests/package-lock.json (100%) rename package.json => playwright-tests/package.json (100%) rename playwright.config.js => playwright-tests/playwright.config.js (98%) diff --git a/package-lock.json b/playwright-tests/package-lock.json similarity index 100% rename from package-lock.json rename to playwright-tests/package-lock.json diff --git a/package.json b/playwright-tests/package.json similarity index 100% rename from package.json rename to playwright-tests/package.json diff --git a/playwright.config.js b/playwright-tests/playwright.config.js similarity index 98% rename from playwright.config.js rename to playwright-tests/playwright.config.js index d7f019bbd..026a574ad 100644 --- a/playwright.config.js +++ b/playwright-tests/playwright.config.js @@ -12,7 +12,7 @@ const path = require("path"); * @see https://playwright.dev/docs/test-configuration */ module.exports = defineConfig({ - testDir: "./playwright-tests", + testDir: ".", /* Run tests in files in parallel */ fullyParallel: true, /* Fail the build on CI if you accidentally left test.only in the source code. */ From b9794aaad4bcd6898ee93c5bc8a6b529f7efa52d Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Wed, 19 Jul 2023 09:54:54 -0700 Subject: [PATCH 2/8] Only run miri for changed files --- .github/workflows/miri.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/miri.yml b/.github/workflows/miri.yml index 73b38dec9..0146e98bc 100644 --- a/.github/workflows/miri.yml +++ b/.github/workflows/miri.yml @@ -6,6 +6,13 @@ on: branches: - 'auto' - 'try' + paths: + - packages/** + - examples/** + - src/** + - .github/** + - lib.rs + - Cargo.toml pull_request: types: [opened, synchronize, reopened, ready_for_review] branches: From 5eac6cd1c5d76de3c72bbd1da1543d1ef3c2ebd0 Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Wed, 19 Jul 2023 09:57:00 -0700 Subject: [PATCH 3/8] Add working dir --- .github/workflows/playwright.yml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 84891f403..77dda0c11 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -9,17 +9,12 @@ jobs: if: github.event.pull_request.draft == false timeout-minutes: 60 runs-on: ubuntu-20.04 + working-directory: playwright-tests steps: - - uses: actions/checkout@v3 + # Do our best to cache the toolchain and node install steps - uses: actions/setup-node@v3 with: node-version: 16 - - name: Install dependencies - run: npm ci - - name: Install Playwright - run: npm install -D @playwright/test - - name: Install Playwright Browsers - run: npx playwright install --with-deps - name: Install Rust uses: actions-rs/toolchain@v1 with: @@ -29,11 +24,18 @@ jobs: - uses: Swatinem/rust-cache@v2 - name: Install WASM toolchain run: rustup target add wasm32-unknown-unknown + - uses: actions/checkout@v3 + - name: Install dependencies + run: npm ci + - name: Install Playwright + run: npm install -D @playwright/test + - name: Install Playwright Browsers + run: npx playwright install --with-deps - name: Install Dioxus CLI uses: actions-rs/cargo@v1 with: command: install - args: --path packages/cli + args: --path ../packages/cli - name: Run Playwright tests run: npx playwright test - uses: actions/upload-artifact@v3 From f51b0099dd6b723f9546d7eb5890283fc31b75fe Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Wed, 19 Jul 2023 09:59:05 -0700 Subject: [PATCH 4/8] CD as a step --- .github/workflows/playwright.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 77dda0c11..cdd7fb996 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -9,7 +9,6 @@ jobs: if: github.event.pull_request.draft == false timeout-minutes: 60 runs-on: ubuntu-20.04 - working-directory: playwright-tests steps: # Do our best to cache the toolchain and node install steps - uses: actions/setup-node@v3 @@ -25,6 +24,8 @@ jobs: - name: Install WASM toolchain run: rustup target add wasm32-unknown-unknown - uses: actions/checkout@v3 + - name: Enter playwright-tests + run: cd playwright-tests - name: Install dependencies run: npm ci - name: Install Playwright From da21e5f4c1269e2893c955e44616bebc85e34d77 Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Wed, 19 Jul 2023 10:03:28 -0700 Subject: [PATCH 5/8] Move order around, set default working directory --- .github/workflows/playwright.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index cdd7fb996..974649419 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -4,6 +4,9 @@ on: branches: [ main, master ] pull_request: branches: [ main, master ] +defaults: + run: + working-directory: ./playwright-tests jobs: test: if: github.event.pull_request.draft == false @@ -11,6 +14,7 @@ jobs: runs-on: ubuntu-20.04 steps: # Do our best to cache the toolchain and node install steps + - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: node-version: 16 @@ -23,9 +27,6 @@ jobs: - uses: Swatinem/rust-cache@v2 - name: Install WASM toolchain run: rustup target add wasm32-unknown-unknown - - uses: actions/checkout@v3 - - name: Enter playwright-tests - run: cd playwright-tests - name: Install dependencies run: npm ci - name: Install Playwright From 22ea04e45da8d2354c93305d3d82c86c870b48b3 Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Wed, 19 Jul 2023 10:08:50 -0700 Subject: [PATCH 6/8] Use different path for cli --- .github/workflows/playwright.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 974649419..bddc767e6 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -37,7 +37,7 @@ jobs: uses: actions-rs/cargo@v1 with: command: install - args: --path ../packages/cli + args: --path packages/cli - name: Run Playwright tests run: npx playwright test - uses: actions/upload-artifact@v3 From 0ceaaa6c964b1c75f2beec47bad321acba4556f1 Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Wed, 19 Jul 2023 10:11:11 -0700 Subject: [PATCH 7/8] Don't install the CLI --- .github/workflows/playwright.yml | 11 ++++++----- playwright-tests/playwright.config.js | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index bddc767e6..7fe524bb3 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -33,11 +33,12 @@ jobs: run: npm install -D @playwright/test - name: Install Playwright Browsers run: npx playwright install --with-deps - - name: Install Dioxus CLI - uses: actions-rs/cargo@v1 - with: - command: install - args: --path packages/cli + # Cache the CLI by using cargo run internally + # - name: Install Dioxus CLI + # uses: actions-rs/cargo@v1 + # with: + # command: install + # args: --path packages/cli - name: Run Playwright tests run: npx playwright test - uses: actions/upload-artifact@v3 diff --git a/playwright-tests/playwright.config.js b/playwright-tests/playwright.config.js index 026a574ad..5ab81f161 100644 --- a/playwright-tests/playwright.config.js +++ b/playwright-tests/playwright.config.js @@ -82,7 +82,7 @@ module.exports = defineConfig({ }, { cwd: path.join(process.cwd(), "playwright-tests", "web"), - command: "dx serve", + command: "cargo run --package dioxus-cli -- serve", port: 8080, timeout: 10 * 60 * 1000, reuseExistingServer: !process.env.CI, @@ -90,7 +90,7 @@ module.exports = defineConfig({ }, { cwd: path.join(process.cwd(), 'playwrite-tests', 'fullstack'), - command: 'dx build --features web --release\ncargo run --release --features ssr', + command: 'cargo run --package dioxus-cli -- build --features web --release\ncargo run --release --features ssr', port: 3333, timeout: 10 * 60 * 1000, reuseExistingServer: !process.env.CI, From eb43429ff6c839929ce2d77c648b928761acc845 Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Wed, 19 Jul 2023 10:16:27 -0700 Subject: [PATCH 8/8] Bump versions, move paths --- playwright-tests/package-lock.json | 20 +++--- playwright-tests/package.json | 2 +- playwright-tests/playwright-report/index.html | 62 +++++++++++++++++++ playwright-tests/playwright.config.js | 4 +- 4 files changed, 75 insertions(+), 13 deletions(-) create mode 100644 playwright-tests/playwright-report/index.html diff --git a/playwright-tests/package-lock.json b/playwright-tests/package-lock.json index 348b505d4..4f1b932ac 100644 --- a/playwright-tests/package-lock.json +++ b/playwright-tests/package-lock.json @@ -9,23 +9,23 @@ "version": "1.0.0", "license": "ISC", "devDependencies": { - "@playwright/test": "^1.34.3" + "@playwright/test": "^1.36.1" } }, "node_modules/@playwright/test": { - "version": "1.34.3", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.34.3.tgz", - "integrity": "sha512-zPLef6w9P6T/iT6XDYG3mvGOqOyb6eHaV9XtkunYs0+OzxBtrPAAaHotc0X+PJ00WPPnLfFBTl7mf45Mn8DBmw==", + "version": "1.36.1", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.36.1.tgz", + "integrity": "sha512-YK7yGWK0N3C2QInPU6iaf/L3N95dlGdbsezLya4n0ZCh3IL7VgPGxC6Gnznh9ApWdOmkJeleT2kMTcWPRZvzqg==", "dev": true, "dependencies": { "@types/node": "*", - "playwright-core": "1.34.3" + "playwright-core": "1.36.1" }, "bin": { "playwright": "cli.js" }, "engines": { - "node": ">=14" + "node": ">=16" }, "optionalDependencies": { "fsevents": "2.3.2" @@ -52,15 +52,15 @@ } }, "node_modules/playwright-core": { - "version": "1.34.3", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.34.3.tgz", - "integrity": "sha512-2pWd6G7OHKemc5x1r1rp8aQcpvDh7goMBZlJv6Co5vCNLVcQJdhxRL09SGaY6HcyHH9aT4tiynZabMofVasBYw==", + "version": "1.36.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.36.1.tgz", + "integrity": "sha512-7+tmPuMcEW4xeCL9cp9KxmYpQYHKkyjwoXRnoeTowaeNat8PoBMk/HwCYhqkH2fRkshfKEOiVus/IhID2Pg8kg==", "dev": true, "bin": { "playwright-core": "cli.js" }, "engines": { - "node": ">=14" + "node": ">=16" } } } diff --git a/playwright-tests/package.json b/playwright-tests/package.json index ceb38db89..31d444420 100644 --- a/playwright-tests/package.json +++ b/playwright-tests/package.json @@ -12,6 +12,6 @@ "author": "", "license": "ISC", "devDependencies": { - "@playwright/test": "^1.34.3" + "@playwright/test": "^1.36.1" } } diff --git a/playwright-tests/playwright-report/index.html b/playwright-tests/playwright-report/index.html new file mode 100644 index 000000000..71730368d --- /dev/null +++ b/playwright-tests/playwright-report/index.html @@ -0,0 +1,62 @@ + + + + + + + + + Playwright Test Report + + + + +
+ + + + \ No newline at end of file diff --git a/playwright-tests/playwright.config.js b/playwright-tests/playwright.config.js index 5ab81f161..54fe810a7 100644 --- a/playwright-tests/playwright.config.js +++ b/playwright-tests/playwright.config.js @@ -81,7 +81,7 @@ module.exports = defineConfig({ stdout: "pipe", }, { - cwd: path.join(process.cwd(), "playwright-tests", "web"), + cwd: path.join(process.cwd(), "web"), command: "cargo run --package dioxus-cli -- serve", port: 8080, timeout: 10 * 60 * 1000, @@ -89,7 +89,7 @@ module.exports = defineConfig({ stdout: "pipe", }, { - cwd: path.join(process.cwd(), 'playwrite-tests', 'fullstack'), + cwd: path.join(process.cwd(), 'fullstack'), command: 'cargo run --package dioxus-cli -- build --features web --release\ncargo run --release --features ssr', port: 3333, timeout: 10 * 60 * 1000,