CLOUDP-246611: Wire context in the integration tests
All Submissions:
- [x] Have you signed our CLA?
- [ ] Put
closes #XXXXin your comment to auto-close the issue that your PR fixes (if there is one). - [ ] Update docs/release-notes/release-notes-template.md if your changes should be included in the release notes for the next release.
https://app.codecov.io/github/mongodb/mongodb-atlas-kubernetes/commit/f7489dbb2a3d455601c9454987f11a8578a3c881
One comment. As per https://onsi.github.io/ginkgo/ we can directly wire the context in all ginkgo specs transparently, i.e.:
It("can save books", func(ctx SpecContext) {
book := &books.Book{
Title: "Les Miserables",
Author: "Victor Hugo",
Pages: 2783,
}
Expect(libraryClient.SaveBook(ctx, book)).To(Succeed())
Expect(libraryClient.ListBooks(ctx)).To(ContainElement(book))
})
when such a node is detected Ginkgo will automatically supply a SpecContext object. This SpecContext object satisfies the context.Context interface and can be used anywhere a context.Context object is used. When a spec times out or is interrupted by the user (see below) Ginkgo will cancel the SpecContext to signal to the spec that it is time to exit. In the case above, it is assumed that libraryClient knows how to return once ctx is cancelled.
Oops! I just checked the CI expecting to see the usual e2e suspects there red, but the most of integration tests are red now. I believe this change introduces a problem.
This PR has gone 30 days without any activity and meets the project’s definition of 'stale'. This will be auto-closed if there is no new activity over the next 60 days. If the issue is still relevant and active, you can simply comment with a 'bump' to keep it open. Thanks for keeping our repository healthy!
The task was done in another PR keeping the context defined in the ticket.