Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Dockerfile.e2e
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ WORKDIR /hypershift

COPY . .

RUN make e2e hypershift
RUN make e2e hypershift e2ev2-create-guests e2ev2-run-tests e2ev2-destroy-guests e2ev2-dump-guests

# Reuse the same image as builder because we need go command in ci-test-e2e.sh
# Multi-stage build lets us drop the source code and build cache from the final image
Expand All @@ -20,6 +20,10 @@ COPY --from=builder /hypershift/bin/test-backuprestore /hypershift/bin/test-back
COPY --from=builder /hypershift/bin/test-setup /hypershift/bin/test-setup
COPY --from=builder /hypershift/bin/test-reqserving /hypershift/bin/test-reqserving
COPY --from=builder /hypershift/bin/hypershift /hypershift/bin/hypershift
COPY --from=builder /hypershift/bin/create-guests /hypershift/bin/create-guests
COPY --from=builder /hypershift/bin/run-tests /hypershift/bin/run-tests
COPY --from=builder /hypershift/bin/destroy-guests /hypershift/bin/destroy-guests
COPY --from=builder /hypershift/bin/dump-guests /hypershift/bin/dump-guests
COPY --from=builder /hypershift/hack/ci-test-e2e.sh /hypershift/hack/ci-test-e2e.sh
COPY --from=builder /hypershift/hack/run-reqserving-e2e.sh /hypershift/hack/run-reqserving-e2e.sh

Expand Down
16 changes: 16 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,22 @@ reqserving-e2e:
e2ev2:
$(GO_E2EV2_RECIPE) -o bin/test-e2e-v2 ./test/e2e/v2/tests

.PHONY: e2ev2-create-guests
e2ev2-create-guests:
$(GO_BUILD_RECIPE) -tags e2ev2 -o bin/create-guests ./test/e2e/v2/cmd/create-guests

.PHONY: e2ev2-run-tests
e2ev2-run-tests:
$(GO_BUILD_RECIPE) -tags e2ev2 -o bin/run-tests ./test/e2e/v2/cmd/run-tests

.PHONY: e2ev2-destroy-guests
e2ev2-destroy-guests:
$(GO_BUILD_RECIPE) -tags e2ev2 -o bin/destroy-guests ./test/e2e/v2/cmd/destroy-guests

.PHONY: e2ev2-dump-guests
e2ev2-dump-guests:
$(GO_BUILD_RECIPE) -tags e2ev2 -o bin/dump-guests ./test/e2e/v2/cmd/dump-guests

.PHONY: backuprestore-e2e
backuprestore-e2e:
$(GO_BACKUPRESTORE_E2E_RECIPE) -o bin/test-backuprestore ./test/e2e/v2/tests
Expand Down
24 changes: 12 additions & 12 deletions test/e2e/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ func WaitForGuestRestConfig(t *testing.T, ctx context.Context, client crclient.C
return guestConfig
}

