cluster-api icon indicating copy to clipboard operation
cluster-api copied to clipboard

🌱 Update tests to Ginkgo v2

Open mboersma opened this issue 2 years ago • 6 comments

What this PR does / why we need it:

Updates CAPI to Ginkgo v2.

Kubernetes just migrated in kubernetes/kubernetes#109111. I attempted to update Ginkgo in CAPZ but can't because of test framework depencies here in CAPI.

The reporting framework has changed significantly: essentially, custom reporters are out. The --junit-report and related flags should give us similar output files, but let's see.

Which issue(s) this PR fixes:

Fixes #4897

cc: @vladimirvivien

mboersma avatar Jul 12 '22 21:07 mboersma

/retitle [WIP] Update tests to Ginkgo v2

mboersma avatar Jul 14 '22 13:07 mboersma

I think we should only do this if there is a good reason why we have to use ginkgo v2 in CAPI v1.2

+1, it does not seem to be the case at the moment.

enxebre avatar Jul 18 '22 10:07 enxebre

/retitle 🌱 Update tests to Ginkgo v2

mboersma avatar Jul 18 '22 19:07 mboersma

/hold

In today's CAPI office hours meeting, we agreed to merge this in a month, because we assume providers are still integrating the v1.2.0 release. I will send an email to the list announcing that timeline so providers have time to prepare for this breaking change.

mboersma avatar Jul 20 '22 21:07 mboersma

Looks like it's counting SynchronizedBeforeSuite as a spec in the Junit reporting, not sure if that's expected or not

Screen Shot 2022-07-20 at 3 53 12 PM

CecileRobertMichon avatar Jul 20 '22 22:07 CecileRobertMichon

I should have time for a review early next week.

sbueringer avatar Aug 19 '22 13:08 sbueringer

cc @schrej If you have some time can you please take a look at this PR as well, given your experience working on the Ginkgo v2 bump in CR.

sbueringer avatar Aug 22 '22 15:08 sbueringer

Switching imports and replacing the custom JUnit reporter with command line flags is what we've done on CR as well, so /lgtm

Should maybe be a :warning: in the title though?

schrej avatar Aug 22 '22 15:08 schrej

Should we add a note to the 1.2->1.3 guide mentioning this?

Yes. We should definitely mention:

  • that the ginkgo & gomega dependencies were upgraded and thus all consumers have to ugprade as well
  • the default timeout has been changed to 1h (https://onsi.github.io/ginkgo/MIGRATING_TO_V2#timeout-behavior)
  • -juni-report has to be used instead of the junit reporter
  • xref to this PR for an example-upgrade & to https://onsi.github.io/ginkgo/MIGRATING_TO_V2

sbueringer avatar Aug 22 '22 16:08 sbueringer

/test ?

sbueringer avatar Aug 22 '22 16:08 sbueringer

@sbueringer: The following commands are available to trigger required jobs:

  • /test pull-cluster-api-build-main
  • /test pull-cluster-api-e2e-main
  • /test pull-cluster-api-test-main
  • /test pull-cluster-api-test-mink8s-main
  • /test pull-cluster-api-verify-main

The following commands are available to trigger optional jobs:

  • /test pull-cluster-api-apidiff-main
  • /test pull-cluster-api-e2e-full-main
  • /test pull-cluster-api-e2e-informing-ipv6-main
  • /test pull-cluster-api-e2e-informing-main
  • /test pull-cluster-api-e2e-workload-upgrade-1-21-1-22-main
  • /test pull-cluster-api-e2e-workload-upgrade-1-24-latest-main

Use /test all to run the following jobs that were automatically triggered:

  • pull-cluster-api-apidiff-main
  • pull-cluster-api-build-main
  • pull-cluster-api-e2e-informing-ipv6-main
  • pull-cluster-api-e2e-informing-main
  • pull-cluster-api-e2e-main
  • pull-cluster-api-test-main
  • pull-cluster-api-test-mink8s-main
  • pull-cluster-api-verify-main

In response to this:

/test ?

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

k8s-ci-robot avatar Aug 22 '22 16:08 k8s-ci-robot

/test pull-cluster-api-e2e-full-main /test pull-cluster-api-e2e-workload-upgrade-1-21-1-22-main /test pull-cluster-api-e2e-workload-upgrade-1-24-latest-main

Want to see if there are any side effects on the upgrade jobs which are running the upstream conformance tests

Otherwise lgtm from my side

sbueringer avatar Aug 22 '22 16:08 sbueringer

Should we add a note to the 1.2->1.3 guide mentioning this?

👍🏻 I see that we have mentioned test framework changes before under the Other: section in version migration docs, so I'll add that.

mboersma avatar Aug 22 '22 16:08 mboersma

/retitle ⚠️ Update tests to Ginkgo v2

mboersma avatar Aug 22 '22 16:08 mboersma

/hold cancel

mboersma avatar Aug 22 '22 16:08 mboersma

/test pull-cluster-api-e2e-full-main /test pull-cluster-api-e2e-workload-upgrade-1-21-1-22-main /test pull-cluster-api-e2e-workload-upgrade-1-24-latest-main

mboersma avatar Aug 22 '22 16:08 mboersma

Thank you!

lgtm pending green tests

sbueringer avatar Aug 22 '22 17:08 sbueringer

I assume otherwise we're basically ready to merge (considering the mail in which we wrote we want to merge today :)).

cc @CecileRobertMichon @fabriziopandini

sbueringer avatar Aug 22 '22 17:08 sbueringer

Looks like it's counting SynchronizedBeforeSuite as a spec in the Junit reporting, not sure if that's expected or not

@CecileRobertMichon I see that changed, but I haven't been able to track down where and why. I assume it's part of the new --junit-report implementation. It seems benign, but I can look into it more deeply if we don't like this behavior.

mboersma avatar Aug 22 '22 17:08 mboersma

Looks like it's counting SynchronizedBeforeSuite as a spec in the Junit reporting, not sure if that's expected or not

@CecileRobertMichon I see that changed, but I haven't been able to track down where and why. I assume it's part of the new --junit-report implementation. It seems benign, but I can look into it more deeply if we don't like this behavior.

It would be interesting to know, but definitely not a showstopper for me.

sbueringer avatar Aug 22 '22 18:08 sbueringer

/lgtm

sbueringer avatar Aug 22 '22 18:08 sbueringer

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: CecileRobertMichon

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • ~~OWNERS~~ [CecileRobertMichon]

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

k8s-ci-robot avatar Aug 22 '22 19:08 k8s-ci-robot

I see that changed, but I haven't been able to track down where and why. I assume it's part of the new --junit-report implementation. It seems benign, but I can look into it more deeply if we don't like this behavior.

definitely not a blocker, just seemed interesting

CecileRobertMichon avatar Aug 22 '22 19:08 CecileRobertMichon

/hold cancel

I think this is ready to merge. Thanks everyone for the reviews and the help!

mboersma avatar Aug 22 '22 21:08 mboersma

@mboersma Thank you very much for pushing this forward! :)

sbueringer avatar Aug 23 '22 11:08 sbueringer