Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
infomiho committed Nov 28, 2024
1 parent d5e2c75 commit 9b91d71
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 7 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@ jobs:
uses: docker/setup-buildx-action@v3

- name: Install Wasp
run: curl -sSL https://get.wasp-lang.dev/installer.sh | sh -s -- -v ${{ env.WASP_VERSION }}
run: |
curl -sSL https://get.wasp-lang.dev/installer.sh | sh -s -- -v ${{ env.WASP_VERSION }}
- name: Cache global node modules
uses: actions/cache@v4
with:
path: ~/.npm
key: node-modules-${{ runner.os }}-${{ hashFiles('template/app/package-lock.json') }}-${{ hashFiles('template/e2e-tests/package-lock.json') }}-wasp${{ env.WASP_VERSION }}-node${{ steps.setup-node.outputs.node-version }}
key: node-modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }}-${{ hashFiles('e2e-tests/package-lock.json') }}-wasp${{ env.WASP_VERSION }}-node${{ steps.setup-node.outputs.node-version }}
restore-keys: |
node-modules-${{ runner.os }}-
Expand All @@ -47,7 +48,6 @@ jobs:
# access them in a step below.
- name: Set required wasp app env vars to mock values
run: |
cd app
cp .env.server.example .env.server && cp .env.client.example .env.client
- name: "[e2e-tests] Install Node.js dependencies for Playwright tests"
Expand Down Expand Up @@ -92,3 +92,13 @@ jobs:
run: |
cd e2e-tests
npm run e2e:playwright
# UNCOMMENT this if you want to upload the test results so you can download them from the GitHub Actions UI
# - name: "[e2e-tests] Upload Playwright test results"
# - uses: actions/upload-artifact@v4
# if: ${{ !cancelled() }}
# with:
# include-hidden-files: true
# name: playwright-report
# path: ./e2e-tests/test-results
# retention-days: 30
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
/.env.server
/.env.client
/node_modules
.DS_Store
2 changes: 1 addition & 1 deletion e2e-tests/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
/test-results/
/.cache/
/node_modules/
prisma/
prisma/
4 changes: 2 additions & 2 deletions e2e-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
},
"scripts": {
"ci:e2e:start": "npm run ci:e2e:cleanup-db && node ci-start-app-and-db.js",
"ci:e2e:start-db": "cd ../app && wasp start db",
"ci:e2e:start-app": "npm run ci:e2e:wait-for-db && cd ../app && wasp db migrate-dev && cd ../e2e-tests && cd ../app && wasp start",
"ci:e2e:start-db": "cd ../ && wasp start db",
"ci:e2e:start-app": "npm run ci:e2e:wait-for-db && cd ../ && wasp db migrate-dev && wasp start",
"ci:e2e:wait-for-db": "npx wait-port 5432",
"_comment-on-ci:e2e:cleanup-db": "NOTE: the name of the DB container, e.g. name=^wasp-dev-db-e2eTestExample-, is generated by wasp and will match the name of the app definition in your `main.wasp` file, e.g. `app e2eTestExample { }`",
"ci:e2e:cleanup-db": "(docker container rm $(docker container ls -f name=^wasp-dev-db-e2eTestExample- -q) -f || true) && docker volume rm $(docker volume ls -f name=^wasp-dev-db-e2eTestExample- -q) -f || true",
Expand Down
4 changes: 3 additions & 1 deletion e2e-tests/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import { defineConfig, devices } from "@playwright/test";
*/
export default defineConfig({
testDir: "./tests",
outputDir: "./test-results",
reporter: process.env.CI
? [["github"], ["html", { outputFolder: "./test-results" }]]
: [["list"]],
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
Expand Down

0 comments on commit 9b91d71

Please sign in to comment.