func WaitForGuestClient(t *testing.T, ctx context.Context, client crclient.Client, hostedCluster *hyperv1.HostedCluster) crclient.Client {
func WaitForGuestClient(t testing.TB, ctx context.Context, client crclient.Client, hostedCluster *hyperv1.HostedCluster) crclient.Client {
g := NewWithT(t)
guestKubeConfigSecretData := WaitForGuestKubeConfig(t, ctx, client, hostedCluster)

Expand Down Expand Up @@ -463,23 +463,23 @@ func WaitForGuestKubeconfigHostResolutionUpdate(t *testing.T, ctx context.Contex
g.Expect(err).NotTo(HaveOccurred(), "failed to wait for guest kubeconfig host resolution to update")
}

func WaitForNReadyNodes(t *testing.T, ctx context.Context, client crclient.Client, n int32, platform hyperv1.PlatformType) []corev1.Node {
func WaitForNReadyNodes(t testing.TB, ctx context.Context, client crclient.Client, n int32, platform hyperv1.PlatformType) []corev1.Node {
return WaitForNReadyNodesWithOptions(t, ctx, client, n, platform, "")
}

func WaitForReadyNodesByNodePool(t *testing.T, ctx context.Context, client crclient.Client, np *hyperv1.NodePool, platform hyperv1.PlatformType, opts ...NodePoolPollOption) []corev1.Node {
func WaitForReadyNodesByNodePool(t testing.TB, ctx context.Context, client crclient.Client, np *hyperv1.NodePool, platform hyperv1.PlatformType, opts ...NodePoolPollOption) []corev1.Node {
return WaitForNReadyNodesWithOptions(t, ctx, client, *np.Spec.Replicas, platform, fmt.Sprintf("for NodePool %s/%s", np.Namespace, np.Name), append(opts, WithClientOptions(crclient.MatchingLabelsSelector{Selector: labels.SelectorFromSet(labels.Set{hyperv1.NodePoolLabel: np.Name})}))...)
}

func WaitForReadyNodesByLabels(t *testing.T, ctx context.Context, client crclient.Client, platform hyperv1.PlatformType, replicas int32, nodeLabels map[string]string) []corev1.Node {
func WaitForReadyNodesByLabels(t testing.TB, ctx context.Context, client crclient.Client, platform hyperv1.PlatformType, replicas int32, nodeLabels map[string]string) []corev1.Node {
return WaitForNReadyNodesWithOptions(t, ctx, client, replicas, platform, "", WithClientOptions(crclient.MatchingLabelsSelector{Selector: labels.SelectorFromSet(labels.Set(nodeLabels))}))
}

func WaitForNodePoolConfigUpdateComplete(t *testing.T, ctx context.Context, client crclient.Client, np *hyperv1.NodePool) {
func WaitForNodePoolConfigUpdateComplete(t testing.TB, ctx context.Context, client crclient.Client, np *hyperv1.NodePool) {
WaitForNodePoolConfigUpdateCompleteWithPlatform(t, ctx, client, np, hyperv1.NonePlatform)
}

func WaitForNodePoolConfigUpdateCompleteWithPlatform(t *testing.T, ctx context.Context, client crclient.Client, np *hyperv1.NodePool, platform hyperv1.PlatformType) {
func WaitForNodePoolConfigUpdateCompleteWithPlatform(t testing.TB, ctx context.Context, client crclient.Client, np *hyperv1.NodePool, platform hyperv1.PlatformType) {
// configUpdateTimeout for config updates to complete
configUpdateTimeout := 25 * time.Minute
switch platform {
Expand Down Expand Up @@ -557,7 +557,7 @@ func WithSuffix(suffix string) NodePoolPollOption {
}
}

func WaitForNReadyNodesWithOptions(t *testing.T, ctx context.Context, client crclient.Client, n int32, platform hyperv1.PlatformType, suffix string, opts ...NodePoolPollOption) []corev1.Node {
func WaitForNReadyNodesWithOptions(t testing.TB, ctx context.Context, client crclient.Client, n int32, platform hyperv1.PlatformType, suffix string, opts ...NodePoolPollOption) []corev1.Node {
options := &NodePoolPollOptions{}
for _, opt := range opts {
opt(options)
Expand Down Expand Up @@ -606,7 +606,7 @@ func WaitForNReadyNodesWithOptions(t *testing.T, ctx context.Context, client crc
// This was renamed from WaitForImageRollout to clarify that it checks HC.Status.Version
// (data-plane CVO rollout), in contrast to WaitForControlPlaneRollout which checks
// HC.Status.ControlPlaneVersion (management-side components).
func WaitForDataPlaneRollout(t *testing.T, ctx context.Context, client crclient.Client, hostedCluster *hyperv1.HostedCluster) {
func WaitForDataPlaneRollout(t testing.TB, ctx context.Context, client crclient.Client, hostedCluster *hyperv1.HostedCluster) {
var lastVersionCompletionTime *metav1.Time
if hostedCluster.Status.Version != nil &&
len(hostedCluster.Status.Version.History) > 0 {
Expand Down Expand Up @@ -651,14 +651,14 @@ func WaitForDataPlaneRollout(t *testing.T, ctx context.Context, client crclient.

// WaitForImageRollout is a deprecated alias for WaitForDataPlaneRollout.
// Deprecated: Use WaitForDataPlaneRollout instead.
func WaitForImageRollout(t *testing.T, ctx context.Context, client crclient.Client, hostedCluster *hyperv1.HostedCluster) {
func WaitForImageRollout(t testing.TB, ctx context.Context, client crclient.Client, hostedCluster *hyperv1.HostedCluster) {
WaitForDataPlaneRollout(t, ctx, client, hostedCluster)
}

// WaitForControlPlaneRollout waits for HC.Status.ControlPlaneVersion to reach Completed state
// with the desired image. This checks management-side component rollout independently from CVO.
// Must be gated with AtLeast(t, Version422) at call sites since older clusters lack this field.
func WaitForControlPlaneRollout(t *testing.T, ctx context.Context, client crclient.Client, hostedCluster *hyperv1.HostedCluster) {
func WaitForControlPlaneRollout(t testing.TB, ctx context.Context, client crclient.Client, hostedCluster *hyperv1.HostedCluster) {
EventuallyObject(t, ctx, fmt.Sprintf("HostedCluster %s/%s controlPlaneVersion to complete", hostedCluster.Namespace, hostedCluster.Name),
func(ctx context.Context) (*hyperv1.HostedCluster, error) {
hc := &hyperv1.HostedCluster{}
Expand All @@ -676,7 +676,7 @@ func WaitForControlPlaneRollout(t *testing.T, ctx context.Context, client crclie
// WaitForControlPlaneComponentRollout waits for all ControlPlaneComponent resources to report
// RolloutComplete=True and a version different from initialVersion. This provides a belt-and-suspenders
// check alongside WaitForControlPlaneRollout by directly inspecting individual component status.
func WaitForControlPlaneComponentRollout(t *testing.T, ctx context.Context, client crclient.Client, hostedCluster *hyperv1.HostedCluster, initialVersion string) {
func WaitForControlPlaneComponentRollout(t testing.TB, ctx context.Context, client crclient.Client, hostedCluster *hyperv1.HostedCluster, initialVersion string) {
controlPlaneComponents := &hyperv1.ControlPlaneComponentList{}
controlPlaneNamespace := manifests.HostedControlPlaneNamespace(hostedCluster.Namespace, hostedCluster.Name)
EventuallyObjects(t, ctx, "control plane components to complete rollout",
Expand Down Expand Up @@ -735,7 +735,7 @@ func WaitForConditionsOnHostedControlPlane(t *testing.T, ctx context.Context, cl
)
}

func WaitForNodePoolDesiredNodes(t *testing.T, ctx context.Context, client crclient.Client, hostedCluster *hyperv1.HostedCluster) {
func WaitForNodePoolDesiredNodes(t testing.TB, ctx context.Context, client crclient.Client, hostedCluster *hyperv1.HostedCluster) {
EventuallyObjects(t, ctx, fmt.Sprintf("NodePools for HostedCluster %s/%s to have all of their desired nodes", hostedCluster.Namespace, hostedCluster.Name),
func(ctx context.Context) ([]*hyperv1.NodePool, error) {
list := &hyperv1.NodePoolList{}
Expand Down
Loading
Loading