Skip to content

Commit

Permalink
Initial login page and jam page (#1)
Browse files Browse the repository at this point in the history
* horizontal buttons with chord names

* you can add chords to draft view

* add playwright

* add playwright tests

* fix GH workflow artifact upload

* fix GH workflow artifact upload #2

* add code coverage

* fix workflow file

* fix workflow run in background

* hardcode not running server in playwright process

* fix workflow for coverage post

* disable code coverage report in CI

* code coverage continue-on-error

* comment out code coverage in workflow. would rather it be obvious it's "not working"

* code coverage upload artifact

* explicitly stop running server in actions workflow

* use ts-node with nyc

* add server logs to workflow artifacts

* fix stop server pid in workflow

* avoid playwright web server in ci

* change wait pid to sleep

* try other sleep tactic

* make it so playwright video is always recorded

* fix test server path

* change "npm start" to run compiled build

* add "new jam" button

* websocket update works
  • Loading branch information
mickmister authored Jan 17, 2024
1 parent bd7efbd commit 120e125
Show file tree
Hide file tree
Showing 19 changed files with 8,217 additions and 0 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Playwright Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
playwright-tests:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Install application dependencies
run: npm ci

- name: Build server with coverage
run: npm run build-coverage

- name: Install test dependencies
run: npm ci
working-directory: tests-e2e

- name: Install Playwright browsers
run: npx playwright install --with-deps
working-directory: tests-e2e

- name: Run server with coverage
run: |
npm run start-coverage > server.log 2>&1 &
echo $! > server.pid
env:
CI: true

- name: Run Playwright tests
run: npm test
working-directory: tests-e2e
env:
CI: true

- name: Stop server
run: |
SERVER_PID=$(cat server.pid)
sleep 5
kill $SERVER_PID
sleep 5
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: tests-e2e/playwright-report
retention-days: 30

- uses: actions/upload-artifact@v3
if: always()
with:
name: coverage-report
path: coverage
retention-days: 30

- uses: actions/upload-artifact@v3
if: always()
with:
name: server-log
path: server.log
retention-days: 30
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
dist

coverage
.nyc_output
35 changes: 35 additions & 0 deletions esbuild.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import esbuild from 'esbuild';

import {esbuildPluginIstanbul} from "esbuild-plugin-istanbul";

const plugins: esbuild.Plugin[] = [];

if (process.env.COVERAGE) {

// Add code coverage instrumentation
plugins.push(
esbuildPluginIstanbul({
name: "istanbul-loader-ts",
filter: /\.[cm]?ts$/,
loader: "ts",
}),
esbuildPluginIstanbul({
name: "istanbul-loader-tsx",
filter: /\.tsx$/,
loader: "tsx",
}),
);
}


(async () => {
await esbuild.build({
plugins,
bundle: true,
platform: 'node',
target: 'node14',
sourcemap: true,
entryPoints: ['server/src/index.ts'],
outdir: 'dist/server',
});
})();
Loading

0 comments on commit 120e125

Please sign in to comment.