-
Notifications
You must be signed in to change notification settings - Fork 217
chore: fix flaky smoke tests on yarn #2764
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
Changes from 13 commits
1ab2f6b
a4fe0f6
7396cdd
cb57a7c
a120ae3
3e06e62
e7827c6
da20af1
1dcd7fb
9fff599
2771801
3c5609b
daa1c70
64da1cd
0e709bc
66f5c91
8ff38ce
54aa739
df6eff9
af87090
b523925
41e177e
f7c6af9
388d798
bde52ed
801cb4a
82104c8
9fa6b3c
d39f863
92985f2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| #!/bin/bash | ||
|
|
||
| REDOCLY_CONFIG_VERSION=$(node -e "const fs = require('fs'); const p = JSON.parse(fs.readFileSync('./packages/core/package.json', 'utf8')); console.log(p.dependencies['@redocly/config'].replace(/\^/, ''));") | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We're emulating something that will not be the case in our users' setup, so the smokes become irrelevant. Let's try keeping them as much close to the reality as possible.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This bash script read the version of
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's discuss this offine. |
||
|
|
||
| echo "Pinning @redocly/config to $REDOCLY_CONFIG_VERSION in smoke test overrides" | ||
|
|
||
| node -e " | ||
| const fs = require('fs'); | ||
| const path = './tests/smoke/basic/package.json'; | ||
| const pkg = JSON.parse(fs.readFileSync(path, 'utf8')); | ||
| (pkg.resolutions ??= {})['@redocly/config'] = '$REDOCLY_CONFIG_VERSION'; | ||
| (pkg.overrides ??= {})['@redocly/config'] = '$REDOCLY_CONFIG_VERSION'; | ||
| ((pkg.pnpm ??= {}).overrides ??= {})['@redocly/config'] = '$REDOCLY_CONFIG_VERSION'; | ||
|
|
||
| fs.writeFileSync(path, JSON.stringify(pkg, null, 2) + '\n'); | ||
| " | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,8 +8,8 @@ echo "Directory content:" | |
| ls -a | ||
| echo | ||
|
|
||
| # Executing the command provided as the first argument | ||
| $1 | ||
| # Executing the command provided as the first argument | ||
| eval "$1" | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's the difference?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Before this change, smoke tests became unstable, because we are using
AlbinaBlazhko17 marked this conversation as resolved.
Outdated
|
||
|
|
||
| # Actual smoke test - executing the command provided as the second argument | ||
| $2 redocly-version | ||
|
|
||
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.
This doesn't make any difference but the intention becomes less clear.
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.
I wanted to use
yarn installinstead ofyarn addto fix the issue, so i added intopackage.jsondependency, which points to thetgzcli file. I changed all tests to use just install and be consistent across the tests.