Skip to content

Commit 8bbd54f

Browse files
committed
test(backend): Rename ArtifactApiTest to ArtifactAPITest
Signed-off-by: Helber Belmiro <[email protected]>
1 parent 6d2a857 commit 8bbd54f

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

backend/test/integration/artifact_api_test.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import (
3838
"github.com/stretchr/testify/suite"
3939
)
4040

41-
type ArtifactApiTest struct {
41+
type ArtifactAPITest struct {
4242
suite.Suite
4343
namespace string
4444
resourceNamespace string
@@ -48,7 +48,7 @@ type ArtifactApiTest struct {
4848
runClient *api_server.RunClient
4949
}
5050

51-
func (s *ArtifactApiTest) SetupTest() {
51+
func (s *ArtifactAPITest) SetupTest() {
5252
if !*runIntegrationTests {
5353
s.T().SkipNow()
5454
return
@@ -83,21 +83,21 @@ func (s *ArtifactApiTest) SetupTest() {
8383
}
8484
}
8585

86-
func (s *ArtifactApiTest) TearDownSuite() {
86+
func (s *ArtifactAPITest) TearDownSuite() {
8787
if *runIntegrationTests {
8888
if !*isDevMode {
8989
s.cleanUp()
9090
}
9191
}
9292
}
9393

94-
func (s *ArtifactApiTest) cleanUp() {
94+
func (s *ArtifactAPITest) cleanUp() {
9595
test.DeleteAllExperiments(s.experimentClient, s.namespace, s.T())
9696
test.DeleteAllPipelines(s.pipelineClient, s.T())
9797
test.DeleteAllRuns(s.runClient, s.namespace, s.T())
9898
}
9999

100-
func (s *ArtifactApiTest) TestV1PipelineArtifactRead() {
100+
func (s *ArtifactAPITest) TestV1PipelineArtifactRead() {
101101
runID := s.runPipeline()
102102

103103
s.waitForRunCompletion(runID)
@@ -108,15 +108,15 @@ func (s *ArtifactApiTest) TestV1PipelineArtifactRead() {
108108
s.testReadArtifactEndpoint(runID, nodeID, artifactName)
109109
}
110110

111-
func (s *ArtifactApiTest) createExperiment() *experiment_model.APIExperiment {
111+
func (s *ArtifactAPITest) createExperiment() *experiment_model.APIExperiment {
112112
experimentName := fmt.Sprintf("artifact-test-experiment-%d", time.Now().Unix())
113113
experiment := test.GetExperiment(experimentName, "Test for artifact reading", s.namespace)
114114
experiment, err := s.experimentClient.Create(&params.ExperimentServiceCreateExperimentV1Params{Experiment: experiment})
115115
require.NoError(s.T(), err)
116116
return experiment
117117
}
118118

119-
func (s *ArtifactApiTest) uploadPipeline() *pipeline_upload_model.APIPipeline {
119+
func (s *ArtifactAPITest) uploadPipeline() *pipeline_upload_model.APIPipeline {
120120
pipelineParams := uploadParams.NewUploadPipelineParams()
121121
pipelineName := fmt.Sprintf("large-artifact-test-%d", time.Now().Unix())
122122
pipelineParams.SetName(&pipelineName)
@@ -125,7 +125,7 @@ func (s *ArtifactApiTest) uploadPipeline() *pipeline_upload_model.APIPipeline {
125125
return pipeline
126126
}
127127

128-
func (s *ArtifactApiTest) runPipeline() string {
128+
func (s *ArtifactAPITest) runPipeline() string {
129129
experiment := s.createExperiment()
130130
pipeline := s.uploadPipeline()
131131

@@ -149,7 +149,7 @@ func (s *ArtifactApiTest) runPipeline() string {
149149
return run.Run.ID
150150
}
151151

152-
func (s *ArtifactApiTest) waitForRunCompletion(runID string) {
152+
func (s *ArtifactAPITest) waitForRunCompletion(runID string) {
153153
t := s.T()
154154
maxWaitTime := 2 * time.Minute
155155
startTime := time.Now()
@@ -172,7 +172,7 @@ func (s *ArtifactApiTest) waitForRunCompletion(runID string) {
172172
require.Fail(t, "Run did not complete within %v", maxWaitTime)
173173
}
174174

175-
func (s *ArtifactApiTest) extractWorkflowNodeID(runID string) string {
175+
func (s *ArtifactAPITest) extractWorkflowNodeID(runID string) string {
176176
t := s.T()
177177

178178
resp, err := http.Get(fmt.Sprintf("http://localhost:8888/apis/v1beta1/runs/%s", runID))
@@ -193,7 +193,7 @@ func (s *ArtifactApiTest) extractWorkflowNodeID(runID string) string {
193193
return nodeID
194194
}
195195

196-
func (s *ArtifactApiTest) testReadArtifactEndpoint(runID, nodeID, artifactName string) {
196+
func (s *ArtifactAPITest) testReadArtifactEndpoint(runID, nodeID, artifactName string) {
197197
t := s.T()
198198

199199
baseURL := "http://localhost:8888"
@@ -233,7 +233,7 @@ func (s *ArtifactApiTest) testReadArtifactEndpoint(runID, nodeID, artifactName s
233233
t.Log("ReadArtifact endpoint validated successfully")
234234
}
235235

236-
func (s *ArtifactApiTest) validateResponseHeaders(resp *http.Response) {
236+
func (s *ArtifactAPITest) validateResponseHeaders(resp *http.Response) {
237237
t := s.T()
238238

239239
contentType := resp.Header.Get("Content-Type")
@@ -252,11 +252,11 @@ func (s *ArtifactApiTest) validateResponseHeaders(resp *http.Response) {
252252
}
253253
}
254254

255-
func (s *ArtifactApiTest) requireGzipCompressed(body []byte) {
255+
func (s *ArtifactAPITest) requireGzipCompressed(body []byte) {
256256
require.True(s.T(), len(body) > 2 && body[0] == 0x1f && body[1] == 0x8b,
257257
"Artifact should be gzip compressed")
258258
}
259259

260260
func TestArtifactAPI(t *testing.T) {
261-
suite.Run(t, new(ArtifactApiTest))
261+
suite.Run(t, new(ArtifactAPITest))
262262
}

0 commit comments

Comments
 (0)