@@ -175,7 +175,7 @@ func (s *taskQueueCommandTestSuite) TestForceUnloadTaskQueuePartition() {
175175// TestGetTaskQueueUserData tests that the cli accepts the various arguments for get-user-data.
176176func (s * taskQueueCommandTestSuite ) TestGetTaskQueueUserData () {
177177 baseCommand := []string {"tdbg" , "taskqueue" , "get-user-data" ,
178- "--task-queue" , "test" }
178+ "--namespace" , "default" , "-- task-queue" , "test" }
179179
180180 // Run shared test cases, skipping sticky-name (not a registered flag on this command).
181181 for _ , test := range testCases {
@@ -184,17 +184,22 @@ func (s *taskQueueCommandTestSuite) TestGetTaskQueueUserData() {
184184 }
185185 cliCommand := append (baseCommand , test .inputFlags ... )
186186 resp := s .app .Run (cliCommand )
187- if resp != nil {
187+ if test . err != nil {
188188 s .ErrorContainsf (resp , test .err .Error (), "error present" )
189+ } else {
190+ s .NoError (resp )
189191 }
190192 }
191193
192194 // Missing --task-queue is enforced by cli/v2 (Required: true) before the action runs.
193- s .Error (s .app .Run ([]string {"tdbg" , "taskqueue" , "get-user-data" }))
195+ s .Error (s .app .Run ([]string {"tdbg" , "taskqueue" , "get-user-data" , "--namespace" , "default" }))
196+
197+ // Missing --namespace is enforced by cli/v2 (Required: true) before the action runs.
198+ s .Error (s .app .Run ([]string {"tdbg" , "taskqueue" , "get-user-data" , "--task-queue" , "test" }))
194199
195200 // No --task-queue-type or --partition-id: both use their defaults and succeed.
196201 s .NoError (s .app .Run ([]string {"tdbg" , "taskqueue" , "get-user-data" ,
197- "--task-queue" , "test" }))
202+ "--namespace" , "default" , "-- task-queue" , "test" }))
198203
199204 // Matching client returns an error: CLI wraps and returns it.
200205 errorClient := & testClient {
@@ -205,6 +210,6 @@ func (s *taskQueueCommandTestSuite) TestGetTaskQueueUserData() {
205210 errorApp := NewCliApp (func (params * Params ) { params .ClientFactory = errorClient })
206211 errorApp .ExitErrHandler = func (context * cli.Context , err error ) {}
207212 resp := errorApp .Run ([]string {"tdbg" , "taskqueue" , "get-user-data" ,
208- "--task-queue" , "test" })
213+ "--namespace" , "default" , "-- task-queue" , "test" })
209214 s .ErrorContains (resp , "unable to get Task Queue User Data" )
210215}
0 commit comments