@@ -191,12 +191,12 @@ func TestGetJobOptions_NoExperimentsSet(t *testing.T) {
191191 if err != nil {
192192 t .Fatalf ("getJobOptions() returned error %q, want %q" , err , "nil" )
193193 }
194- if got , want := len (opts .Experiments ), 4 ; got != want {
194+ if got , want := len (opts .Experiments ), 5 ; got != want {
195195 t .Fatalf ("len(getJobOptions().Experiments) = %d, want %d" , got , want )
196196 }
197197 sort .Strings (opts .Experiments )
198- expectedExperiments := []string {"beam_fn_api" , "use_portable_job_submission" , "use_unified_worker" , "use_runner_v2" }
199- for i := 0 ; i < 2 ; i ++ {
198+ expectedExperiments := []string {"beam_fn_api" , "enable_portable_runner" , " use_portable_job_submission" , "use_unified_worker" , "use_runner_v2" }
199+ for i := 0 ; i < 5 ; i ++ {
200200 if got , want := opts .Experiments [i ], expectedExperiments [i ]; got != want {
201201 t .Errorf ("getJobOptions().Experiments[%d] = %q, want %q" , i , got , want )
202202 }
@@ -219,7 +219,7 @@ func TestGetJobOptions_NoExperimentsSetStreaming(t *testing.T) {
219219 t .Fatalf ("len(getJobOptions().Experiments) = %d, want %d" , got , want )
220220 }
221221 sort .Strings (opts .Experiments )
222- expectedExperiments := []string {"beam_fn_api" , "enable_streaming_engine" , "enable_windmill_service" , "use_portable_job_submission" , "use_unified_worker" , "use_runner_v2" }
222+ expectedExperiments := []string {"beam_fn_api" , "enable_portable_runner" , " enable_streaming_engine" , "enable_windmill_service" , "use_portable_job_submission" , "use_unified_worker" , "use_runner_v2" }
223223 for i := 0 ; i < 2 ; i ++ {
224224 if got , want := opts .Experiments [i ], expectedExperiments [i ]; got != want {
225225 t .Errorf ("getJobOptions().Experiments[%d] = %q, want %q" , i , got , want )
@@ -244,6 +244,40 @@ func TestGetJobOptions_DisableRunnerV2ExperimentsSet(t *testing.T) {
244244 }
245245}
246246
247+ func TestGetJobOptions_DisablePortableRunnerExperimentsSet (t * testing.T ) {
248+ resetGlobals ()
249+ * stagingLocation = "gs://testStagingLocation"
250+ * gcpopts .Project = "testProject"
251+ * gcpopts .Region = "testRegion"
252+ * jobopts .Experiments = "disable_portable_runner"
253+
254+ opts , err := getJobOptions (context .Background (), false )
255+
256+ if err == nil {
257+ t .Error ("getJobOptions() returned error nil, want an error" )
258+ }
259+ if opts != nil {
260+ t .Errorf ("getJobOptions() returned JobOptions when it should not have, got %#v, want nil" , opts )
261+ }
262+ }
263+
264+ func TestGetJobOptions_EnableStreamingJavaRunnerExperimentsSet (t * testing.T ) {
265+ resetGlobals ()
266+ * stagingLocation = "gs://testStagingLocation"
267+ * gcpopts .Project = "testProject"
268+ * gcpopts .Region = "testRegion"
269+ * jobopts .Experiments = "enable_streaming_java_runner"
270+
271+ opts , err := getJobOptions (context .Background (), false )
272+
273+ if err == nil {
274+ t .Error ("getJobOptions() returned error nil, want an error" )
275+ }
276+ if opts != nil {
277+ t .Errorf ("getJobOptions() returned JobOptions when it should not have, got %#v, want nil" , opts )
278+ }
279+ }
280+
247281func TestGetJobOptions_NoStagingLocation (t * testing.T ) {
248282 resetGlobals ()
249283 * stagingLocation = ""
0 commit comments