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

test: Fix test descriptions and enforce it via new linting rule #11285

Merged
merged 14 commits into from
Aug 18, 2021

Conversation

zharinov
Copy link
Collaborator

@zharinov zharinov commented Aug 16, 2021

Changes:

  • Use strings for root descriptions in *.spec.ts files.
  • Merge multiple roots and move some test in order to get rid of duplicates

Context:

Closes #11198

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please tick one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

@zharinov zharinov force-pushed the refactor/fix-test-descriptions branch from 243c6e5 to 4216d78 Compare August 16, 2021 12:38
@rarkins rarkins requested a review from viceice August 16, 2021 12:41
Copy link
Member

@viceice viceice left a comment

Choose a reason for hiding this comment

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

Marking this as draft because it will conflict with v26 merge later today

.eslintrc.js Outdated
@@ -3,6 +3,7 @@ module.exports = {
env: {
node: true,
},
// plugins: ['@renovate'],
Copy link
Member

Choose a reason for hiding this comment

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

can we references this via giturl as dependency until we release it to npm / github pacakges?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm kind of learning towards leaving it as git-only, because we will be the only user

Copy link
Member

Choose a reason for hiding this comment

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

So we should add a v0.0.1 tag to renovatebot/eslint-plugin and reference it in package.json as

 "@renovate/eslint-plugin": "renovatebot/eslint-plugin#v0.0.1"

We can also just use the commit hash for now.

 "@renovate/eslint-plugin": "renovatebot/eslint-plugin#1ebc0b1"

@@ -1,16 +1,15 @@
import { api as semver } from '.';

describe('semver.matches()', () => {
Copy link
Member

Choose a reason for hiding this comment

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

better add a new nesting level, so we can have function name as second level describe block

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In this PR, I've made minimal merge into single top-level describe-block. Later, I would like to gradually refactor all versioning tests to more readable table form, as I did for Cargo. And I'm about to start from version schemes you mentioned here.

Copy link
Member

Choose a reason for hiding this comment

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

I would prefer to add a new toplevel describe block here instead, i can ignore whitespace changes at review, so we have only a few changed lines.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah, now I got what you wanted. Just was confused with it() that doesn't allow duplicates and thought nested describe would raise similar lint warnings too.

lib/versioning/composer/index.spec.ts Show resolved Hide resolved
lib/versioning/hashicorp/index.spec.ts Show resolved Hide resolved
lib/versioning/npm/index.spec.ts Show resolved Hide resolved
lib/versioning/pep440/index.spec.ts Show resolved Hide resolved
lib/versioning/semver/index.spec.ts Show resolved Hide resolved
lib/versioning/swift/index.spec.ts Show resolved Hide resolved
@viceice viceice marked this pull request as draft August 16, 2021 18:38
@viceice viceice changed the title refactor: Fix test descriptions before new lint rule test: Fix test descriptions before new lint rule Aug 16, 2021
@zharinov zharinov marked this pull request as ready for review August 17, 2021 07:15
@zharinov
Copy link
Collaborator Author

BTW, usage of this linter implies that you can have only one root describe block.

@zharinov zharinov changed the title test: Fix test descriptions before new lint rule test: Fix test descriptions and enforce it via new linting rule Aug 17, 2021
@zharinov zharinov requested a review from viceice August 17, 2021 08:47
@zharinov zharinov marked this pull request as draft August 17, 2021 10:16
@zharinov zharinov marked this pull request as ready for review August 17, 2021 10:19
@zharinov
Copy link
Collaborator Author

Fixed Windows CI for @renovate/eslint-parser

Copy link
Member

@viceice viceice left a comment

Choose a reason for hiding this comment

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

We should completly remove export function getName(): string function or is it used anywhere else?

Otherwise LGTM

@@ -1469,6 +1469,10 @@
dependencies:
"@octokit/openapi-types" "^9.5.0"

"@renovate/eslint-plugin@https://github.com/renovatebot/eslint-plugin#v0.0.3":
version "0.0.1"
Copy link
Member

Choose a reason for hiding this comment

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

You should update the version next time 😉

Sergei Zharinov added 2 commits August 17, 2021 15:12
@rarkins rarkins enabled auto-merge (squash) August 18, 2021 05:39
@rarkins rarkins merged commit 5f4b9f9 into renovatebot:main Aug 18, 2021
@renovate-release
Copy link
Collaborator

🎉 This PR is included in version 26.1.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enforce top-level test naming convention via CI pipeline
4 participants