@@ -7,11 +7,12 @@ import (
77 "time"
88
99 googlegithub "github.com/google/go-github/v72/github"
10- "github.com/grafana/github-datasource/pkg/models"
11- "github.com/grafana/github-datasource/pkg/testutil"
1210 "github.com/grafana/grafana-plugin-sdk-go/backend"
1311 "github.com/stretchr/testify/assert"
1412 "pgregory.net/rapid"
13+
14+ "github.com/grafana/github-datasource/pkg/models"
15+ "github.com/grafana/github-datasource/pkg/testutil"
1516)
1617
1718func githubWorkflowGen () * rapid.Generator [* googlegithub.Workflow ] {
@@ -254,42 +255,50 @@ func TestWorkflowRunsDataFrame(t *testing.T) {
254255 updatedAt1 , err := time .Parse ("2006-Jan-02" , "2013-Feb-02" )
255256 assert .NoError (t , err )
256257
258+ runStartedAt1 , err := time .Parse ("2006-Jan-02" , "2013-Feb-02" )
259+ assert .NoError (t , err )
260+
257261 createdAt2 , err := time .Parse ("2006-Jan-02" , "2013-Feb-03" )
258262 assert .NoError (t , err )
259263
260264 updatedAt2 , err := time .Parse ("2006-Jan-02" , "2013-Feb-04" )
261265 assert .NoError (t , err )
262266
267+ runStartedAt2 , err := time .Parse ("2006-Jan-02" , "2013-Feb-04" )
268+ assert .NoError (t , err )
269+
263270 workflowRuns := WorkflowRunsWrapper ([]* googlegithub.WorkflowRun {
264271 {
265- ID : ptr (int64 (1 )),
266- Name : ptr ("name_1" ),
267- HeadBranch : ptr ("head_branch_1" ),
268- HeadSHA : ptr ("head_sha_1" ),
269- CreatedAt : & googlegithub.Timestamp {Time : createdAt1 },
270- UpdatedAt : & googlegithub.Timestamp {Time : updatedAt1 },
271- HTMLURL : ptr ("html_url_1" ),
272- URL : ptr ("url_1" ),
273- Status : ptr ("status_1" ),
274- Conclusion : ptr ("conclusion_1" ),
275- Event : ptr ("event_1" ),
276- WorkflowID : ptr (int64 (1 )),
277- RunNumber : ptr (int (1 )),
272+ ID : ptr (int64 (1 )),
273+ Name : ptr ("name_1" ),
274+ HeadBranch : ptr ("head_branch_1" ),
275+ HeadSHA : ptr ("head_sha_1" ),
276+ CreatedAt : & googlegithub.Timestamp {Time : createdAt1 },
277+ UpdatedAt : & googlegithub.Timestamp {Time : updatedAt1 },
278+ RunStartedAt : & googlegithub.Timestamp {Time : runStartedAt1 },
279+ HTMLURL : ptr ("html_url_1" ),
280+ URL : ptr ("url_1" ),
281+ Status : ptr ("status_1" ),
282+ Conclusion : ptr ("conclusion_1" ),
283+ Event : ptr ("event_1" ),
284+ WorkflowID : ptr (int64 (1 )),
285+ RunNumber : ptr (int (1 )),
278286 },
279287 {
280- ID : ptr (int64 (2 )),
281- Name : ptr ("name_2" ),
282- HeadBranch : ptr ("head_branch_2" ),
283- HeadSHA : ptr ("head_sha_2" ),
284- CreatedAt : & googlegithub.Timestamp {Time : createdAt2 },
285- UpdatedAt : & googlegithub.Timestamp {Time : updatedAt2 },
286- HTMLURL : ptr ("html_url_2" ),
287- URL : ptr ("url_2" ),
288- Status : ptr ("status_2" ),
289- Conclusion : ptr ("conclusion_2" ),
290- Event : ptr ("event_2" ),
291- WorkflowID : ptr (int64 (2 )),
292- RunNumber : ptr (int (2 )),
288+ ID : ptr (int64 (2 )),
289+ Name : ptr ("name_2" ),
290+ HeadBranch : ptr ("head_branch_2" ),
291+ HeadSHA : ptr ("head_sha_2" ),
292+ CreatedAt : & googlegithub.Timestamp {Time : createdAt2 },
293+ UpdatedAt : & googlegithub.Timestamp {Time : updatedAt2 },
294+ RunStartedAt : & googlegithub.Timestamp {Time : runStartedAt2 },
295+ HTMLURL : ptr ("html_url_2" ),
296+ URL : ptr ("url_2" ),
297+ Status : ptr ("status_2" ),
298+ Conclusion : ptr ("conclusion_2" ),
299+ Event : ptr ("event_2" ),
300+ WorkflowID : ptr (int64 (2 )),
301+ RunNumber : ptr (int (2 )),
293302 },
294303 })
295304
0 commit comments