Skip to content

Commit

Permalink
ci: update playwright CI config with bun
Browse files Browse the repository at this point in the history
  • Loading branch information
sjdonado committed Apr 4, 2024
1 parent 207cda4 commit 13b6353
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 26 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- uses: oven-sh/setup-bun@v1
- name: Install dependencies
run: npm install
run: bun install
- name: Install Playwright Browsers
run: bunx playwright install --with-deps
- name: Run Playwright tests
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ node_modules
/public/build
.env

/sqlite/db.sqlite*
/sqlite/*
todo.md

/test-results/
Expand Down
Binary file modified bun.lockb
Binary file not shown.
39 changes: 20 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "remix-dashboard",
"version": "1.0.0",
"version": "1.0.1",
"sideEffects": false,
"type": "module",
"scripts": {
Expand All @@ -19,45 +19,46 @@
"db:studio": "drizzle-kit studio --port 3000 --verbose"
},
"dependencies": {
"@heroicons/react": "^2.0.18",
"@heroicons/react": "^2.1.3",
"@remix-run/node": "^2.8.1",
"@remix-run/react": "^2.8.1",
"@remix-run/serve": "^2.8.1",
"@remix-validated-form/with-zod": "^2.0.7",
"better-sqlite3": "^9.4.3",
"better-sqlite3": "^9.4.5",
"clsx": "^2.1.0",
"daisyui": "4.9.0",
"drizzle-orm": "^0.30.7",
"isbot": "^5.1.4",
"pino": "^8.16.2",
"pino": "^8.19.0",
"pino-pretty": "^11.0.0",
"playwright": "^1.40.1",
"playwright": "^1.42.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"remix-toast": "^1.1.0",
"remix-utils": "^7.1.0",
"remix-toast": "^1.2.0",
"remix-utils": "^7.5.0",
"remix-validated-form": "^5.1.5",
"sonner": "^1.4.0",
"sonner": "^1.4.41",
"use-debounce": "^10.0.0",
"zod": "^3.22.4"
},
"devDependencies": {
"@faker-js/faker": "^8.3.1",
"@playwright/test": "^1.40.1",
"@faker-js/faker": "^8.4.1",
"@playwright/test": "^1.42.1",
"@remix-run/dev": "^2.8.1",
"@remix-run/eslint-config": "^2.8.1",
"@types/better-sqlite3": "^7.6.9",
"@types/node": "^20.10.2",
"@types/react": "^18.2.20",
"@types/react-dom": "^18.2.7",
"@types/node": "^20.12.4",
"@types/react": "^18.2.74",
"@types/react-dom": "^18.2.24",
"autoprefixer": "^10.4.19",
"drizzle-kit": "^0.20.1",
"eslint": "^8.38.0",
"dotenv": "^16.4.5",
"drizzle-kit": "^0.20.14",
"eslint": "^8.57.0",
"eslint-plugin-tailwindcss": "^3.15.1",
"tailwindcss": "^3.4.1",
"tsx": "^4.7.1",
"typescript": "^5.1.6",
"vite": "^5.2.7",
"tailwindcss": "^3.4.3",
"tsx": "^4.7.2",
"typescript": "^5.4.3",
"vite": "^5.2.8",
"vite-tsconfig-paths": "^4.3.2"
},
"engines": {
Expand Down
6 changes: 5 additions & 1 deletion playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import dotenv from 'dotenv';

import { defineConfig, devices } from '@playwright/test';

const host = process.env.HOST || '127.0.0.1';
const port = process.env.PORT || 3333;

dotenv.config({ path: '.env.test' });

export default defineConfig({
testDir: './tests',
fullyParallel: true,
Expand All @@ -27,7 +31,7 @@ export default defineConfig({
},
],
webServer: {
command: 'npm run dev',
command: 'NODE_ENV=test bun run dev',
port: Number(port),
reuseExistingServer: !process.env.CI,
},
Expand Down
5 changes: 4 additions & 1 deletion tests/db.setup.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import 'dotenv/config';

import Database from 'better-sqlite3';
import { migrate } from 'drizzle-orm/better-sqlite3/migrator';
import { drizzle } from 'drizzle-orm/better-sqlite3';

import { test as setup } from '@playwright/test';

import { seedAssignments, seedUsers } from '~/db/seed.server';
import { DATABASE_URL } from '~/config/env.server';
import { assignmentsTable, usersTable } from '~/db/schema';

import { DATABASE_URL } from '~/config/env.server';

setup('cleanup and seed database', async () => {
const client = new Database(DATABASE_URL);
const db = drizzle(client);
Expand Down

0 comments on commit 13b6353

Please sign in to comment.