Skip to content

Commit cb032ef

Browse files
sutaakaropenshift-merge-bot[bot]
authored andcommitted
AppWrapper e2e: Remove creationTimestamp from marshalled template
1 parent 1fda820 commit cb032ef

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

test/e2e/mnist_pytorch_appwrapper_test.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,9 @@ func runMnistPyTorchAppWrapper(t *testing.T, accelerator string, numberOfGpus in
145145
},
146146
}
147147

148+
raw := Raw(test, job)
149+
raw = RemoveCreationTimestamp(test, raw)
150+
148151
// Create an AppWrapper resource
149152
aw := &mcadv1beta2.AppWrapper{
150153
TypeMeta: metav1.TypeMeta{
@@ -159,7 +162,7 @@ func runMnistPyTorchAppWrapper(t *testing.T, accelerator string, numberOfGpus in
159162
Spec: mcadv1beta2.AppWrapperSpec{
160163
Components: []mcadv1beta2.AppWrapperComponent{
161164
{
162-
Template: Raw(test, job),
165+
Template: raw,
163166
},
164167
},
165168
},

test/e2e/mnist_rayjob_raycluster_test.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ func runMnistRayJobRayClusterAppWrapper(t *testing.T, accelerator string, number
135135

136136
// Create RayCluster, wrap in AppWrapper and assign to localqueue
137137
rayCluster := constructRayCluster(test, namespace, mnist, numberOfGpus)
138+
raw := Raw(test, rayCluster)
139+
raw = RemoveCreationTimestamp(test, raw)
140+
138141
aw := &mcadv1beta2.AppWrapper{
139142
TypeMeta: metav1.TypeMeta{
140143
APIVersion: mcadv1beta2.GroupVersion.String(),
@@ -148,7 +151,7 @@ func runMnistRayJobRayClusterAppWrapper(t *testing.T, accelerator string, number
148151
Spec: mcadv1beta2.AppWrapperSpec{
149152
Components: []mcadv1beta2.AppWrapperComponent{
150153
{
151-
Template: Raw(test, rayCluster),
154+
Template: raw,
152155
},
153156
},
154157
},

test/e2e/support.go

+11
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,12 @@ package e2e
1818

1919
import (
2020
"embed"
21+
"strings"
2122

2223
"github.com/onsi/gomega"
2324
"github.com/project-codeflare/codeflare-common/support"
25+
26+
"k8s.io/apimachinery/pkg/runtime"
2427
)
2528

2629
//go:embed *.py *.txt *.sh
@@ -32,3 +35,11 @@ func ReadFile(t support.Test, fileName string) []byte {
3235
t.Expect(err).NotTo(gomega.HaveOccurred())
3336
return file
3437
}
38+
39+
func RemoveCreationTimestamp(t support.Test, rawExtension runtime.RawExtension) runtime.RawExtension {
40+
t.T().Helper()
41+
patchedRaw := strings.ReplaceAll(string(rawExtension.Raw), `"metadata":{"creationTimestamp":null},`, "")
42+
return runtime.RawExtension{
43+
Raw: []byte(patchedRaw),
44+
}
45+
}

0 commit comments

Comments
 (0)