Skip to content

Commit

Permalink
Use response struct for test unmarshalling
Browse files Browse the repository at this point in the history
  • Loading branch information
suprjinx committed Jul 15, 2023
1 parent 70ee18c commit c890b30
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
13 changes: 3 additions & 10 deletions pkg/api/aim/response/run.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
package response

import (
"time"

"github.com/gogo/protobuf/test/tags"
"github.com/google/flatbuffers/tests/namespace_test/NamespaceA"
)

// GetRunInfo represents the response struct for GetRunInfo endpoint
type GetRunInfo struct {
Params GetRunInfoParams `json:"params"`
Expand All @@ -30,10 +23,10 @@ type GetRunInfoProps struct {
Description string `json:"description"`
Experiment GetRunInfoExperiment `json:"experiment"`
Tags []string `json:"tags"`
StartTime time.Time `json:"creation_time"`
EndTime time.Time `json:"end_time"`
StartTime float64 `json:"creation_time"`
EndTime float64 `json:"end_time"`
Archived bool `json:"archived"`
Active bool `json:"archived"`
Active bool `json:"active"`
}

// GetRunInfoExperiment experiment properties
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/golang/aim/run/get_run_info_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/stretchr/testify/suite"

"github.com/G-Research/fasttrackml/pkg/api/mlflow/dao/models"
"github.com/G-Research/fasttrackml/pkg/api/aim/response"
"github.com/G-Research/fasttrackml/tests/integration/golang/fixtures"
"github.com/G-Research/fasttrackml/tests/integration/golang/helpers"
)
Expand Down Expand Up @@ -67,7 +68,7 @@ func (s *GetRunInfoTestSuite) Test_Ok() {
}
for _, tt := range tests {
s.T().Run(tt.name, func(T *testing.T) {
var resp response.GetRunInfoResponse
var resp response.GetRunInfo
err := s.client.DoGetRequest(
fmt.Sprintf("/runs/%s/info", tt.runID),
&resp,
Expand Down

0 comments on commit c890b30

Please sign in to comment.