Skip to content

Commit 988d75e

Browse files
jentingroboquat
authored andcommitted
test: remove git initializer TargetMode and CloneTaget
Signed-off-by: JenTing Hsiao <[email protected]>
1 parent 4af208a commit 988d75e

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

test/tests/components/ws-manager/content_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,14 @@ func TestBackup(t *testing.T) {
5757
api.Done(t)
5858
})
5959

60+
// TODO: change to use server API to launch the workspace, so we could run the integration test as the user code flow
61+
// which is client -> server -> ws-manager rather than client -> ws-manager directly
6062
ws1, stopWs1, err := integration.LaunchWorkspaceDirectly(t, ctx, api, integration.WithRequestModifier(func(w *wsmanapi.StartWorkspaceRequest) error {
6163
w.Spec.FeatureFlags = test.FF
6264
w.Spec.Initializer = &csapi.WorkspaceInitializer{
6365
Spec: &csapi.WorkspaceInitializer_Git{
6466
Git: &csapi.GitInitializer{
6567
RemoteUri: test.ContextURL,
66-
TargetMode: csapi.CloneTargetMode_REMOTE_BRANCH,
67-
CloneTaget: "main",
6868
CheckoutLocation: test.CheckoutLocation,
6969
Config: &csapi.GitConfig{},
7070
},
@@ -209,13 +209,13 @@ func TestExistingWorkspaceEnablePVC(t *testing.T) {
209209
})
210210

211211
// Create a new workspace without the PVC feature flag
212+
// TODO: change to use server API to launch the workspace, so we could run the integration test as the user code flow
213+
// which is client -> server -> ws-manager rather than client -> ws-manager directly
212214
ws1, stopWs1, err := integration.LaunchWorkspaceDirectly(t, ctx, api, integration.WithRequestModifier(func(w *wsmanapi.StartWorkspaceRequest) error {
213215
w.Spec.Initializer = &csapi.WorkspaceInitializer{
214216
Spec: &csapi.WorkspaceInitializer_Git{
215217
Git: &csapi.GitInitializer{
216218
RemoteUri: test.ContextURL,
217-
TargetMode: csapi.CloneTargetMode_REMOTE_BRANCH,
218-
CloneTaget: "main",
219219
CheckoutLocation: test.CheckoutLocation,
220220
Config: &csapi.GitConfig{},
221221
},

test/tests/components/ws-manager/prebuild_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ func TestPrebuildWorkspaceTaskSuccess(t *testing.T) {
6666
api.Done(t)
6767
})
6868

69+
// TODO: change to use server API to launch the workspace, so we could run the integration test as the user code flow
70+
// which is client -> server -> ws-manager rather than client -> ws-manager directly
6971
_, stopWs, err := integration.LaunchWorkspaceDirectly(t, ctx, api, integration.WithRequestModifier(func(req *wsmanapi.StartWorkspaceRequest) error {
7072
req.Type = wsmanapi.WorkspaceType_PREBUILD
7173

@@ -83,8 +85,6 @@ func TestPrebuildWorkspaceTaskSuccess(t *testing.T) {
8385
Spec: &csapi.WorkspaceInitializer_Git{
8486
Git: &csapi.GitInitializer{
8587
RemoteUri: test.ContextURL,
86-
TargetMode: csapi.CloneTargetMode_REMOTE_BRANCH,
87-
CloneTaget: "main",
8888
CheckoutLocation: test.CheckoutLocation,
8989
Config: &csapi.GitConfig{},
9090
},
@@ -233,6 +233,8 @@ func TestOpenWorkspaceFromPrebuild(t *testing.T) {
233233
})
234234

235235
// create a prebuild and stop workspace
236+
// TODO: change to use server API to launch the workspace, so we could run the integration test as the user code flow
237+
// which is client -> server -> ws-manager rather than client -> ws-manager directly
236238
_, prebuildStopWs, err := integration.LaunchWorkspaceDirectly(t, ctx, api, integration.WithRequestModifier(func(req *wsmanapi.StartWorkspaceRequest) error {
237239
req.Type = wsmanapi.WorkspaceType_PREBUILD
238240
req.Spec.Envvars = append(req.Spec.Envvars, &wsmanapi.EnvironmentVariable{
@@ -244,8 +246,6 @@ func TestOpenWorkspaceFromPrebuild(t *testing.T) {
244246
Spec: &csapi.WorkspaceInitializer_Git{
245247
Git: &csapi.GitInitializer{
246248
RemoteUri: test.ContextURL,
247-
TargetMode: csapi.CloneTargetMode_REMOTE_BRANCH,
248-
CloneTaget: "main",
249249
CheckoutLocation: test.CheckoutLocation,
250250
Config: &csapi.GitConfig{},
251251
},
@@ -265,6 +265,8 @@ func TestOpenWorkspaceFromPrebuild(t *testing.T) {
265265
t.Logf("prebuild snapshot: %s, vsName: %s, vsHandle: %s", prebuildSnapshot, vsInfo.VolumeSnapshotName, vsInfo.VolumeSnapshotHandle)
266266

267267
// launch the workspace from prebuild
268+
// TODO: change to use server API to launch the workspace, so we could run the integration test as the user code flow
269+
// which is client -> server -> ws-manager rather than client -> ws-manager directly
268270
ws, stopWs, err := integration.LaunchWorkspaceDirectly(t, ctx, api, integration.WithRequestModifier(func(req *wsmanapi.StartWorkspaceRequest) error {
269271
req.Spec.FeatureFlags = test.FF
270272
req.Spec.Initializer = &csapi.WorkspaceInitializer{
@@ -277,8 +279,6 @@ func TestOpenWorkspaceFromPrebuild(t *testing.T) {
277279
Git: []*csapi.GitInitializer{
278280
{
279281
RemoteUri: test.ContextURL,
280-
TargetMode: csapi.CloneTargetMode_REMOTE_BRANCH,
281-
CloneTaget: "main",
282282
CheckoutLocation: test.CheckoutLocation,
283283
Config: &csapi.GitConfig{},
284284
},

test/tests/components/ws-manager/tasks_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,6 @@ func TestRegularWorkspaceTasks(t *testing.T) {
8080
Spec: &csapi.WorkspaceInitializer_Git{
8181
Git: &csapi.GitInitializer{
8282
RemoteUri: testRepo,
83-
TargetMode: csapi.CloneTargetMode_REMOTE_BRANCH,
84-
CloneTaget: "main",
8583
CheckoutLocation: testRepoName,
8684
Config: &csapi.GitConfig{},
8785
},
@@ -91,6 +89,8 @@ func TestRegularWorkspaceTasks(t *testing.T) {
9189
return nil
9290
}
9391

92+
// TODO: change to use server API to launch the workspace, so we could run the integration test as the user code flow
93+
// which is client -> server -> ws-manager rather than client -> ws-manager directly
9494
nfo, stopWs, err := integration.LaunchWorkspaceDirectly(t, ctx, api, integration.WithRequestModifier(addInitTask))
9595
if err != nil {
9696
t.Fatal(err)

0 commit comments

Comments
 (0)