Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Playwright tests & CI #69

Merged
merged 112 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
112 commits
Select commit Hold shift + click to select a range
875b08b
get tests started
vincanger Mar 1, 2024
235dd95
Create opensaas-ci.yml
vincanger Mar 4, 2024
93d85e0
move github workflows
vincanger Mar 4, 2024
5cc3400
modify ci scripts
vincanger Mar 4, 2024
ef2303d
install linebyline
vincanger Mar 4, 2024
fe8dc36
Update package.json
vincanger Mar 4, 2024
bec5403
install wait-port
vincanger Mar 4, 2024
8d715e8
Update package.json
vincanger Mar 4, 2024
7f29638
add conditional webserver when in CI env
vincanger Mar 4, 2024
332a03d
test tagging action
vincanger Mar 4, 2024
17a681d
Update retag-commit.yml
vincanger Mar 4, 2024
61bd73c
remove unused workflow
vincanger Mar 4, 2024
73f0c4c
add .env file and test stripe webhook
vincanger Mar 4, 2024
59694d6
Update e2e-tests.yml
vincanger Mar 4, 2024
13d31fe
Update e2e-tests.yml
vincanger Mar 4, 2024
7fa2bb9
Update e2e-tests.yml
vincanger Mar 4, 2024
0fd85ae
Update e2e-tests.yml
vincanger Mar 4, 2024
ce38902
test demo app
vincanger Mar 5, 2024
373b0e9
Update e2e-tests.yml
vincanger Mar 5, 2024
a01da1b
update github action versions
vincanger Mar 5, 2024
c9b4309
disable wasp telemetry
vincanger Mar 6, 2024
0c277e5
Cleanup running (#72)
Zeko369 Mar 7, 2024
bbbbcbd
improve tests
vincanger Mar 7, 2024
c301d1f
Update ci-start-app.js
vincanger Mar 7, 2024
9daf3ee
remove npm scripts
vincanger Mar 8, 2024
c3ce85d
Update e2e-tests.yml
vincanger Mar 8, 2024
a34b2fd
Update ci-start-app-with-scripts.js
vincanger Mar 8, 2024
558cc30
Update ci-start-app-with-scripts.js
vincanger Mar 8, 2024
4aecd93
rename test folder
vincanger Mar 12, 2024
9eed9b5
Update e2e-tests.yml
vincanger Mar 18, 2024
e8115ec
Update e2e-tests.yml
vincanger Mar 18, 2024
5544f2a
export prisma client from server
vincanger Mar 18, 2024
1ca0cf1
Update e2e-tests.yml
vincanger Mar 18, 2024
361dd9c
Update e2e-tests.yml
vincanger Mar 18, 2024
9c1fc69
Update e2e-tests.yml
vincanger Mar 18, 2024
a7df079
Update e2e-tests.yml
vincanger Mar 18, 2024
e63ab54
Update package-lock.json
vincanger Mar 18, 2024
b5a0c77
install linebyline
vincanger Mar 18, 2024
249546e
add npm scripts
vincanger Mar 18, 2024
149b60f
Update package.json
vincanger Mar 18, 2024
afe6332
Update paidUserTests.spec.ts
vincanger Mar 18, 2024
ad1e949
update flaky test
vincanger Mar 18, 2024
bb7e4d9
update tsconfig
vincanger Mar 18, 2024
2a9634b
Update e2e-tests.yml
vincanger Mar 18, 2024
31e0efb
Update e2e-tests.yml
vincanger Mar 18, 2024
a5c11a5
pin node version to github action
vincanger Mar 18, 2024
e624d57
Update e2e-tests.yml
vincanger Mar 18, 2024
3f49cbb
fix retag and clean up
vincanger Mar 18, 2024
bac080d
add notes on tag action
vincanger Mar 18, 2024
4f9555c
Update retag-commit.yml
vincanger Mar 20, 2024
80c7bd7
pr changes part 1
vincanger Mar 22, 2024
7db13e0
pr changes part 2
vincanger Mar 22, 2024
96f47e8
Setup tests with local Prisma (#86)
infomiho Mar 25, 2024
fa64db7
pr changes part 3
vincanger Mar 25, 2024
8ed10d8
add db naming script
vincanger Mar 25, 2024
87f9dce
Update package.json
vincanger Mar 25, 2024
5baf8e6
Update package.json
vincanger Mar 25, 2024
03de857
Update package.json
vincanger Mar 25, 2024
50f8f0c
spawn prisma process
vincanger Mar 25, 2024
a0e8fbe
Update package.json
vincanger Mar 25, 2024
9478c2b
move db setup
vincanger Mar 25, 2024
9ce19af
Update package.json
vincanger Mar 25, 2024
18c4620
Update package.json
vincanger Mar 25, 2024
ef66678
Update package.json
vincanger Mar 25, 2024
15670c1
Update setupDatabaseName.sh
vincanger Mar 25, 2024
316c648
Update package.json
vincanger Mar 25, 2024
4607c20
use same process for local and CI testing
vincanger Apr 3, 2024
285342f
Update package.json
vincanger Apr 3, 2024
faa05a0
Merge branch 'main' into playwright-tests
vincanger Apr 4, 2024
452b354
wait for app for prisma setup
vincanger Apr 4, 2024
4ea6652
Merge branch 'playwright-tests' of https://github.com/wasp-lang/open-…
vincanger Apr 4, 2024
3810b9b
Update package.json
vincanger Apr 4, 2024
62f82c8
changes made with martin
vincanger Apr 5, 2024
bd37741
stripe clie
vincanger Apr 5, 2024
765cbbf
Update e2e-tests.yml
vincanger Apr 5, 2024
91181d2
Update e2e-tests.yml
vincanger Apr 5, 2024
ba6e82b
update start stripe cli
vincanger Apr 5, 2024
70f9831
try again
vincanger Apr 5, 2024
671dabd
start testing stripe payments
vincanger Apr 8, 2024
80cae74
Merge branch 'main' into playwright-tests
vincanger Apr 8, 2024
a106ea9
stripe payment works
vincanger Apr 11, 2024
d68f147
fix base url issue & cleanup
vincanger Apr 12, 2024
eab3e6d
Update playwright.config.ts
vincanger Apr 12, 2024
0786df0
Update package.json
vincanger Apr 12, 2024
1c78b03
Update package-lock.json
vincanger Apr 12, 2024
256147a
Update main.wasp
vincanger Apr 12, 2024
bd9089b
Update utils.ts
vincanger Apr 12, 2024
fa9c809
Update e2e-tests.yml
vincanger Apr 12, 2024
99b17cf
Update utils.ts
vincanger Apr 12, 2024
23a6117
Update utils.ts
vincanger Apr 12, 2024
ff3650d
Update e2e-tests.yml
vincanger Apr 12, 2024
73dfda9
Update actions.ts
vincanger Apr 12, 2024
0631f9c
Update actions.ts
vincanger Apr 12, 2024
ed0b701
Update actions.ts
vincanger Apr 12, 2024
6d82d10
Update actions.ts
vincanger Apr 12, 2024
2654200
Update stripeUtils.ts
vincanger Apr 12, 2024
2d73f2f
Update e2e-tests.yml
vincanger Apr 12, 2024
8c24e13
catch stripe checkout error
vincanger Apr 12, 2024
11bc2c6
remove console.logs
vincanger Apr 12, 2024
392e9fa
fix comments, add err catches
vincanger Apr 12, 2024
be70d70
fix cache and cache keys
vincanger Apr 12, 2024
9c22fa9
Update .github/workflows/e2e-tests.yml
vincanger Apr 17, 2024
f2de9b4
Update .github/workflows/e2e-tests.yml
vincanger Apr 17, 2024
1a3f357
Update .github/workflows/e2e-tests.yml
vincanger Apr 17, 2024
15749c5
Update .github/workflows/e2e-tests.yml
vincanger Apr 17, 2024
5e60999
Update e2e-tests/playwright.config.ts
vincanger Apr 17, 2024
157352d
Improve CI caching and other stuff
vincanger Apr 17, 2024
8f48df7
Merge branch 'playwright-tests' of https://github.com/wasp-lang/open-…
vincanger Apr 17, 2024
f081173
fix cache key, npm scripts, error handling
vincanger Apr 18, 2024
82e3288
Update e2e-tests.yml
vincanger Apr 18, 2024
7a00395
Update README.md
vincanger Apr 19, 2024
dd8e223
add template versioning info
vincanger Apr 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: e2e tests

on:
push:
branches:
- main
- playwright-tests
Martinsos marked this conversation as resolved.
Show resolved Hide resolved
pull_request:
branches:
- main

env:
WASP_TELEMETRY_DISABLE: 1

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v4

- name: Install Wasp
run: curl -sSL https://get.wasp-lang.dev/installer.sh | sh -s
vincanger marked this conversation as resolved.
Show resolved Hide resolved

- name: Docker setup
uses: docker/setup-buildx-action@v3

Martinsos marked this conversation as resolved.
Show resolved Hide resolved
- name: Cache Node Modules
uses: actions/cache@v4
with:
path: ~/.npm
key: node-modules-${{ hashFiles('app/package-lock.json') }}
Martinsos marked this conversation as resolved.
Show resolved Hide resolved

- name: Install Node.js dependencies
Martinsos marked this conversation as resolved.
Show resolved Hide resolved
run: |
cd app
npm ci

- name: Setup Env Vars not in github secrets
vincanger marked this conversation as resolved.
Show resolved Hide resolved
run: |
cd app
cp .env.server.example .env.server

- name: Set up Playwright
run: |
cd app
npx playwright install --with-deps

- name: Run Playwright tests
env:
Martinsos marked this conversation as resolved.
Show resolved Hide resolved
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: |
cd app
DEBUG=pw:webserver npx playwright test
28 changes: 28 additions & 0 deletions .github/workflows/retag-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Retag Commit
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So what is our reasoning behind this Action -> it keeps assigning this tag to the last commit on main, right?

I guess that makes sense! It means people doing wasp new and just copying this template are getting the same version.

WHat happens when we want to update to new Wasp version -> we update the version here in this action, and push it to main together with the rest of the changes that update open-saas to this new version, right? Ok yeah, sounds good!

Let's add to README something about this, that explains that this is happening and what we have to do to get open-saas to use new Wasp version.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this change makes more sense a separate PR? 🤷 But a cool change!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will make separate PRs for stuff like this nexttime :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vincanger you never added anything about this to some top level README, right?
I would certainly do it, as it can be quite surprising that anything that goes to main is basically instantly published, that should be explicitly stated.


on:
push:
branches:
- main

jobs:
retag:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Configure Git
run: |
git config user.email "github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"

- name: Delete Old Tag
run: |
git tag -d wasp-v0.12-template || true
git push origin :refs/tags/wasp-v0.12-template || true

- name: Add New Tag
run: |
git tag wasp-v0.12-template
git push origin wasp-v0.12-template
Martinsos marked this conversation as resolved.
Show resolved Hide resolved
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@
*/.DS_Store
*/node_modules
*/migrations
*/playwright/reports/
Martinsos marked this conversation as resolved.
Show resolved Hide resolved
*/playwright/test-results/
*/playwright/.cache/
.DS_Store
31 changes: 31 additions & 0 deletions app/ci-start-app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
const cp = require('child_process');
Martinsos marked this conversation as resolved.
Show resolved Hide resolved
const readline = require('linebyline');

function spawn(name, cmd, args, done) {
const spawnOptions = {
detached: true,
};
const proc = cp.spawn(cmd, args, spawnOptions);

// We close stdin stream on the new process because otherwise the start-app
// process hangs.
// See https://github.com/wasp-lang/wasp/pull/1218#issuecomment-1599098272.
proc.stdin.destroy();

readline(proc.stdout).on('line', (data) => {
console.log(`\x1b[0m\x1b[33m[${name}][out]\x1b[0m ${data}`);
});
readline(proc.stderr).on('line', (data) => {
console.log(`\x1b[0m\x1b[33m[${name}][err]\x1b[0m ${data}`);
});
proc.on('exit', done);
}

// Exit if either child fails
const cb = (code) => {
if (code !== 0) {
process.exit(code);
}
};
spawn('app', 'npm', ['run', 'example-app:start-app'], cb);
spawn('db', 'npm', ['run', 'example-app:start-db'], cb);
2 changes: 1 addition & 1 deletion app/main.wasp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
app OpenSaaS {
wasp: {
version: "^0.12.0"
version: "^0.12.2"
vincanger marked this conversation as resolved.
Show resolved Hide resolved
},
title: "My Open SaaS App",
head: [
Expand Down
Loading