-
Notifications
You must be signed in to change notification settings - Fork 532
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: convert flaky tests to jest & increase timeout #1657
Conversation
test/monitor-target.spec.ts
Outdated
async function getFakeServerRequestBody(server) { | ||
const dir = path.join(__dirname, '/acceptance', 'workspaces'); | ||
process.chdir(dir); | ||
await cli.monitor('yarn-package'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't scan the root package as it triggers a super slow node_modules
traversal test
throw err; | ||
} | ||
// give file a little time to be finished to be written | ||
await new Promise((r) => setTimeout(r, 3000)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wait a little for file to finish writing before reading it.
2f53943
to
af14787
Compare
293511b
to
143fab7
Compare
test/cli-json-file-output.spec.ts
Outdated
.toLowerCase() | ||
.indexOf('windows') === 0; | ||
describe('test --json-file-output ', () => { | ||
const noVulnsProjectPath = join(__dirname, '/acceptance', 'workspaces', 'no-vulns'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use a project with no vulns so we are not trying to traverse node_modules
for this test which is slow
9bf1fa0
to
2c5e30c
Compare
8d60af3
to
a4dcbad
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good - as this is a refactor, I would recommend refactor
instead of test
a4dcbad
to
b748b87
Compare
What does this PR do?
Convert some flaky tests to jest from tap
Increase timeout for analytics tests
Use a smaller fixture with a lockfile for a slow test
test/monitor-target.spec.ts
that was running onnode_modules