Skip to content

Commit da83e5d

Browse files
committed
Merge branch 'master' into update_go_version
2 parents a46cb8c + 8d62db8 commit da83e5d

File tree

6 files changed

+39
-12
lines changed

6 files changed

+39
-12
lines changed

build/devsandbox-dashboard/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ WORKDIR /app
5151
# Increase shared memory for browsers (recommended for Playwright)
5252
RUN mkdir -p /dev/shm && chmod 1777 /dev/shm
5353

54-
COPY . .
55-
5654
# Install Firefox required dependencies
5755
RUN yum install -y \
5856
libxcb \
@@ -76,4 +74,6 @@ RUN yum install -y \
7674
libX11-xcb && \
7775
yum clean all
7876

77+
COPY . .
78+
7979
CMD ["/bin/bash"]

go.mod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,3 +145,5 @@ require (
145145
go 1.24.4
146146

147147
toolchain go1.24.13
148+
149+
tool github.com/playwright-community/playwright-go/cmd/playwright

make/devsandbox-dashboard.mk

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,8 @@ endif
3232
e2e-run-devsandbox-dashboard: HOST_NS=$(shell oc get projects -l app=host-operator --output=name -o jsonpath='{range .items[*]}{.metadata.name}{"\n"}{end}' | sort | tail -n 1)
3333
e2e-run-devsandbox-dashboard: RHDH=https://rhdh-${DEVSANDBOX_DASHBOARD_NS}.$(shell oc get ingress.config.openshift.io/cluster -o jsonpath='{.spec.domain}')
3434
e2e-run-devsandbox-dashboard:
35-
$(eval PWGO_VER := $(shell grep -oE "playwright-go v\S+" go.mod | sed 's/playwright-go //g'))
36-
@echo "Installing Playwright CLI version: $(PWGO_VER)"
37-
go install github.com/playwright-community/playwright-go/cmd/playwright@$(PWGO_VER)
3835
@echo "Installing Firefox browser for Playwright..."
39-
$(GOPATH)/bin/playwright install firefox
36+
go tool playwright install firefox
4037

4138
@echo "Running Developer Sandbox Dashboard setup e2e tests..."
4239
DEVSANDBOX_DASHBOARD_NS=${DEVSANDBOX_DASHBOARD_NS} go test "./test/e2e/devsandbox-dashboard/setup" -v -timeout=10m -failfast

test/e2e/parallel/registration_service_test.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -854,6 +854,11 @@ func TestActivationCodeVerification(t *testing.T) {
854854
event := testsocialevent.NewSocialEvent(hostAwait.Namespace, commonsocialevent.NewName(),
855855
testsocialevent.WithUserTier("deactivate80"),
856856
testsocialevent.WithSpaceTier("base1ns6didler"),
857+
// MaxAttendees is set to 0 to simulate event being already full
858+
// We use this approach instead of manipulating ActivationCount to avoid flakiness
859+
// if the controller reconciliation is triggered by other parallel test, the ActivationCount
860+
// would be recalculated to 0 (due to the counting of approved UserSignups) and the test would fail.
861+
testsocialevent.WithMaxAttendees(0),
857862
testsocialevent.WithTargetCluster(member2Await.ClusterName))
858863
err := hostAwait.CreateWithCleanup(t, event)
859864
require.NoError(t, err)
@@ -862,12 +867,6 @@ func TestActivationCodeVerification(t *testing.T) {
862867
Status: corev1.ConditionTrue,
863868
})) // need to reload event
864869
require.NoError(t, err)
865-
event, err = wait.For(t, hostAwait.Awaitility, &toolchainv1alpha1.SocialEvent{}).
866-
UpdateStatus(event.Name, hostAwait.Namespace,
867-
func(ev *toolchainv1alpha1.SocialEvent) {
868-
ev.Status.ActivationCount = event.Spec.MaxAttendees // activation count identical to `MaxAttendees`
869-
})
870-
require.NoError(t, err)
871870

872871
userSignup, token := signup(t, hostAwait)
873872

test/e2e/parallel/user_workloads_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ func TestIdlerAndPriorityClass(t *testing.T) {
111111
// Wait for the DataVolume to be deleted
112112
err = memberAwait.WaitUntilDataVolumeDeleted(t, "test-idler-datavolume", idler.Name, clnt.Resource(dataVolumeRes))
113113
require.NoError(t, err)
114+
115+
// Wait for the PVC to be deleted
116+
err = memberAwait.WaitUntilPVCDeleted(t, "test-idler-pvc", idler.Name)
117+
require.NoError(t, err)
114118
}
115119

116120
func prepareIdlerUser(t *testing.T, await wait.Awaitilities, name string) (*toolchainv1alpha1.Idler, *toolchainv1alpha1.Idler) {
@@ -170,6 +174,10 @@ func prepareWorkloads(t *testing.T, memberAwait *wait.MemberAwaitility, namespac
170174
createDataVolume(t, memberAwait, "test-idler-datavolume", namespace)
171175
n = n + 1
172176

177+
// Create a PVC and Pod
178+
createPvcWithPod(t, memberAwait, "test-idler-pvc", namespace, nil)
179+
n = n + 1
180+
173181
servingRuntimeDeployment := createKServeWorkloads(t, memberAwait, "test-idler-kserve", namespace)
174182
n = n + int(*servingRuntimeDeployment.Spec.Replicas)
175183

testsupport/wait/member.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1573,6 +1573,27 @@ func (a *MemberAwaitility) WaitUntilDataVolumeDeleted(t *testing.T, name, namesp
15731573
return err
15741574
}
15751575

1576+
// WaitUntilPVCDeleted waits for the PVC resource to be deleted (idled)
1577+
func (a *MemberAwaitility) WaitUntilPVCDeleted(t *testing.T, name, namespace string) error {
1578+
t.Logf("waiting for PVC '%s' to be deleted in namespace '%s'", name, namespace)
1579+
pvc := &corev1.PersistentVolumeClaim{}
1580+
err := wait.PollUntilContextTimeout(context.TODO(), a.RetryInterval, a.Timeout, true, func(ctx context.Context) (bool, error) {
1581+
pvc = &corev1.PersistentVolumeClaim{}
1582+
err := a.Client.Get(ctx, test.NamespacedName(namespace, name), pvc)
1583+
if err != nil {
1584+
if errors.IsNotFound(err) {
1585+
return true, nil
1586+
}
1587+
return false, err
1588+
}
1589+
return false, nil
1590+
})
1591+
if err != nil {
1592+
t.Logf("failed waiting for PVC '%s' to be deleted in namespace '%s': %q", name, namespace, pvc)
1593+
}
1594+
return err
1595+
}
1596+
15761597
// WaitForPods waits until "n" number of pods exist in the given namespace
15771598
func (a *MemberAwaitility) WaitForPods(t *testing.T, namespace string, n int, criteria ...PodWaitCriterion) ([]corev1.Pod, error) {
15781599
t.Logf("waiting for Pods in namespace '%s' with matching criteria", namespace)

0 commit comments

Comments
 (0)