Skip to content
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

Create rule S5973: Tests should be stable #4443

Merged
merged 3 commits into from Dec 6, 2023

Conversation

ilia-kebets-sonarsource
Copy link
Contributor

Fixes #4429

@ilia-kebets-sonarsource ilia-kebets-sonarsource changed the title implement rule for jest Create rule S5973: Tests should be stable Nov 29, 2023
@ilia-kebets-sonarsource
Copy link
Contributor Author

ilia-kebets-sonarsource commented Nov 29, 2023

As mentioned, there seems to be some kind of issue with the error message that I run into when executing the ruling test, which prevents the plugin from creating the expected issues:

INFO: Loading /Users/ilia.kebets/Dev/Sonar/SonarJS/its/ruling/src/test/expected/jsts/file-for-rules
ERROR: Error: Failed to parse encoded issue message for rule stable-tests:
ERROR: "Make your tests stable so that they passes on the first try, or remove the flaky ones". Unexpected token 'M', "Make your "... is not valid JSON
ERROR:     at decodeSonarRuntime (/Users/ilia.kebets/Dev/Sonar/SonarJS/its/sources/jsts/custom/.scannerwork/.sonartmp/bridge-bundle/package/lib/jsts/src/linter/issues/decode.js:27:19)
ERROR:     at transformMessages (/Users/ilia.kebets/Dev/Sonar/SonarJS/its/sources/jsts/custom/.scannerwork/.sonartmp/bridge-bundle/package/lib/jsts/src/linter/issues/transform.js:40:75)
ERROR:     at LinterWrapper.lint (/Users/ilia.kebets/Dev/Sonar/SonarJS/its/sources/jsts/custom/.scannerwork/.sonartmp/bridge-bundle/package/lib/jsts/src/linter/wrapper.js:121:47)
ERROR:     at analyzeFile (/Users/ilia.kebets/Dev/Sonar/SonarJS/its/sources/jsts/custom/.scannerwork/.sonartmp/bridge-bundle/package/lib/jsts/src/analysis/analyzer.js:68:87)
ERROR:     at analysis (/Users/ilia.kebets/Dev/Sonar/SonarJS/its/sources/jsts/custom/.scannerwork/.sonartmp/bridge-bundle/package/lib/jsts/src/analysis/analyzer.js:48:28)
ERROR:     at measureDuration (/Users/ilia.kebets/Dev/Sonar/SonarJS/its/sources/jsts/custom/.scannerwork/.sonartmp/bridge-bundle/package/lib/jsts/src/monitoring/measure.js:31:20)
ERROR:     at analyzeJSTS (/Users/ilia.kebets/Dev/Sonar/SonarJS/its/sources/jsts/custom/.scannerwork/.sonartmp/bridge-bundle/package/lib/jsts/src/analysis/analyzer.js:49:89)
ERROR:     at MessagePort.<anonymous> (/Users/ilia.kebets/Dev/Sonar/SonarJS/its/sources/jsts/custom/.scannerwork/.sonartmp/bridge-bundle/package/lib/bridge/src/worker.js:79:36)

packages/jsts/src/rules/S5973/rule.ts Outdated Show resolved Hide resolved
packages/jsts/src/rules/S5973/rule.ts Outdated Show resolved Hide resolved
packages/jsts/src/rules/S5973/rule.ts Outdated Show resolved Hide resolved
packages/jsts/src/rules/S5973/rule.ts Show resolved Hide resolved
packages/jsts/src/rules/S5973/rule.ts Outdated Show resolved Hide resolved
packages/jsts/src/rules/S5973/rule.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@vdiez vdiez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add caches to package-json utils module and we should be good

Copy link
Contributor

@vdiez vdiez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice! :)

Copy link

sonarqube-next bot commented Dec 5, 2023

@ilia-kebets-sonarsource ilia-kebets-sonarsource dismissed yassin-kammoun-sonarsource’s stale review December 6, 2023 08:40

I have received another one from victor

@ilia-kebets-sonarsource ilia-kebets-sonarsource merged commit 3ea01cd into master Dec 6, 2023
17 checks passed
@ilia-kebets-sonarsource ilia-kebets-sonarsource deleted the issue-4429-flaky-tests branch December 6, 2023 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create rule S5973: Tests should be stable
3 participants