Skip to content

Commit

Permalink
chore: increase server test timeout, fix yarn build:clean (#9336)
Browse files Browse the repository at this point in the history
In #9325, I added a few
fixtures to the `@redwoodjs/api-server` package that include dist files.
`yarn build:clean` deletes all dist directories in all packages (the
glob is `packages/**/dist`), so `yarn rwfw project:sync` ended up
deleting twenty or so files. This PR makes `yarn build:clean` a little
smarter. I couldn't see a way to do it via the `rimraf` CLI, so I just
made a script.

This PR also increases the timeout in the server tests which were a
little flakey.
  • Loading branch information
jtoar authored Oct 25, 2023
1 parent a12d411 commit 73579f8
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"scripts": {
"benchmark": "tsx ./tasks/benchmark/run-benchmarks.mts",
"build": "lerna run build",
"build:clean": "yarn clean:prisma && rimraf \"packages/**/dist\" --glob",
"build:clean": "yarn node ./tasks/clean.mjs",
"build:clean:super": "git clean -fdx && yarn && yarn build",
"build:link": "node ./tasks/build-and-copy",
"build:test-project": "node ./tasks/test-project/test-project",
Expand Down
13 changes: 13 additions & 0 deletions tasks/clean.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env node
/* eslint-env node */

import { rimraf } from 'rimraf'
import { $ } from 'zx'

await $`yarn clean:prisma`

await rimraf('packages/**/dist', {
glob: {
ignore: 'packages/**/{fixtures,__fixtures__}/**/dist',
},
})
1 change: 1 addition & 0 deletions tasks/server-tests/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/** @type {import('jest').Config} */
const config = {
rootDir: '.',
testTimeout: 5_000 * 2,
}

module.exports = config
2 changes: 1 addition & 1 deletion tasks/server-tests/server.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ afterEach(async () => {
}
})

const TIMEOUT = 1_500
const TIMEOUT = 1_000 * 2

const commandStrings = {
'@redwoodjs/cli': `node ${path.resolve(
Expand Down

0 comments on commit 73579f8

Please sign in to comment.