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

Refactor ginkgo handler #166

Merged
merged 2 commits into from
Nov 4, 2024
Merged

Refactor ginkgo handler #166

merged 2 commits into from
Nov 4, 2024

Conversation

nunnatsa
Copy link
Owner

@nunnatsa nunnatsa commented Nov 4, 2024

Description

Refactor: move ginkgo containers logic to the handler

Cleanup the linter code by moving the ginkgo related logic (check for focus containers, and avoid test polution check), to the ginkgo linter package, in order to get cleaner main linter code.

A better way to find the actual expression

In gomega expression, the current code knows how to skip the helper method like WithOffset() and get to the actual method (e.g. Expect).

The problem is that this logic is done by comparing to a static list of method names. If a new method will be added, we'll have to add it to the list each time.

This PR fixes the issue by skipping any non-actual method.

Also, move things around for better ordering.

Cleanup the linter code by moving the ginkgo related logic (check for
focus containers, and avoid test polution check), to the ginkgo linter
package, in order to get cleaner main linter code.
In gomega expression, the current code knows how to skip the helper
method like `WithOffset()` and get to the actual method (e.g. `Expect`).

The problem is that this logic is done by comparing to a static list of
method names. If a new method will be added, we'll have to add it to the
list each time.

This commit fixes the issue by skiping any non-actual method.

Also, move things around for better oerdering.
Copy link

github-actions bot commented Nov 4, 2024

Pull Request Test Coverage Report for Build 11663392035

Details

  • 83 of 345 (24.06%) changed or added relevant lines in 10 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-4.5%) to 77.643%

Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/ginkgohandler/ginkgoinfo.go 5 15 33.33%
internal/ginkgohandler/dothandler.go 5 17 29.41%
internal/ginkgohandler/namehandler.go 6 21 28.57%
internal/gomegahandler/dothandler.go 19 64 29.69%
internal/gomegahandler/namedhandler.go 18 71 25.35%
internal/ginkgohandler/handling.go 0 127 0.0%
Totals Coverage Status
Change from base Build 11653187973: -4.5%
Covered Lines: 2181
Relevant Lines: 2809

💛 - Coveralls

@nunnatsa nunnatsa merged commit de271ea into main Nov 4, 2024
1 check passed
@nunnatsa nunnatsa deleted the refactor-ginkgo-handler branch November 4, 2024 12:00
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.

1 participant