diff --git a/actions/go.mod b/actions/go.mod index 83c4babac..58ad994aa 100644 --- a/actions/go.mod +++ b/actions/go.mod @@ -17,8 +17,6 @@ replace ( go.opentelemetry.io/otel/sdk => go.opentelemetry.io/otel/sdk v1.28.0 go.opentelemetry.io/otel/trace => go.opentelemetry.io/otel/trace v1.28.0 go.opentelemetry.io/proto/otlp => go.opentelemetry.io/proto/otlp v1.3.1 - go.qase.io/client => github.com/rancher/qase-go/client v0.0.0-20250627195016-142ff3dfec16 - go.qase.io/qase-api-client => github.com/qase-tms/qase-go/qase-api-client v1.2.0 helm.sh/helm/v3 => github.com/rancher/helm/v3 v3.16.1-rancher1 k8s.io/api => k8s.io/api v0.34.1 @@ -58,6 +56,7 @@ replace ( ) require ( + github.com/qase-tms/qase-go/qase-api-client v1.2.0 github.com/rancher/rancher/pkg/apis v0.0.0 github.com/rancher/shepherd v0.0.0-20251203195144-c9f6483abe67 github.com/rancher/tfp-automation v0.0.0-20251219210947-f4a1a9882c29 @@ -196,7 +195,6 @@ require ( go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/otel v1.38.0 // indirect go.opentelemetry.io/otel/trace v1.38.0 // indirect - go.qase.io/qase-api-client v0.0.0-00010101000000-000000000000 go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect go.yaml.in/yaml/v2 v2.4.2 // indirect diff --git a/actions/provisioning/qase.go b/actions/provisioning/qase.go index e642c83ff..c751ec80f 100644 --- a/actions/provisioning/qase.go +++ b/actions/provisioning/qase.go @@ -3,6 +3,7 @@ package provisioning import ( "strings" + upstream "github.com/qase-tms/qase-go/qase-api-client" rancherEc2 "github.com/rancher/shepherd/clients/ec2" "github.com/rancher/shepherd/clients/rancher" "github.com/rancher/shepherd/extensions/cloudcredentials" @@ -12,7 +13,6 @@ import ( "github.com/rancher/tests/actions/machinepools" "github.com/rancher/tfp-automation/config" "github.com/sirupsen/logrus" - upstream "go.qase.io/qase-api-client" ) // GetProvisioningSchemaParams gets a set of params from the cattle config and returns a qase params object diff --git a/actions/qase/qase.go b/actions/qase/qase.go index 7265ab4f7..1fd7928b8 100644 --- a/actions/qase/qase.go +++ b/actions/qase/qase.go @@ -7,8 +7,8 @@ import ( "os" "strings" + upstream "github.com/qase-tms/qase-go/qase-api-client" "github.com/sirupsen/logrus" - upstream "go.qase.io/qase-api-client" ) type TestSuiteSchema struct { diff --git a/actions/qase/schema.go b/actions/qase/schema.go index b8421f85d..9880363a1 100644 --- a/actions/qase/schema.go +++ b/actions/qase/schema.go @@ -9,8 +9,8 @@ import ( "strconv" "strings" + upstream "github.com/qase-tms/qase-go/qase-api-client" "github.com/sirupsen/logrus" - upstream "go.qase.io/qase-api-client" "gopkg.in/yaml.v2" ) diff --git a/go.mod b/go.mod index 6e877ab13..66711bf92 100644 --- a/go.mod +++ b/go.mod @@ -22,8 +22,6 @@ replace ( go.opentelemetry.io/otel/sdk => go.opentelemetry.io/otel/sdk v1.28.0 go.opentelemetry.io/otel/trace => go.opentelemetry.io/otel/trace v1.28.0 go.opentelemetry.io/proto/otlp => go.opentelemetry.io/proto/otlp v1.3.1 - go.qase.io/client => github.com/rancher/qase-go/client v0.0.0-20250627195016-142ff3dfec16 - go.qase.io/qase-api-client => github.com/qase-tms/qase-go/qase-api-client v1.2.0 helm.sh/helm/v3 => github.com/rancher/helm/v3 v3.16.1-rancher1 k8s.io/api => k8s.io/api v0.34.1 @@ -62,21 +60,18 @@ replace ( sigs.k8s.io/cluster-api => sigs.k8s.io/cluster-api v1.8.3 ) -require ( - github.com/antihax/optional v1.0.0 - github.com/rancher/rancher/pkg/apis v0.0.0 - go.qase.io/client v0.0.0-20231114201952-65195ec001fa -) +require github.com/rancher/rancher/pkg/apis v0.0.0 require ( github.com/gruntwork-io/terratest v0.49.0 github.com/mattn/go-sqlite3 v1.14.28 + github.com/qase-tms/qase-go/pkg/qase-go v1.0.7 + github.com/qase-tms/qase-go/qase-api-client v1.2.1 github.com/rancher/rancher v0.0.0-20251203234820-b95b2fb0d738 github.com/rancher/shepherd v0.0.0-20251203195144-c9f6483abe67 github.com/rancher/tests/actions v0.0.0-20251111162746-32a475483166 github.com/rancher/tests/interoperability v0.0.0-00010101000000-000000000000 github.com/rancher/tfp-automation v0.0.0-20251219210947-f4a1a9882c29 - go.qase.io/qase-api-client v0.0.0-00010101000000-000000000000 ) require ( @@ -183,6 +178,7 @@ require ( github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/moby/sys/user v0.3.0 // indirect github.com/openshift/custom-resource-status v1.1.2 // indirect + github.com/qase-tms/qase-go/qase-api-v2-client v1.1.4 // indirect github.com/rancher/ali-operator v1.13.0-rc.2 // indirect github.com/tmccombs/hcl2json v0.6.4 // indirect github.com/ulikunitz/xz v0.5.10 // indirect diff --git a/go.sum b/go.sum index cdf64601b..6319d6bb9 100644 --- a/go.sum +++ b/go.sum @@ -1379,7 +1379,6 @@ github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk5 github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= -github.com/antihax/optional v1.0.0 h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwcg= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df/go.mod h1:pSwJ0fSY5KhvocuWSx4fz3BA8OrA1bQn+K1Eli3BRwM= github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230512164433-5d1fd1a340c9/go.mod h1:pSwJ0fSY5KhvocuWSx4fz3BA8OrA1bQn+K1Eli3BRwM= @@ -2156,8 +2155,12 @@ github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3c github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/prometheus/procfs v0.17.0 h1:FuLQ+05u4ZI+SS/w9+BWEM2TXiHKsUQ9TADiRH7DuK0= github.com/prometheus/procfs v0.17.0/go.mod h1:oPQLaDAMRbA+u8H5Pbfq+dl3VDAvHxMUOVhe0wYB2zw= -github.com/qase-tms/qase-go/qase-api-client v1.2.0 h1:wAOA90XpkbvW3ewPU2jQK/n717HUw84uDQN+GlxhSZ0= -github.com/qase-tms/qase-go/qase-api-client v1.2.0/go.mod h1:Za2AZQxuqkyc09vqHSlnceLjc40zFAAXMwhPPAMptMo= +github.com/qase-tms/qase-go/pkg/qase-go v1.0.7 h1:WBWnLTn6XSxD5JcPiIAw6nmcjLM7kS5EwgJuoPQ7qnk= +github.com/qase-tms/qase-go/pkg/qase-go v1.0.7/go.mod h1:I9AU24ez6V5DWMTrQQLuemW7FTK0Mrqlj98ewG6TINY= +github.com/qase-tms/qase-go/qase-api-client v1.2.1 h1:UHXJx8iwvsQKISOpkkMCvjpiEVQfnj6f+zPLthfLyLA= +github.com/qase-tms/qase-go/qase-api-client v1.2.1/go.mod h1:Za2AZQxuqkyc09vqHSlnceLjc40zFAAXMwhPPAMptMo= +github.com/qase-tms/qase-go/qase-api-v2-client v1.1.4 h1:Hrs9oGO/YaQGxea8GUnuXHNru0nsf8w9MKB6ruW8x00= +github.com/qase-tms/qase-go/qase-api-v2-client v1.1.4/go.mod h1:qyIUXyT9ein6Ii2+IUW3R0eXWAJzVj44II05RRMR+wg= github.com/rancher/aks-operator v1.13.0-rc.4 h1:tc7p2gZmRg4c6VBwWTQJYwmh1hlN68kftjoBIdGCnqw= github.com/rancher/aks-operator v1.13.0-rc.4/go.mod h1:1ZjZB6zGHK+NGchN9KLplq+xPxRRi+q6Uzet5bjFwxo= github.com/rancher/ali-operator v1.13.0-rc.2 h1:a0biHGez+Np9XybJVh3yKN4RGPdaCzfM6D6cAXJac6o= @@ -2179,8 +2182,6 @@ github.com/rancher/lasso v0.2.5 h1:K++lWDDdfeN98Ixc1kCfUq0/q6tLjoHN++Np6QntXw0= github.com/rancher/lasso v0.2.5/go.mod h1:71rWfv+KkdSmSxZ9Ly5QYhxAu0nEUcaq9N2ByjcHqAM= github.com/rancher/norman v0.8.0 h1://ZSe+B53cMgPNAbR7QBhzvIfWBxR4KaPWTKqG+g+O4= github.com/rancher/norman v0.8.0/go.mod h1:vZ5qL+eKodJ7zOMQYdl6jwMrSFrqTKpA+KYSFEKew2M= -github.com/rancher/qase-go/client v0.0.0-20250627195016-142ff3dfec16 h1:FGbrfQuYsF94Ov+BDTGrIKOB73f93DDLlfI0nKjuPOk= -github.com/rancher/qase-go/client v0.0.0-20250627195016-142ff3dfec16/go.mod h1:NP3xboG+t2p+XMnrcrJ/L384Ki0Cp3Pww/X+vm5Jcy0= github.com/rancher/rancher v0.0.0-20251203234820-b95b2fb0d738 h1:qalvtaJ4WQzPu0lkJFSTh3L0TgIEU4h7Kni/lBdfAQw= github.com/rancher/rancher v0.0.0-20251203234820-b95b2fb0d738/go.mod h1:NnexTOmNU92x0L5QfbeyUH6RPw87y7WHuLbAeDre9W8= github.com/rancher/rancher/pkg/apis v0.0.0-20251111120454-f829d8f1dc83 h1:5wbUhQaEesGsigLFNbXRJyACuGy2UNWMXVmBfDynk7M= @@ -2595,7 +2596,6 @@ golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20211005180243-6b3c2da341f1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= diff --git a/interoperability/go.mod b/interoperability/go.mod index 3b4655d3f..fdfd13c08 100644 --- a/interoperability/go.mod +++ b/interoperability/go.mod @@ -20,7 +20,6 @@ replace ( go.opentelemetry.io/otel/sdk => go.opentelemetry.io/otel/sdk v1.28.0 go.opentelemetry.io/otel/trace => go.opentelemetry.io/otel/trace v1.28.0 go.opentelemetry.io/proto/otlp => go.opentelemetry.io/proto/otlp v1.3.1 - go.qase.io/client => github.com/rancher/qase-go/client v0.0.0-20231114201952-65195ec001fa helm.sh/helm/v3 => github.com/rancher/helm/v3 v3.16.1-rancher1 k8s.io/api => k8s.io/api v0.34.1 k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.34.1 diff --git a/validation/pipeline/qase/reporter-v2/main.go b/validation/pipeline/qase/reporter-v2/main.go index aabce2de4..c1d127e54 100644 --- a/validation/pipeline/qase/reporter-v2/main.go +++ b/validation/pipeline/qase/reporter-v2/main.go @@ -12,11 +12,11 @@ import ( "strconv" "strings" + upstream "github.com/qase-tms/qase-go/qase-api-client" "github.com/rancher/tests/actions/qase" qaseactions "github.com/rancher/tests/actions/qase" "github.com/rancher/tests/actions/qase/testresult" "github.com/sirupsen/logrus" - upstream "go.qase.io/qase-api-client" "gopkg.in/yaml.v2" ) diff --git a/validation/pipeline/qase/reporter/main.go b/validation/pipeline/qase/reporter/main.go index b6baa24e2..3cd3a7e5f 100644 --- a/validation/pipeline/qase/reporter/main.go +++ b/validation/pipeline/qase/reporter/main.go @@ -10,13 +10,13 @@ import ( "strconv" "strings" - "github.com/antihax/optional" + "github.com/qase-tms/qase-go/pkg/qase-go/clients" + api_v1_client "github.com/qase-tms/qase-go/qase-api-client" "github.com/rancher/shepherd/extensions/defaults" qaseactions "github.com/rancher/tests/actions/qase" "github.com/rancher/tests/actions/qase/testresult" "github.com/rancher/tests/validation/pipeline/slack" "github.com/sirupsen/logrus" - qase "go.qase.io/client" yaml "gopkg.in/yaml.v2" "k8s.io/apimachinery/pkg/util/wait" ) @@ -43,9 +43,13 @@ var ( func main() { if runIDEnvVar != "" { - cfg := qase.NewConfiguration() - cfg.AddDefaultHeader("Token", qaseToken) - client := qase.NewAPIClient(cfg) + cfg := clients.ClientConfig{ + APIToken: qaseToken, + } + client, err := clients.NewV1Client(cfg) + if err != nil { + logrus.Fatalf("error creating Qase client: %v", err) + } runID, err := strconv.ParseInt(runIDEnvVar, 10, 64) if err != nil { @@ -79,23 +83,23 @@ func main() { } } -func getAllAutomationTestCases(client *qase.APIClient) (map[string]qase.TestCase, error) { - testCases := []qase.TestCase{} - testCaseNameMap := map[string]qase.TestCase{} +func getAllAutomationTestCases(client *clients.V1Client) (map[string]api_v1_client.TestCase, error) { + testCases := []api_v1_client.TestCase{} + testCaseNameMap := map[string]api_v1_client.TestCase{} + authCtx := context.WithValue(context.TODO(), api_v1_client.ContextAPIKeys, map[string]api_v1_client.APIKey{ + "TokenAuth": {Key: qaseToken}, + }) var numOfTestsCases int32 = 1 offSetCount := 0 for numOfTestsCases > 0 { - offset := optional.NewInt32(int32(offSetCount)) - localVarOptionals := &qase.CasesApiGetCasesOpts{ - Offset: offset, - } - tempResult, _, err := client.CasesApi.GetCases(context.TODO(), qaseactions.RancherManagerProjectID, localVarOptionals) + offset := int32(offSetCount) + tempResult, _, err := client.GetAPIClient().CasesAPI.GetCases(authCtx, qaseactions.RancherManagerProjectID).Offset(offset).Execute() if err != nil { return nil, err } testCases = append(testCases, tempResult.Result.Entities...) - numOfTestsCases = tempResult.Result.Count + numOfTestsCases = *tempResult.Result.Count offSetCount += 10 } @@ -104,7 +108,7 @@ func getAllAutomationTestCases(client *qase.APIClient) (map[string]qase.TestCase if automationTestNameCustomField != "" { testCaseNameMap[automationTestNameCustomField] = testCase } else { - testCaseNameMap[testCase.Title] = testCase + testCaseNameMap[*testCase.Title] = testCase } } @@ -178,7 +182,7 @@ func parseCorrectTestCases(testCases []testresult.GoTestOutput) map[string]*test return finalTestCases } -func reportTestQases(client *qase.APIClient, testRunID int64) (int, error) { +func reportTestQases(client *clients.V1Client, testRunID int64) (int, error) { tempTestCases, err := readTestCase() if err != nil { return 0, err @@ -195,7 +199,7 @@ func reportTestQases(client *qase.APIClient, testRunID int64) (int, error) { for _, goTestResult := range goTestResults { if testQase, ok := qaseTestCases[goTestResult.Name]; ok { // update test status - httpCode, err := updateTestInRun(client, *goTestResult, testQase.Id, testRunID) + httpCode, err := updateTestInRun(client, *goTestResult, *testQase.Id, testRunID) if err != nil { return httpCode, err } @@ -210,7 +214,7 @@ func reportTestQases(client *qase.APIClient, testRunID int64) (int, error) { return 0, err } - httpCode, err := updateTestInRun(client, *goTestResult, caseID.Result.Id, testRunID) + httpCode, err := updateTestInRun(client, *goTestResult, *caseID.Result.Id, testRunID) if err != nil { return httpCode, err } @@ -220,7 +224,7 @@ func reportTestQases(client *qase.APIClient, testRunID int64) (int, error) { } } } - resp, httpResponse, err := client.RunsApi.GetRun(context.TODO(), qaseactions.RancherManagerProjectID, int32(testRunID)) + resp, httpResponse, err := client.GetAPIClient().RunsAPI.GetRun(context.TODO(), qaseactions.RancherManagerProjectID, int32(testRunID)).Execute() if err != nil { var statusCode int if httpResponse != nil { @@ -228,76 +232,73 @@ func reportTestQases(client *qase.APIClient, testRunID int64) (int, error) { } return statusCode, fmt.Errorf("error getting test run: %v", err) } - if strings.Contains(resp.Result.Title, "-head") { - return 0, slack.PostSlackMessage(resultTestMap, testRunID, resp.Result.Title) + if strings.Contains(*resp.Result.Title, "-head") { + return 0, slack.PostSlackMessage(resultTestMap, testRunID, *resp.Result.Title) } return http.StatusOK, nil } -func writeTestSuiteToQase(client *qase.APIClient, testResult testresult.GoTestResult) (*int64, error) { +func writeTestSuiteToQase(client *clients.V1Client, testResult testresult.GoTestResult) (*int64, error) { parentSuite := int64(automationSuiteID) var id int64 for _, suiteGo := range testResult.TestSuite { - localVarOptionals := &qase.SuitesApiGetSuitesOpts{ - FiltersSearch: optional.NewString(suiteGo), - } - - qaseSuites, _, err := client.SuitesApi.GetSuites(context.TODO(), qaseactions.RancherManagerProjectID, localVarOptionals) + qaseSuites, _, err := client.GetAPIClient().SuitesAPI.GetSuites(context.TODO(), qaseactions.RancherManagerProjectID).Search(suiteGo).Execute() if err != nil { return nil, err } var testSuiteWasFound bool - var qaseSuiteFound qase.Suite + var qaseSuiteFound api_v1_client.Suite for _, qaseSuite := range qaseSuites.Result.Entities { - if qaseSuite.Title == suiteGo { + if *qaseSuite.Title == suiteGo { testSuiteWasFound = true qaseSuiteFound = qaseSuite } } if !testSuiteWasFound { - suiteBody := qase.SuiteCreate{ + suiteBody := api_v1_client.SuiteCreate{ Title: suiteGo, - ParentId: int64(parentSuite), + ParentId: *api_v1_client.NewNullableInt64(&parentSuite), } - idResponse, _, err := client.SuitesApi.CreateSuite(context.TODO(), suiteBody, qaseactions.RancherManagerProjectID) + idResponse, _, err := client.GetAPIClient().SuitesAPI.CreateSuite(context.TODO(), qaseactions.RancherManagerProjectID).SuiteCreate(suiteBody).Execute() if err != nil { return nil, err } - id = idResponse.Result.Id + id = *idResponse.Result.Id parentSuite = id } else { - id = qaseSuiteFound.Id + id = *qaseSuiteFound.Id } } return &id, nil } -func writeTestCaseToQase(client *qase.APIClient, testResult testresult.GoTestResult) (*qase.IdResponse, error) { +func writeTestCaseToQase(client *clients.V1Client, testResult testresult.GoTestResult) (*api_v1_client.IdResponse, error) { testSuiteID, err := writeTestSuiteToQase(client, testResult) if err != nil { return nil, err } - - testQaseBody := qase.TestCaseCreate{ + var zero int32 = 0 + var two int32 = 2 + testQaseBody := api_v1_client.TestCaseCreate{ Title: testResult.Name, - SuiteId: *testSuiteID, - IsFlaky: int32(0), - Automation: int32(2), - CustomField: map[string]string{ + SuiteId: testSuiteID, + IsFlaky: &zero, + Automation: &two, + CustomField: &map[string]string{ fmt.Sprintf("%d", testSourceID): testSource, }, } - caseID, _, err := client.CasesApi.CreateCase(context.TODO(), testQaseBody, qaseactions.RancherManagerProjectID) + caseID, _, err := client.GetAPIClient().CasesAPI.CreateCase(context.TODO(), qaseactions.RancherManagerProjectID).TestCaseCreate(testQaseBody).Execute() if err != nil { return nil, err } - return &caseID, err + return caseID, err } -func updateTestInRun(client *qase.APIClient, testResult testresult.GoTestResult, qaseTestCaseID, testRunID int64) (int, error) { +func updateTestInRun(client *clients.V1Client, testResult testresult.GoTestResult, qaseTestCaseID, testRunID int64) (int, error) { status := fmt.Sprintf("%sed", testResult.Status) var elapsedTime float64 if testResult.Elapsed != "" { @@ -308,14 +309,14 @@ func updateTestInRun(client *qase.APIClient, testResult testresult.GoTestResult, } } - resultBody := qase.ResultCreate{ - CaseId: qaseTestCaseID, + resultBody := api_v1_client.ResultCreate{ + CaseId: &qaseTestCaseID, Status: status, - Comment: testResult.StackTrace, - Time: int64(elapsedTime), + Comment: *api_v1_client.NewNullableString(&testResult.StackTrace), + Time: *api_v1_client.NewNullableInt64(api_v1_client.PtrInt64(int64(elapsedTime))), } - _, resp, err := client.ResultsApi.CreateResult(context.TODO(), resultBody, qaseactions.RancherManagerProjectID, testRunID) + _, resp, err := client.GetAPIClient().ResultsAPI.CreateResult(context.TODO(), qaseactions.RancherManagerProjectID, int32(testRunID)).ResultCreate(resultBody).Execute() if err != nil { if resp != nil { return resp.StatusCode, err @@ -326,10 +327,10 @@ func updateTestInRun(client *qase.APIClient, testResult testresult.GoTestResult, return http.StatusOK, nil } -func getAutomationTestName(customFields []qase.CustomFieldValue) string { +func getAutomationTestName(customFields []api_v1_client.CustomFieldValue) string { for _, field := range customFields { - if field.Id == automationTestNameID { - return field.Value + if *field.Id == automationTestNameID { + return *field.Value } } return "" diff --git a/validation/upgrade/dualstack/kubernetes_test.go b/validation/upgrade/dualstack/kubernetes_test.go index 5f547483a..450886072 100644 --- a/validation/upgrade/dualstack/kubernetes_test.go +++ b/validation/upgrade/dualstack/kubernetes_test.go @@ -6,6 +6,7 @@ import ( "os" "testing" + upstream "github.com/qase-tms/qase-go/qase-api-client" provv1 "github.com/rancher/rancher/pkg/apis/provisioning.cattle.io/v1" "github.com/rancher/shepherd/clients/rancher" v1 "github.com/rancher/shepherd/clients/rancher/v1" @@ -26,7 +27,6 @@ import ( "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" - upstream "go.qase.io/qase-api-client" ) type UpgradeDualstackKubernetesTestSuite struct { diff --git a/validation/upgrade/ipv6/kubernetes_test.go b/validation/upgrade/ipv6/kubernetes_test.go index 6c7985324..3f7e8f890 100644 --- a/validation/upgrade/ipv6/kubernetes_test.go +++ b/validation/upgrade/ipv6/kubernetes_test.go @@ -6,6 +6,7 @@ import ( "os" "testing" + upstream "github.com/qase-tms/qase-go/qase-api-client" provv1 "github.com/rancher/rancher/pkg/apis/provisioning.cattle.io/v1" "github.com/rancher/shepherd/clients/rancher" v1 "github.com/rancher/shepherd/clients/rancher/v1" @@ -26,7 +27,6 @@ import ( "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" - upstream "go.qase.io/qase-api-client" ) type UpgradeIPv6KubernetesTestSuite struct { diff --git a/validation/upgrade/local/kubernetes_test.go b/validation/upgrade/local/kubernetes_test.go index 2886c3a37..220e98b2d 100644 --- a/validation/upgrade/local/kubernetes_test.go +++ b/validation/upgrade/local/kubernetes_test.go @@ -5,6 +5,7 @@ package upgrade import ( "testing" + upstream "github.com/qase-tms/qase-go/qase-api-client" "github.com/rancher/shepherd/clients/rancher" extensionscluster "github.com/rancher/shepherd/extensions/clusters" "github.com/rancher/shepherd/pkg/session" @@ -15,7 +16,6 @@ import ( "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" - upstream "go.qase.io/qase-api-client" ) type UpgradeKubernetesTestSuite struct { diff --git a/validation/upgrade/rke1/kubernetes_test.go b/validation/upgrade/rke1/kubernetes_test.go index 452c60bb8..433a6f3a5 100644 --- a/validation/upgrade/rke1/kubernetes_test.go +++ b/validation/upgrade/rke1/kubernetes_test.go @@ -5,6 +5,7 @@ package rke1 import ( "testing" + upstream "github.com/qase-tms/qase-go/qase-api-client" "github.com/rancher/shepherd/clients/rancher" extClusters "github.com/rancher/shepherd/extensions/clusters" "github.com/rancher/shepherd/extensions/clusters/kubernetesversions" @@ -19,7 +20,6 @@ import ( "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" - upstream "go.qase.io/qase-api-client" ) type UpgradeRKE1KubernetesTestSuite struct { diff --git a/validation/upgrade/rke2k3s/kubernetes_test.go b/validation/upgrade/rke2k3s/kubernetes_test.go index d8517c711..311af7ce6 100644 --- a/validation/upgrade/rke2k3s/kubernetes_test.go +++ b/validation/upgrade/rke2k3s/kubernetes_test.go @@ -6,6 +6,7 @@ import ( "os" "testing" + upstream "github.com/qase-tms/qase-go/qase-api-client" provv1 "github.com/rancher/rancher/pkg/apis/provisioning.cattle.io/v1" "github.com/rancher/shepherd/clients/rancher" v1 "github.com/rancher/shepherd/clients/rancher/v1" @@ -26,7 +27,6 @@ import ( "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" - upstream "go.qase.io/qase-api-client" ) type UpgradeKubernetesTestSuite struct { diff --git a/validation/upgrade/rke2k3s/kubernetes_wins_test.go b/validation/upgrade/rke2k3s/kubernetes_wins_test.go index 2582e5ae3..fed54d7ed 100644 --- a/validation/upgrade/rke2k3s/kubernetes_wins_test.go +++ b/validation/upgrade/rke2k3s/kubernetes_wins_test.go @@ -6,6 +6,7 @@ import ( "os" "testing" + upstream "github.com/qase-tms/qase-go/qase-api-client" provv1 "github.com/rancher/rancher/pkg/apis/provisioning.cattle.io/v1" "github.com/rancher/shepherd/clients/ec2" "github.com/rancher/shepherd/clients/rancher" @@ -29,7 +30,6 @@ import ( "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" - upstream "go.qase.io/qase-api-client" ) type UpgradeWindowsKubernetesTestSuite struct {