mongodb-atlas-kubernetes icon indicating copy to clipboard operation
mongodb-atlas-kubernetes copied to clipboard

CLOUDP-246611: Wire context in the integration tests

Open helderjs opened this issue 1 year ago • 3 comments

All Submissions:

  • [x] Have you signed our CLA?
  • [ ] Put closes #XXXX in 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.

helderjs avatar May 22 '24 18:05 helderjs

https://app.codecov.io/github/mongodb/mongodb-atlas-kubernetes/commit/f7489dbb2a3d455601c9454987f11a8578a3c881

github-actions[bot] avatar May 22 '24 18:05 github-actions[bot]

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.

s-urbaniak avatar May 22 '24 19:05 s-urbaniak

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.

josvazg avatar May 23 '24 07:05 josvazg

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!

github-actions[bot] avatar Jun 23 '24 12:06 github-actions[bot]

The task was done in another PR keeping the context defined in the ticket.

helderjs avatar Jun 28 '24 09:06 helderjs