-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial login page and jam page (#1)
* 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
1 parent
bd7efbd
commit 120e125
Showing
19 changed files
with
8,217 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
node_modules | ||
dist | ||
|
||
coverage | ||
.nyc_output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', | ||
}); | ||
})(); |
Oops, something went wrong.