test: efficiency

This commit is contained in:
cha0s 2024-02-13 00:55:54 -06:00
parent 168a8700cd
commit 2e6b424499
2 changed files with 13 additions and 34 deletions

View File

@ -13,22 +13,7 @@ concurrency:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'npm'
- run: npm config set registry ${{ vars.NPM_CI_REGISTRY }}
if: ${{ vars.NPM_CI_REGISTRY }}
- run: |
npm ci
npm run build
test:
ci:
runs-on: ubuntu-latest
strategy:
max-parallel: ${{ vars.CI_PARALLEL || 256 }}
@ -41,31 +26,24 @@ jobs:
with:
packages: libgconf-2-4 libatk1.0-0 libatk-bridge2.0-0 libgdk-pixbuf2.0-0 libgtk-3-0 libgbm-dev libnss3-dev libxss-dev libasound2
version: ${{ matrix.node-version }}
- uses: browser-actions/setup-chrome@latest
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm config set registry ${{ vars.NPM_CI_REGISTRY }}
if: ${{ vars.NPM_CI_REGISTRY }}
- run: |
npm ci
npm run -- test -t 30000
npm run -- test -t 30000 -p e2e
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
- uses: actions/cache@v2
with:
node-version: 20.x
cache: 'npm'
path: "~/.cache/puppeteer"
key: ${{ runner.os }}-${{ matrix.node-version }}-puppeteer
- uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ matrix.node-version }}-modules-${{ hashFiles('package-lock.json') }}
- run: npm config set registry ${{ vars.NPM_CI_REGISTRY }}
if: ${{ vars.NPM_CI_REGISTRY }}
- run: |
npm ci
npm run lint
npm run build
npm run -- test -t 30000
npm run -- test -t 30000 -p e2e

View File

@ -8,6 +8,7 @@ import {withServer} from './build/build';
it('allows updates to fail', withServer(async ({server, socket}) => {
expect((await socket.send({type: 'config.get', payload: 'comm.foo'})).payload)
.to.equal('bar');
const hmr = socket.waitForAction('hmr');
await writeFile(
join(server.path, 'build', 'flecks.yml'),
`
@ -17,7 +18,7 @@ it('allows updates to fail', withServer(async ({server, socket}) => {
'comm:./comm': {foo: 'baz'}
`,
);
await socket.waitForAction('hmr');
await hmr;
expect((await socket.send({type: 'config.get', payload: 'comm.foo'})).payload)
.to.equal('baz');
let restarted;