Commit 1148ce1c authored by Sonja Happ's avatar Sonja Happ
Browse files

add results from test data in test mode

parent 28434668
......@@ -207,7 +207,7 @@ func AddTestData(cfg *config.Config, router *gin.Engine) (*bytes.Buffer, error)
}
}
// If there is at least one scenario, add dashboards and 2 test files
// If there is at least one scenario, add dashboards, results, and 2 test files
dashboardCounter := 0
if len(GlobalTestData.Scenarios) > 0 {
for _, d := range GlobalTestData.Dashboards {
......@@ -219,6 +219,15 @@ func AddTestData(cfg *config.Config, router *gin.Engine) (*bytes.Buffer, error)
dashboardCounter++
}
for _, r := range GlobalTestData.Results {
r.ScenarioID = 1
r.ResultFileIDs = []int64{}
code, resp, err := helper.TestEndpoint(router, token, basePath+"/results", "POST", helper.KeyModels{"result": r})
if code != http.StatusOK {
return resp, fmt.Errorf("error adding Result %v: %v", r.Description, err)
}
}
// upload files
// upload readme file
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment