oauth2-proxy icon indicating copy to clipboard operation
oauth2-proxy copied to clipboard

chore(deps): Updated to ginkgo v2

Open kvanzuijlen opened this issue 5 months ago • 8 comments

Description

Updated ginkgo to v2

Motivation and Context

Ginkgo was outdated

How Has This Been Tested?

Checklist:

Ran tests locally.

  • [x] My change requires a change to the documentation or CHANGELOG.
  • [x] I have updated the documentation/CHANGELOG accordingly.
  • [x] I have created a feature (non-master) branch for my PR.
  • [ ] I have written tests for my code changes.

I don't think this change requires a changelog entry since only _test.go files were changed

kvanzuijlen avatar Jan 24 '24 20:01 kvanzuijlen

Changes look good, but somehow it's broken the redis tests so will need some investigation as to why those are broken now

JoelSpeed avatar Jan 25 '24 09:01 JoelSpeed

I'll have a look this evening

kvanzuijlen avatar Jan 25 '24 10:01 kvanzuijlen

@tuunit any idea? I've been going around in circles for a couple of hours. A fresh pair of (more experienced) eyes would help.

kvanzuijlen avatar Jan 27 '24 15:01 kvanzuijlen

Currently showing

=== RUN   TestBasicSuite
Ginkgo detected an issue with your spec structure
AfterSuite(func() {
/home/runner/work/oauth2-proxy/oauth2-proxy/pkg/authentication/basic/htpasswd_test.go:104
  It looks like you are trying to add a [AfterSuite] node within a container
  node.

  AfterSuite can only be called at the top level.

  Learn more at:
  http://onsi.github.io/ginkgo/#suite-setup-and-cleanup-beforesuite-and-aftersuite

FAIL	github.com/oauth2-proxy/oauth2-proxy/v7/pkg/authentication/basic	0.020s

Which looks like it should be fairly straightforward, AfterSuite cannot be nested inside another container

JoelSpeed avatar Mar 30 '24 09:03 JoelSpeed

https://github.com/oauth2-proxy/oauth2-proxy/blob/a524c1fb466313c616e7699ffd557e2f8fd49aff/pkg/authentication/basic/htpasswd_test.go#L104

Should be AfterEach not AfterSuite

JoelSpeed avatar Mar 30 '24 09:03 JoelSpeed

@kvanzuijlen @JoelSpeed I fixed the Ginkgo issues :)

tuunit avatar Mar 31 '24 11:03 tuunit

https://github.com/oauth2-proxy/oauth2-proxy/blob/a524c1fb466313c616e7699ffd557e2f8fd49aff/pkg/authentication/basic/htpasswd_test.go#L104

Should be AfterEach not AfterSuite

Indeed this was one of the issues. Ginkgo v1 didn't really enforce that AfterSuite can only be defined outside of the spec.

Furthermore, the execution order seems to have changed slightly which causes issues with the miniredis teardown. Therefore I separated the redis store tests into two specs. One for the miniredis configure with TLS and one without.

tuunit avatar Mar 31 '24 12:03 tuunit