11package clients
22
33import (
4+ "context"
45 "fmt"
56 "io"
67 "net/http"
@@ -24,23 +25,25 @@ func TestSTACKITCLIFlow_Init(t *testing.T) {
2425 }
2526 for _ , tt := range tests {
2627 t .Run (tt .name , func (t * testing.T ) {
28+ ctx := context .TODO ()
29+
2730 c := & STACKITCLIFlow {}
2831
29- _ , _ = runSTACKITCLICommand (t . Context () , "stackit config profile delete test-stackit-cli-flow-init -y" )
30- _ , err := runSTACKITCLICommand (t . Context () , "stackit config profile create test-stackit-cli-flow-init" )
32+ _ , _ = runSTACKITCLICommand (ctx , "stackit config profile delete test-stackit-cli-flow-init -y" )
33+ _ , err := runSTACKITCLICommand (ctx , "stackit config profile create test-stackit-cli-flow-init" )
3134 if err != nil {
3235 t .Errorf ("runSTACKITCLICommand() error = %v" , err )
3336 return
3437 }
3538
36- _ , err = runSTACKITCLICommand (t . Context () , "stackit auth activate-service-account --service-account-token=" + testServiceAccountToken )
39+ _ , err = runSTACKITCLICommand (ctx , "stackit auth activate-service-account --service-account-token=" + testServiceAccountToken )
3740 if err != nil {
3841 t .Errorf ("runSTACKITCLICommand() error = %v" , err )
3942 return
4043 }
4144
4245 defer func () {
43- _ , _ = runSTACKITCLICommand (t . Context () , "stackit config profile delete test-stackit-cli-flow-init -y" )
46+ _ , _ = runSTACKITCLICommand (ctx , "stackit config profile delete test-stackit-cli-flow-init -y" )
4447 }()
4548
4649 if err := c .Init (tt .args .cfg ); (err != nil ) != tt .wantErr {
@@ -70,21 +73,23 @@ func TestSTACKITCLIFlow_Do(t *testing.T) {
7073 }
7174 for _ , tt := range tests {
7275 t .Run (tt .name , func (t * testing.T ) {
73- _ , _ = runSTACKITCLICommand (t .Context (), "stackit config profile delete test-stackit-cli-flow-do -y" )
74- _ , err := runSTACKITCLICommand (t .Context (), "stackit config profile create test-stackit-cli-flow-do" )
76+ ctx := context .TODO ()
77+
78+ _ , _ = runSTACKITCLICommand (ctx , "stackit config profile delete test-stackit-cli-flow-do -y" )
79+ _ , err := runSTACKITCLICommand (ctx , "stackit config profile create test-stackit-cli-flow-do" )
7580 if err != nil {
7681 t .Errorf ("runSTACKITCLICommand() error = %v" , err )
7782 return
7883 }
7984
80- _ , err = runSTACKITCLICommand (t . Context () , "stackit auth activate-service-account --service-account-token=" + testServiceAccountToken )
85+ _ , err = runSTACKITCLICommand (ctx , "stackit auth activate-service-account --service-account-token=" + testServiceAccountToken )
8186 if err != nil {
8287 t .Errorf ("runSTACKITCLICommand() error = %v" , err )
8388 return
8489 }
8590
8691 defer func () {
87- _ , _ = runSTACKITCLICommand (t . Context () , "stackit config profile delete test-stackit-cli-flow-do -y" )
92+ _ , _ = runSTACKITCLICommand (ctx , "stackit config profile delete test-stackit-cli-flow-do -y" )
8893 }()
8994
9095 c := & STACKITCLIFlow {}
0 commit comments