diff --git a/go.mod b/go.mod index 8dc5152..10bbe04 100644 --- a/go.mod +++ b/go.mod @@ -9,6 +9,7 @@ require ( github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.0 github.com/oklog/run v1.1.0 github.com/prometheus/client_golang v1.19.0 + github.com/stretchr/testify v1.8.4 github.com/xanzy/go-gitlab v0.102.0 go.opentelemetry.io/proto/otlp v1.2.0 golang.org/x/exp v0.0.0-20240409090435-93d18d7e34b8 @@ -21,11 +22,13 @@ require ( require ( github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.1.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-retryablehttp v0.7.5 // indirect github.com/kr/text v0.2.0 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_model v0.6.1 // indirect github.com/prometheus/common v0.52.3 // indirect github.com/prometheus/procfs v0.13.0 // indirect diff --git a/test/integration/conftest.go b/test/integration/conftest.go new file mode 100644 index 0000000..dd314d1 --- /dev/null +++ b/test/integration/conftest.go @@ -0,0 +1,62 @@ +package integration_test + +import ( + "context" + "net" + "net/http" + "net/http/httptest" + "testing" + + "github.com/cluttrdev/gitlab-exporter/internal/exporter" + "github.com/cluttrdev/gitlab-exporter/internal/gitlab" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" + "google.golang.org/grpc/test/bufconn" + + "github.com/cluttrdev/gitlab-exporter/test/mock/recorder" +) + +func setupGitLab(t *testing.T) (*http.ServeMux, *gitlab.Client) { + mux := http.NewServeMux() + srv := httptest.NewServer(mux) + t.Cleanup(srv.Close) + + client, err := gitlab.NewGitLabClient(gitlab.ClientConfig{ + URL: srv.URL, + }) + if err != nil { + t.Fatalf("failed to create client: %v", err) + } + + return mux, client +} + +func setupExporter(t *testing.T) (*exporter.Exporter, *recorder_mock.Recorder) { + rec := recorder_mock.New() + t.Cleanup(rec.GracefulStop) + + const bufSize int = 4 * 1024 * 1024 + lis := bufconn.Listen(bufSize) + go func() { + if err := rec.Serve(lis); err != nil { + t.Log(err) + } + }() + + exp, err := exporter.New([]exporter.EndpointConfig{ + { + Address: "bufnet", + Options: []grpc.DialOption{ + grpc.WithContextDialer(func(context.Context, string) (net.Conn, error) { + return lis.Dial() + }), + grpc.WithTransportCredentials(insecure.NewCredentials()), + }, + }, + }) + if err != nil { + t.Fatalf("failed to create exporter: %v", err) + } + + return exp, rec +} diff --git a/test/integration/main_test.go b/test/integration/main_test.go new file mode 100644 index 0000000..30a4620 --- /dev/null +++ b/test/integration/main_test.go @@ -0,0 +1,56 @@ +package integration_test + +import ( + "encoding/json" + "fmt" + "net/http" + "net/http/httptest" + "os" + "strings" + "testing" + + gitlab_mock "github.com/cluttrdev/gitlab-exporter/test/mock/gitlab" +) + +const testSet string = "default" + +func TestMain(m *testing.M) { + fh := &gitlab_mock.FileHandler{Root: http.Dir("testdata/gitlab.com")} + srv := httptest.NewServer(fh) + defer srv.Close() + + testEnv := GitLabExporterTestEnvironment{ + URL: srv.URL, + } + + SetTestEnvironment(testSet, testEnv) + + os.Exit(m.Run()) +} + +type GitLabExporterTestEnvironment struct { + URL string +} + +func SetTestEnvironment(name string, env GitLabExporterTestEnvironment) { + bytes, err := json.Marshal(env) + if err != nil { + panic(err) + } + + os.Setenv(fmt.Sprintf("GLE_TEST_ENV_%s", strings.ToUpper(testSet)), string(bytes)) +} + +func GetTestEnvironment(name string) (GitLabExporterTestEnvironment, error) { + sEnv := os.Getenv(fmt.Sprintf("GLE_TEST_ENV_%s", strings.ToUpper(testSet))) + if sEnv == "" { + return GitLabExporterTestEnvironment{}, fmt.Errorf("environment not found: %s", name) + } + + var env GitLabExporterTestEnvironment + if err := json.Unmarshal([]byte(sEnv), &env); err != nil { + return GitLabExporterTestEnvironment{}, err + } + + return env, nil +} diff --git a/test/integration/tasks_test.go b/test/integration/tasks_test.go new file mode 100644 index 0000000..7c30872 --- /dev/null +++ b/test/integration/tasks_test.go @@ -0,0 +1,57 @@ +package integration_test + +import ( + "context" + "fmt" + "testing" + + "github.com/stretchr/testify/assert" + + "github.com/cluttrdev/gitlab-exporter/internal/gitlab" + "github.com/cluttrdev/gitlab-exporter/internal/tasks" +) + +func Test_ExportPipelineHierarchy(t *testing.T) { + env, err := GetTestEnvironment(testSet) + if err != nil { + t.Error(err) + } + + glc, err := gitlab.NewGitLabClient(gitlab.ClientConfig{ + URL: fmt.Sprintf("%s/api/v4", env.URL), + }) + if err != nil { + t.Fatalf("failed to create client: %v", err) + } + + exp, rec := setupExporter(t) + + var ( + projectID int64 = 50817395 // cluttrdev/gitlab-exporter + pipelineID int64 = 1252248442 + ) + + opts := tasks.ExportPipelineHierarchyOptions{ + ProjectID: projectID, + PipelineID: pipelineID, + + ExportSections: false, + ExportTestReports: true, + ExportTraces: true, + ExportMetrics: false, + } + + if err := tasks.ExportPipelineHierarchy(context.Background(), glc, exp, opts); err != nil { + t.Error(err) + } + + assert.Equal(t, 1, len(rec.Datastore().ListProjectPipelines(projectID))) + + p := rec.Datastore().GetPipeline(pipelineID) + if p == nil { + t.Fatalf("pipeline not recorded: %v", pipelineID) + } + + assert.Equal(t, 4, len(rec.Datastore().ListPipelineJobs(projectID, pipelineID))) + assert.Equal(t, int64(13), rec.Datastore().GetPipelineTestReport(pipelineID).TotalCount) +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines.json new file mode 100644 index 0000000..78a6e8d --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines.json @@ -0,0 +1,366 @@ +[ + { + "id": 1252248442, + "iid": 28, + "project_id": 50817395, + "sha": "f718986f8e09094e455d3bd03f7893eecfb0a0bd", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2024-04-14T11:54:37.896Z", + "updated_at": "2024-04-14T11:58:49.893Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1252248442", + "name": null + }, + { + "id": 1204596303, + "iid": 27, + "project_id": 50817395, + "sha": "94749c3122bbad0f94ab126f49f8b2c0e4812dbd", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2024-03-07T11:06:20.295Z", + "updated_at": "2024-03-07T11:10:11.720Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1204596303", + "name": null + }, + { + "id": 1204562891, + "iid": 26, + "project_id": 50817395, + "sha": "94749c3122bbad0f94ab126f49f8b2c0e4812dbd", + "ref": "ci-custom-sections", + "status": "success", + "source": "push", + "created_at": "2024-03-07T10:52:06.554Z", + "updated_at": "2024-03-07T10:55:47.413Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1204562891", + "name": null + }, + { + "id": 1204552176, + "iid": 25, + "project_id": 50817395, + "sha": "e051be877189db6c448be011e1d458e6761291bb", + "ref": "ci-custom-sections", + "status": "success", + "source": "push", + "created_at": "2024-03-07T10:46:02.293Z", + "updated_at": "2024-03-07T10:50:16.431Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1204552176", + "name": null + }, + { + "id": 1204507964, + "iid": 24, + "project_id": 50817395, + "sha": "7b5d43c650a04710ecd9a88885700ab1918e6441", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2024-03-07T10:26:28.245Z", + "updated_at": "2024-03-07T10:31:01.391Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1204507964", + "name": null + }, + { + "id": 1190131020, + "iid": 23, + "project_id": 50817395, + "sha": "4c1550dd11e8dbc76a2ea942f5de3bc506272cf5", + "ref": "v0.5.1", + "status": "success", + "source": "push", + "created_at": "2024-02-25T21:34:59.109Z", + "updated_at": "2024-02-25T21:39:28.357Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1190131020", + "name": null + }, + { + "id": 1190131018, + "iid": 22, + "project_id": 50817395, + "sha": "7c8e4219704f1096b9debed5c62400daf8b90339", + "ref": "v0.5.0", + "status": "success", + "source": "push", + "created_at": "2024-02-25T21:34:58.653Z", + "updated_at": "2024-02-25T21:39:19.687Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1190131018", + "name": null + }, + { + "id": 1190130970, + "iid": 21, + "project_id": 50817395, + "sha": "e5e89430184a636a4bf3e7afeb5f83c6af79b59e", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2024-02-25T21:34:40.344Z", + "updated_at": "2024-03-04T08:00:33.890Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1190130970", + "name": null + }, + { + "id": 1181733739, + "iid": 20, + "project_id": 50817395, + "sha": "a195a889a676f72513cda690ffc80298777dfacb", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2024-02-19T10:00:24.940Z", + "updated_at": "2024-02-19T10:04:46.738Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1181733739", + "name": null + }, + { + "id": 1164454482, + "iid": 19, + "project_id": 50817395, + "sha": "f10fc73679895a9c7f86ea1dc72aa29cecba2083", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2024-02-05T09:27:09.477Z", + "updated_at": "2024-02-05T09:30:05.079Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1164454482", + "name": null + }, + { + "id": 1153225469, + "iid": 18, + "project_id": 50817395, + "sha": "e8420b5fe7c3cfc444e27f0f24fb2f1855462e2b", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2024-01-26T10:20:32.166Z", + "updated_at": "2024-01-26T20:00:17.534Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1153225469", + "name": null + }, + { + "id": 1152848130, + "iid": 17, + "project_id": 50817395, + "sha": "69cc1f0e34c553860c1fd6b6e091650409490daf", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2024-01-26T05:55:34.230Z", + "updated_at": "2024-01-26T05:58:43.564Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1152848130", + "name": null + }, + { + "id": 1152841291, + "iid": 16, + "project_id": 50817395, + "sha": "5e0c3f2408466c952ea366346c5d8dc6fb8486f7", + "ref": "main", + "status": "failed", + "source": "push", + "created_at": "2024-01-26T05:45:54.032Z", + "updated_at": "2024-01-26T05:46:21.720Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1152841291", + "name": null + }, + { + "id": 1097349658, + "iid": 15, + "project_id": 50817395, + "sha": "85ff3602e090f7a5c2e2691982ff3d8a6dfb1e22", + "ref": "main", + "status": "canceled", + "source": "push", + "created_at": "2023-12-06T12:43:21.693Z", + "updated_at": "2023-12-06T14:09:19.155Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1097349658", + "name": null + }, + { + "id": 1094770143, + "iid": 14, + "project_id": 50817395, + "sha": "6646717fb5f99db06c3b8e836a38da46c265ecd5", + "ref": "log_embedded_metrics", + "status": "success", + "source": "push", + "created_at": "2023-12-04T16:35:40.345Z", + "updated_at": "2023-12-04T16:40:29.388Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1094770143", + "name": null + }, + { + "id": 1083833095, + "iid": 13, + "project_id": 50817395, + "sha": "3c530002e6dc209390af18b9835dd02a8441f981", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2023-11-24T09:55:24.650Z", + "updated_at": "2023-11-24T10:00:04.043Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1083833095", + "name": null + }, + { + "id": 1082136862, + "iid": 12, + "project_id": 50817395, + "sha": "e860ecdc74aee9aab22f6336a705bab05634c0c3", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2023-11-22T22:04:17.951Z", + "updated_at": "2023-11-22T22:08:53.886Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1082136862", + "name": null + }, + { + "id": 1079025538, + "iid": 11, + "project_id": 50817395, + "sha": "7180ae586f19ae465387ddfa5f02522fa1521f6e", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2023-11-20T16:51:26.685Z", + "updated_at": "2023-11-20T16:58:29.430Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1079025538", + "name": null + }, + { + "id": 1059953266, + "iid": 10, + "project_id": 50817395, + "sha": "249039544119d7673d22b7979942c079c3cfe4fa", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2023-11-03T09:22:38.524Z", + "updated_at": "2023-11-03T09:27:24.306Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1059953266", + "name": null + }, + { + "id": 1058892793, + "iid": 9, + "project_id": 50817395, + "sha": "249039544119d7673d22b7979942c079c3cfe4fa", + "ref": "gitlab-ci", + "status": "success", + "source": "push", + "created_at": "2023-11-02T12:47:05.694Z", + "updated_at": "2023-11-02T12:51:39.855Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1058892793", + "name": null + }, + { + "id": 1053741635, + "iid": 8, + "project_id": 50817395, + "sha": "2224c54abb7d48dac246cf4a393d87a232845488", + "ref": "gitlab-ci", + "status": "success", + "source": "push", + "created_at": "2023-10-29T13:52:08.366Z", + "updated_at": "2023-10-29T13:56:49.682Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1053741635", + "name": null + }, + { + "id": 1053733851, + "iid": 7, + "project_id": 50817395, + "sha": "0f70911cf8be855821e2eacd73762dbd2b07ff0b", + "ref": "gitlab-ci", + "status": "failed", + "source": "push", + "created_at": "2023-10-29T13:21:23.459Z", + "updated_at": "2023-10-29T13:21:50.418Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1053733851", + "name": null + }, + { + "id": 1053715873, + "iid": 6, + "project_id": 50817395, + "sha": "f6e403ee0c612b445be509209e067a2c33f48949", + "ref": "gitlab-ci", + "status": "failed", + "source": "push", + "created_at": "2023-10-29T12:41:29.071Z", + "updated_at": "2023-10-29T12:45:44.365Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1053715873", + "name": null + }, + { + "id": 1053714541, + "iid": 5, + "project_id": 50817395, + "sha": "3b9ddfd61ffd847c3cc841b19a2a3d694531a02e", + "ref": "gitlab-ci", + "status": "failed", + "source": "push", + "created_at": "2023-10-29T12:38:46.934Z", + "updated_at": "2023-10-29T12:38:46.934Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1053714541", + "name": null + }, + { + "id": 1053688581, + "iid": 4, + "project_id": 50817395, + "sha": "6c38aeec7b2953bdab95538cb1d15ffef6e38d8f", + "ref": "gitlab-ci", + "status": "success", + "source": "push", + "created_at": "2023-10-29T11:36:32.053Z", + "updated_at": "2023-10-29T11:40:18.807Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1053688581", + "name": null + }, + { + "id": 1053671256, + "iid": 3, + "project_id": 50817395, + "sha": "bb84d2bdfec6dea2d6f8ac64f242e01c149a31b8", + "ref": "gitlab-ci", + "status": "failed", + "source": "push", + "created_at": "2023-10-29T10:43:25.545Z", + "updated_at": "2023-10-29T10:47:17.662Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1053671256", + "name": null + }, + { + "id": 1053349645, + "iid": 2, + "project_id": 50817395, + "sha": "c4109e3d02065087c48799e307ddf449d5abde0a", + "ref": "gitlab-ci", + "status": "failed", + "source": "push", + "created_at": "2023-10-28T19:31:52.869Z", + "updated_at": "2023-10-28T19:35:47.914Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1053349645", + "name": null + }, + { + "id": 1053344116, + "iid": 1, + "project_id": 50817395, + "sha": "fe73f907afb0a049d577a1b5f26002cd12e3baaa", + "ref": "gitlab-ci", + "status": "failed", + "source": "push", + "created_at": "2023-10-28T19:17:43.749Z", + "updated_at": "2023-10-28T19:19:15.566Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1053344116", + "name": null + } +] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053344116.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053344116.json new file mode 100644 index 0000000..6b3e921 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053344116.json @@ -0,0 +1,42 @@ +{ + "id": 1053344116, + "iid": 1, + "project_id": 50817395, + "sha": "fe73f907afb0a049d577a1b5f26002cd12e3baaa", + "ref": "gitlab-ci", + "status": "failed", + "source": "push", + "created_at": "2023-10-28T19:17:43.749Z", + "updated_at": "2023-10-28T19:19:15.566Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1053344116", + "before_sha": "0000000000000000000000000000000000000000", + "tag": false, + "yaml_errors": null, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev" + }, + "started_at": "2023-10-28T19:17:44.450Z", + "finished_at": "2023-10-28T19:19:15.556Z", + "committed_at": null, + "duration": 90, + "queued_duration": null, + "coverage": null, + "detailed_status": { + "icon": "status_failed", + "text": "Failed", + "label": "failed", + "group": "failed", + "tooltip": "failed", + "has_details": false, + "details_path": "/cluttrdev/gitlab-exporter/-/pipelines/1053344116", + "illustration": null, + "favicon": "/assets/ci_favicons/favicon_status_failed-41304d7f7e3828808b0c26771f0309e55296819a9beea3ea9fbf6689d9857c12.png" + }, + "name": null +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053344116/bridges.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053344116/bridges.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053344116/bridges.json @@ -0,0 +1 @@ +[] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053344116/jobs.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053344116/jobs.json new file mode 100644 index 0000000..9825cd2 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053344116/jobs.json @@ -0,0 +1,368 @@ +[ + { + "id": 5407026880, + "status": "skipped", + "stage": "test", + "name": "test", + "ref": "gitlab-ci", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2023-10-28T19:17:43.796Z", + "started_at": null, + "finished_at": null, + "erased_at": null, + "duration": null, + "queued_duration": null, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "fe73f907afb0a049d577a1b5f26002cd12e3baaa", + "short_id": "fe73f907", + "created_at": "2023-10-28T21:17:06.000+02:00", + "parent_ids": [ + "9d8163d8ca6d31ed724faab048d836f504e74adb" + ], + "title": "Add .gitlab/gitlab-ci.yaml", + "message": "Add .gitlab/gitlab-ci.yaml\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-10-28T21:17:06.000+02:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-10-28T21:17:06.000+02:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/fe73f907afb0a049d577a1b5f26002cd12e3baaa" + }, + "pipeline": { + "id": 1053344116, + "iid": 1, + "project_id": 50817395, + "sha": "fe73f907afb0a049d577a1b5f26002cd12e3baaa", + "ref": "gitlab-ci", + "status": "failed", + "source": "push", + "created_at": "2023-10-28T19:17:43.749Z", + "updated_at": "2023-10-28T19:19:15.566Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1053344116" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5407026880", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [], + "runner": null, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 5407026879, + "status": "skipped", + "stage": "build", + "name": "build", + "ref": "gitlab-ci", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2023-10-28T19:17:43.786Z", + "started_at": null, + "finished_at": null, + "erased_at": null, + "duration": null, + "queued_duration": null, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "fe73f907afb0a049d577a1b5f26002cd12e3baaa", + "short_id": "fe73f907", + "created_at": "2023-10-28T21:17:06.000+02:00", + "parent_ids": [ + "9d8163d8ca6d31ed724faab048d836f504e74adb" + ], + "title": "Add .gitlab/gitlab-ci.yaml", + "message": "Add .gitlab/gitlab-ci.yaml\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-10-28T21:17:06.000+02:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-10-28T21:17:06.000+02:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/fe73f907afb0a049d577a1b5f26002cd12e3baaa" + }, + "pipeline": { + "id": 1053344116, + "iid": 1, + "project_id": 50817395, + "sha": "fe73f907afb0a049d577a1b5f26002cd12e3baaa", + "ref": "gitlab-ci", + "status": "failed", + "source": "push", + "created_at": "2023-10-28T19:17:43.749Z", + "updated_at": "2023-10-28T19:19:15.566Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1053344116" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5407026879", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [], + "runner": null, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 5407026878, + "status": "failed", + "stage": "lint", + "name": "vet", + "ref": "gitlab-ci", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2023-10-28T19:17:43.776Z", + "started_at": "2023-10-28T19:17:44.510Z", + "finished_at": "2023-10-28T19:18:42.982Z", + "erased_at": null, + "duration": 58.472312, + "queued_duration": 0.265093, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "fe73f907afb0a049d577a1b5f26002cd12e3baaa", + "short_id": "fe73f907", + "created_at": "2023-10-28T21:17:06.000+02:00", + "parent_ids": [ + "9d8163d8ca6d31ed724faab048d836f504e74adb" + ], + "title": "Add .gitlab/gitlab-ci.yaml", + "message": "Add .gitlab/gitlab-ci.yaml\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-10-28T21:17:06.000+02:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-10-28T21:17:06.000+02:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/fe73f907afb0a049d577a1b5f26002cd12e3baaa" + }, + "pipeline": { + "id": 1053344116, + "iid": 1, + "project_id": 50817395, + "sha": "fe73f907afb0a049d577a1b5f26002cd12e3baaa", + "ref": "gitlab-ci", + "status": "failed", + "source": "push", + "created_at": "2023-10-28T19:17:43.749Z", + "updated_at": "2023-10-28T19:19:15.566Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1053344116" + }, + "failure_reason": "script_failure", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5407026878", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 4124, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270852, + "description": "3-green.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.251", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": false, + "status": "offline" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 5407026877, + "status": "failed", + "stage": "lint", + "name": "lint", + "ref": "gitlab-ci", + "tag": false, + "coverage": null, + "allow_failure": true, + "created_at": "2023-10-28T19:17:43.763Z", + "started_at": "2023-10-28T19:17:44.347Z", + "finished_at": "2023-10-28T19:19:15.324Z", + "erased_at": null, + "duration": 90.977388, + "queued_duration": 0.155861, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "fe73f907afb0a049d577a1b5f26002cd12e3baaa", + "short_id": "fe73f907", + "created_at": "2023-10-28T21:17:06.000+02:00", + "parent_ids": [ + "9d8163d8ca6d31ed724faab048d836f504e74adb" + ], + "title": "Add .gitlab/gitlab-ci.yaml", + "message": "Add .gitlab/gitlab-ci.yaml\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-10-28T21:17:06.000+02:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-10-28T21:17:06.000+02:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/fe73f907afb0a049d577a1b5f26002cd12e3baaa" + }, + "pipeline": { + "id": 1053344116, + "iid": 1, + "project_id": 50817395, + "sha": "fe73f907afb0a049d577a1b5f26002cd12e3baaa", + "ref": "gitlab-ci", + "status": "failed", + "source": "push", + "created_at": "2023-10-28T19:17:43.749Z", + "updated_at": "2023-10-28T19:19:15.566Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1053344116" + }, + "failure_reason": "script_failure", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5407026877", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 3868, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270845, + "description": "1-green.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.248", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": false, + "status": "offline" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + } +] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053344116/test_report.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053344116/test_report.json new file mode 100644 index 0000000..6728c4e --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053344116/test_report.json @@ -0,0 +1,9 @@ +{ + "total_time": 0, + "total_count": 0, + "success_count": 0, + "failed_count": 0, + "skipped_count": 0, + "error_count": 0, + "test_suites": [] +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053344116/test_report_summary.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053344116/test_report_summary.json new file mode 100644 index 0000000..6e39e02 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053344116/test_report_summary.json @@ -0,0 +1,12 @@ +{ + "total": { + "time": 0, + "count": 0, + "success": 0, + "failed": 0, + "skipped": 0, + "error": 0, + "suite_error": null + }, + "test_suites": [] +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053349645.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053349645.json new file mode 100644 index 0000000..3b4dfb3 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053349645.json @@ -0,0 +1,42 @@ +{ + "id": 1053349645, + "iid": 2, + "project_id": 50817395, + "sha": "c4109e3d02065087c48799e307ddf449d5abde0a", + "ref": "gitlab-ci", + "status": "failed", + "source": "push", + "created_at": "2023-10-28T19:31:52.869Z", + "updated_at": "2023-10-28T19:35:47.914Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1053349645", + "before_sha": "fe73f907afb0a049d577a1b5f26002cd12e3baaa", + "tag": false, + "yaml_errors": null, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev" + }, + "started_at": "2023-10-28T19:31:53.916Z", + "finished_at": "2023-10-28T19:35:47.907Z", + "committed_at": null, + "duration": 233, + "queued_duration": 1, + "coverage": null, + "detailed_status": { + "icon": "status_failed", + "text": "Failed", + "label": "failed", + "group": "failed", + "tooltip": "failed", + "has_details": false, + "details_path": "/cluttrdev/gitlab-exporter/-/pipelines/1053349645", + "illustration": null, + "favicon": "/assets/ci_favicons/favicon_status_failed-41304d7f7e3828808b0c26771f0309e55296819a9beea3ea9fbf6689d9857c12.png" + }, + "name": null +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053349645/bridges.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053349645/bridges.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053349645/bridges.json @@ -0,0 +1 @@ +[] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053349645/jobs.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053349645/jobs.json new file mode 100644 index 0000000..f9f7eac --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053349645/jobs.json @@ -0,0 +1,404 @@ +[ + { + "id": 5407060751, + "status": "failed", + "stage": "test", + "name": "test", + "ref": "gitlab-ci", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2023-10-28T19:31:52.927Z", + "started_at": "2023-10-28T19:34:25.088Z", + "finished_at": "2023-10-28T19:35:47.812Z", + "erased_at": null, + "duration": 82.724733, + "queued_duration": 0.202915, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "c4109e3d02065087c48799e307ddf449d5abde0a", + "short_id": "c4109e3d", + "created_at": "2023-10-28T21:31:44.000+02:00", + "parent_ids": [ + "fe73f907afb0a049d577a1b5f26002cd12e3baaa" + ], + "title": "Update required go version to 1.20", + "message": "Update required go version to 1.20\n\nThis is due to the `Compare` method of `time.Time` being added in 1.20\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-10-28T21:28:33.000+02:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-10-28T21:31:44.000+02:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/c4109e3d02065087c48799e307ddf449d5abde0a" + }, + "pipeline": { + "id": 1053349645, + "iid": 2, + "project_id": 50817395, + "sha": "c4109e3d02065087c48799e307ddf449d5abde0a", + "ref": "gitlab-ci", + "status": "failed", + "source": "push", + "created_at": "2023-10-28T19:31:52.869Z", + "updated_at": "2023-10-28T19:35:47.914Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1053349645" + }, + "failure_reason": "script_failure", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5407060751", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 10354, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270848, + "description": "2-green.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.66", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": false, + "status": "offline" + }, + "artifacts_expire_at": "2023-11-27T19:35:45.247Z", + "archived": false, + "tag_list": [] + }, + { + "id": 5407060748, + "status": "success", + "stage": "build", + "name": "build", + "ref": "gitlab-ci", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2023-10-28T19:31:52.912Z", + "started_at": "2023-10-28T19:33:15.547Z", + "finished_at": "2023-10-28T19:34:24.765Z", + "erased_at": null, + "duration": 69.218155, + "queued_duration": 0.413169, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "c4109e3d02065087c48799e307ddf449d5abde0a", + "short_id": "c4109e3d", + "created_at": "2023-10-28T21:31:44.000+02:00", + "parent_ids": [ + "fe73f907afb0a049d577a1b5f26002cd12e3baaa" + ], + "title": "Update required go version to 1.20", + "message": "Update required go version to 1.20\n\nThis is due to the `Compare` method of `time.Time` being added in 1.20\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-10-28T21:28:33.000+02:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-10-28T21:31:44.000+02:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/c4109e3d02065087c48799e307ddf449d5abde0a" + }, + "pipeline": { + "id": 1053349645, + "iid": 2, + "project_id": 50817395, + "sha": "c4109e3d02065087c48799e307ddf449d5abde0a", + "ref": "gitlab-ci", + "status": "failed", + "source": "push", + "created_at": "2023-10-28T19:31:52.869Z", + "updated_at": "2023-10-28T19:35:47.914Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1053349645" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5407060748", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 3879, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270859, + "description": "5-green.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.249", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": false, + "status": "offline" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 5407060745, + "status": "success", + "stage": "lint", + "name": "vet", + "ref": "gitlab-ci", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2023-10-28T19:31:52.897Z", + "started_at": "2023-10-28T19:31:54.024Z", + "finished_at": "2023-10-28T19:33:08.701Z", + "erased_at": null, + "duration": 74.676829, + "queued_duration": 0.477961, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "c4109e3d02065087c48799e307ddf449d5abde0a", + "short_id": "c4109e3d", + "created_at": "2023-10-28T21:31:44.000+02:00", + "parent_ids": [ + "fe73f907afb0a049d577a1b5f26002cd12e3baaa" + ], + "title": "Update required go version to 1.20", + "message": "Update required go version to 1.20\n\nThis is due to the `Compare` method of `time.Time` being added in 1.20\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-10-28T21:28:33.000+02:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-10-28T21:31:44.000+02:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/c4109e3d02065087c48799e307ddf449d5abde0a" + }, + "pipeline": { + "id": 1053349645, + "iid": 2, + "project_id": 50817395, + "sha": "c4109e3d02065087c48799e307ddf449d5abde0a", + "ref": "gitlab-ci", + "status": "failed", + "source": "push", + "created_at": "2023-10-28T19:31:52.869Z", + "updated_at": "2023-10-28T19:35:47.914Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1053349645" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5407060745", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 3929, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270848, + "description": "2-green.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.66", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": false, + "status": "offline" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 5407060742, + "status": "failed", + "stage": "lint", + "name": "lint", + "ref": "gitlab-ci", + "tag": false, + "coverage": null, + "allow_failure": true, + "created_at": "2023-10-28T19:31:52.884Z", + "started_at": "2023-10-28T19:31:53.588Z", + "finished_at": "2023-10-28T19:33:15.031Z", + "erased_at": null, + "duration": 81.443043, + "queued_duration": 0.139567, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "c4109e3d02065087c48799e307ddf449d5abde0a", + "short_id": "c4109e3d", + "created_at": "2023-10-28T21:31:44.000+02:00", + "parent_ids": [ + "fe73f907afb0a049d577a1b5f26002cd12e3baaa" + ], + "title": "Update required go version to 1.20", + "message": "Update required go version to 1.20\n\nThis is due to the `Compare` method of `time.Time` being added in 1.20\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-10-28T21:28:33.000+02:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-10-28T21:31:44.000+02:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/c4109e3d02065087c48799e307ddf449d5abde0a" + }, + "pipeline": { + "id": 1053349645, + "iid": 2, + "project_id": 50817395, + "sha": "c4109e3d02065087c48799e307ddf449d5abde0a", + "ref": "gitlab-ci", + "status": "failed", + "source": "push", + "created_at": "2023-10-28T19:31:52.869Z", + "updated_at": "2023-10-28T19:35:47.914Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1053349645" + }, + "failure_reason": "script_failure", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5407060742", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 3786, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270848, + "description": "2-green.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.66", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": false, + "status": "offline" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + } +] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053349645/test_report.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053349645/test_report.json new file mode 100644 index 0000000..6728c4e --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053349645/test_report.json @@ -0,0 +1,9 @@ +{ + "total_time": 0, + "total_count": 0, + "success_count": 0, + "failed_count": 0, + "skipped_count": 0, + "error_count": 0, + "test_suites": [] +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053349645/test_report_summary.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053349645/test_report_summary.json new file mode 100644 index 0000000..5172f0d --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053349645/test_report_summary.json @@ -0,0 +1,26 @@ +{ + "total": { + "time": 0.0, + "count": 17, + "success": 11, + "failed": 6, + "skipped": 0, + "error": 0, + "suite_error": null + }, + "test_suites": [ + { + "name": "test", + "total_time": 0.0, + "total_count": 17, + "success_count": 11, + "failed_count": 6, + "skipped_count": 0, + "error_count": 0, + "build_ids": [ + 5407060751 + ], + "suite_error": null + } + ] +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053671256.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053671256.json new file mode 100644 index 0000000..df80389 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053671256.json @@ -0,0 +1,42 @@ +{ + "id": 1053671256, + "iid": 3, + "project_id": 50817395, + "sha": "bb84d2bdfec6dea2d6f8ac64f242e01c149a31b8", + "ref": "gitlab-ci", + "status": "failed", + "source": "push", + "created_at": "2023-10-29T10:43:25.545Z", + "updated_at": "2023-10-29T10:47:17.662Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1053671256", + "before_sha": "c4109e3d02065087c48799e307ddf449d5abde0a", + "tag": false, + "yaml_errors": null, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev" + }, + "started_at": "2023-10-29T10:43:26.423Z", + "finished_at": "2023-10-29T10:47:17.653Z", + "committed_at": null, + "duration": 230, + "queued_duration": null, + "coverage": null, + "detailed_status": { + "icon": "status_failed", + "text": "Failed", + "label": "failed", + "group": "failed", + "tooltip": "failed", + "has_details": false, + "details_path": "/cluttrdev/gitlab-exporter/-/pipelines/1053671256", + "illustration": null, + "favicon": "/assets/ci_favicons/favicon_status_failed-41304d7f7e3828808b0c26771f0309e55296819a9beea3ea9fbf6689d9857c12.png" + }, + "name": null +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053671256/bridges.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053671256/bridges.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053671256/bridges.json @@ -0,0 +1 @@ +[] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053671256/jobs.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053671256/jobs.json new file mode 100644 index 0000000..5b3fd94 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053671256/jobs.json @@ -0,0 +1,403 @@ +[ + { + "id": 5408788592, + "status": "failed", + "stage": "test", + "name": "test", + "ref": "gitlab-ci", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2023-10-29T10:43:25.592Z", + "started_at": "2023-10-29T10:45:57.397Z", + "finished_at": "2023-10-29T10:47:17.557Z", + "erased_at": null, + "duration": 80.159683, + "queued_duration": 0.143258, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "bb84d2bdfec6dea2d6f8ac64f242e01c149a31b8", + "short_id": "bb84d2bd", + "created_at": "2023-10-29T11:43:03.000+01:00", + "parent_ids": [ + "9f0f20263a16eb7b27d606a4ab4e40bcd8080601" + ], + "title": "Remove unused parseID and pathEsacpe", + "message": "Remove unused parseID and pathEsacpe\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-10-29T11:40:26.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-10-29T11:43:03.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/bb84d2bdfec6dea2d6f8ac64f242e01c149a31b8" + }, + "pipeline": { + "id": 1053671256, + "iid": 3, + "project_id": 50817395, + "sha": "bb84d2bdfec6dea2d6f8ac64f242e01c149a31b8", + "ref": "gitlab-ci", + "status": "failed", + "source": "push", + "created_at": "2023-10-29T10:43:25.545Z", + "updated_at": "2023-10-29T10:47:17.662Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1053671256" + }, + "failure_reason": "script_failure", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5408788592", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 10354, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270848, + "description": "2-green.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.66", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": false, + "status": "offline" + }, + "artifacts_expire_at": "2023-11-28T10:47:15.021Z", + "archived": false, + "tag_list": [] + }, + { + "id": 5408788591, + "status": "success", + "stage": "build", + "name": "build", + "ref": "gitlab-ci", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2023-10-29T10:43:25.582Z", + "started_at": "2023-10-29T10:44:49.188Z", + "finished_at": "2023-10-29T10:45:57.158Z", + "erased_at": null, + "duration": 67.97087, + "queued_duration": 0.095112, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "bb84d2bdfec6dea2d6f8ac64f242e01c149a31b8", + "short_id": "bb84d2bd", + "created_at": "2023-10-29T11:43:03.000+01:00", + "parent_ids": [ + "9f0f20263a16eb7b27d606a4ab4e40bcd8080601" + ], + "title": "Remove unused parseID and pathEsacpe", + "message": "Remove unused parseID and pathEsacpe\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-10-29T11:40:26.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-10-29T11:43:03.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/bb84d2bdfec6dea2d6f8ac64f242e01c149a31b8" + }, + "pipeline": { + "id": 1053671256, + "iid": 3, + "project_id": 50817395, + "sha": "bb84d2bdfec6dea2d6f8ac64f242e01c149a31b8", + "ref": "gitlab-ci", + "status": "failed", + "source": "push", + "created_at": "2023-10-29T10:43:25.545Z", + "updated_at": "2023-10-29T10:47:17.662Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1053671256" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5408788591", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 3879, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270857, + "description": "4-green.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.252", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": false, + "status": "offline" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 5408788590, + "status": "success", + "stage": "lint", + "name": "vet", + "ref": "gitlab-ci", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2023-10-29T10:43:25.571Z", + "started_at": "2023-10-29T10:43:26.317Z", + "finished_at": "2023-10-29T10:44:39.266Z", + "erased_at": null, + "duration": 72.949498, + "queued_duration": 0.294797, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "bb84d2bdfec6dea2d6f8ac64f242e01c149a31b8", + "short_id": "bb84d2bd", + "created_at": "2023-10-29T11:43:03.000+01:00", + "parent_ids": [ + "9f0f20263a16eb7b27d606a4ab4e40bcd8080601" + ], + "title": "Remove unused parseID and pathEsacpe", + "message": "Remove unused parseID and pathEsacpe\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-10-29T11:40:26.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-10-29T11:43:03.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/bb84d2bdfec6dea2d6f8ac64f242e01c149a31b8" + }, + "pipeline": { + "id": 1053671256, + "iid": 3, + "project_id": 50817395, + "sha": "bb84d2bdfec6dea2d6f8ac64f242e01c149a31b8", + "ref": "gitlab-ci", + "status": "failed", + "source": "push", + "created_at": "2023-10-29T10:43:25.545Z", + "updated_at": "2023-10-29T10:47:17.662Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1053671256" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5408788590", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 3929, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270857, + "description": "4-green.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.252", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": false, + "status": "offline" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 5408788589, + "status": "success", + "stage": "lint", + "name": "lint", + "ref": "gitlab-ci", + "tag": false, + "coverage": null, + "allow_failure": true, + "created_at": "2023-10-29T10:43:25.559Z", + "started_at": "2023-10-29T10:43:26.275Z", + "finished_at": "2023-10-29T10:44:48.964Z", + "erased_at": null, + "duration": 82.688416, + "queued_duration": 0.299384, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "bb84d2bdfec6dea2d6f8ac64f242e01c149a31b8", + "short_id": "bb84d2bd", + "created_at": "2023-10-29T11:43:03.000+01:00", + "parent_ids": [ + "9f0f20263a16eb7b27d606a4ab4e40bcd8080601" + ], + "title": "Remove unused parseID and pathEsacpe", + "message": "Remove unused parseID and pathEsacpe\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-10-29T11:40:26.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-10-29T11:43:03.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/bb84d2bdfec6dea2d6f8ac64f242e01c149a31b8" + }, + "pipeline": { + "id": 1053671256, + "iid": 3, + "project_id": 50817395, + "sha": "bb84d2bdfec6dea2d6f8ac64f242e01c149a31b8", + "ref": "gitlab-ci", + "status": "failed", + "source": "push", + "created_at": "2023-10-29T10:43:25.545Z", + "updated_at": "2023-10-29T10:47:17.662Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1053671256" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5408788589", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 2231, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270845, + "description": "1-green.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.248", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": false, + "status": "offline" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + } +] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053671256/test_report.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053671256/test_report.json new file mode 100644 index 0000000..6728c4e --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053671256/test_report.json @@ -0,0 +1,9 @@ +{ + "total_time": 0, + "total_count": 0, + "success_count": 0, + "failed_count": 0, + "skipped_count": 0, + "error_count": 0, + "test_suites": [] +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053671256/test_report_summary.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053671256/test_report_summary.json new file mode 100644 index 0000000..d5eefc6 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053671256/test_report_summary.json @@ -0,0 +1,26 @@ +{ + "total": { + "time": 0.0, + "count": 17, + "success": 11, + "failed": 6, + "skipped": 0, + "error": 0, + "suite_error": null + }, + "test_suites": [ + { + "name": "test", + "total_time": 0.0, + "total_count": 17, + "success_count": 11, + "failed_count": 6, + "skipped_count": 0, + "error_count": 0, + "build_ids": [ + 5408788592 + ], + "suite_error": null + } + ] +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053688581.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053688581.json new file mode 100644 index 0000000..2a8410f --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053688581.json @@ -0,0 +1,42 @@ +{ + "id": 1053688581, + "iid": 4, + "project_id": 50817395, + "sha": "6c38aeec7b2953bdab95538cb1d15ffef6e38d8f", + "ref": "gitlab-ci", + "status": "success", + "source": "push", + "created_at": "2023-10-29T11:36:32.053Z", + "updated_at": "2023-10-29T11:40:18.807Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1053688581", + "before_sha": "bb84d2bdfec6dea2d6f8ac64f242e01c149a31b8", + "tag": false, + "yaml_errors": null, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev" + }, + "started_at": "2023-10-29T11:36:32.738Z", + "finished_at": "2023-10-29T11:40:18.801Z", + "committed_at": null, + "duration": 225, + "queued_duration": null, + "coverage": null, + "detailed_status": { + "icon": "status_success", + "text": "Passed", + "label": "passed", + "group": "success", + "tooltip": "passed", + "has_details": false, + "details_path": "/cluttrdev/gitlab-exporter/-/pipelines/1053688581", + "illustration": null, + "favicon": "/assets/ci_favicons/favicon_status_success-8451333011eee8ce9f2ab25dc487fe24a8758c694827a582f17f42b0a90446a2.png" + }, + "name": null +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053688581/bridges.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053688581/bridges.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053688581/bridges.json @@ -0,0 +1 @@ +[] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053688581/jobs.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053688581/jobs.json new file mode 100644 index 0000000..c3ffbc9 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053688581/jobs.json @@ -0,0 +1,402 @@ +[ + { + "id": 5408866487, + "status": "success", + "stage": "test", + "name": "test", + "ref": "gitlab-ci", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2023-10-29T11:36:32.099Z", + "started_at": "2023-10-29T11:38:59.801Z", + "finished_at": "2023-10-29T11:40:18.696Z", + "erased_at": null, + "duration": 78.894884, + "queued_duration": 0.175087, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "6c38aeec7b2953bdab95538cb1d15ffef6e38d8f", + "short_id": "6c38aeec", + "created_at": "2023-10-29T12:36:25.000+01:00", + "parent_ids": [ + "bb84d2bdfec6dea2d6f8ac64f242e01c149a31b8" + ], + "title": "Fix deduplication task tests", + "message": "Fix deduplication task tests\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-10-29T12:36:25.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-10-29T12:36:25.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/6c38aeec7b2953bdab95538cb1d15ffef6e38d8f" + }, + "pipeline": { + "id": 1053688581, + "iid": 4, + "project_id": 50817395, + "sha": "6c38aeec7b2953bdab95538cb1d15ffef6e38d8f", + "ref": "gitlab-ci", + "status": "success", + "source": "push", + "created_at": "2023-10-29T11:36:32.053Z", + "updated_at": "2023-10-29T11:40:18.807Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1053688581" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5408866487", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 6221, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270848, + "description": "2-green.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.66", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": false, + "status": "offline" + }, + "artifacts_expire_at": "2023-11-28T11:40:15.340Z", + "archived": false, + "tag_list": [] + }, + { + "id": 5408866486, + "status": "success", + "stage": "build", + "name": "build", + "ref": "gitlab-ci", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2023-10-29T11:36:32.085Z", + "started_at": "2023-10-29T11:37:52.283Z", + "finished_at": "2023-10-29T11:38:59.508Z", + "erased_at": null, + "duration": 67.224593, + "queued_duration": 0.591769, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "6c38aeec7b2953bdab95538cb1d15ffef6e38d8f", + "short_id": "6c38aeec", + "created_at": "2023-10-29T12:36:25.000+01:00", + "parent_ids": [ + "bb84d2bdfec6dea2d6f8ac64f242e01c149a31b8" + ], + "title": "Fix deduplication task tests", + "message": "Fix deduplication task tests\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-10-29T12:36:25.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-10-29T12:36:25.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/6c38aeec7b2953bdab95538cb1d15ffef6e38d8f" + }, + "pipeline": { + "id": 1053688581, + "iid": 4, + "project_id": 50817395, + "sha": "6c38aeec7b2953bdab95538cb1d15ffef6e38d8f", + "ref": "gitlab-ci", + "status": "success", + "source": "push", + "created_at": "2023-10-29T11:36:32.053Z", + "updated_at": "2023-10-29T11:40:18.807Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1053688581" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5408866486", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 3879, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270857, + "description": "4-green.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.252", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": false, + "status": "offline" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 5408866485, + "status": "success", + "stage": "lint", + "name": "vet", + "ref": "gitlab-ci", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2023-10-29T11:36:32.072Z", + "started_at": "2023-10-29T11:36:32.720Z", + "finished_at": "2023-10-29T11:37:47.109Z", + "erased_at": null, + "duration": 74.389004, + "queued_duration": 0.211377, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "6c38aeec7b2953bdab95538cb1d15ffef6e38d8f", + "short_id": "6c38aeec", + "created_at": "2023-10-29T12:36:25.000+01:00", + "parent_ids": [ + "bb84d2bdfec6dea2d6f8ac64f242e01c149a31b8" + ], + "title": "Fix deduplication task tests", + "message": "Fix deduplication task tests\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-10-29T12:36:25.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-10-29T12:36:25.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/6c38aeec7b2953bdab95538cb1d15ffef6e38d8f" + }, + "pipeline": { + "id": 1053688581, + "iid": 4, + "project_id": 50817395, + "sha": "6c38aeec7b2953bdab95538cb1d15ffef6e38d8f", + "ref": "gitlab-ci", + "status": "success", + "source": "push", + "created_at": "2023-10-29T11:36:32.053Z", + "updated_at": "2023-10-29T11:40:18.807Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1053688581" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5408866485", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 3929, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270848, + "description": "2-green.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.66", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": false, + "status": "offline" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 5408866484, + "status": "success", + "stage": "lint", + "name": "lint", + "ref": "gitlab-ci", + "tag": false, + "coverage": null, + "allow_failure": true, + "created_at": "2023-10-29T11:36:32.064Z", + "started_at": "2023-10-29T11:36:32.602Z", + "finished_at": "2023-10-29T11:37:51.562Z", + "erased_at": null, + "duration": 78.959847, + "queued_duration": 0.143891, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "6c38aeec7b2953bdab95538cb1d15ffef6e38d8f", + "short_id": "6c38aeec", + "created_at": "2023-10-29T12:36:25.000+01:00", + "parent_ids": [ + "bb84d2bdfec6dea2d6f8ac64f242e01c149a31b8" + ], + "title": "Fix deduplication task tests", + "message": "Fix deduplication task tests\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-10-29T12:36:25.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-10-29T12:36:25.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/6c38aeec7b2953bdab95538cb1d15ffef6e38d8f" + }, + "pipeline": { + "id": 1053688581, + "iid": 4, + "project_id": 50817395, + "sha": "6c38aeec7b2953bdab95538cb1d15ffef6e38d8f", + "ref": "gitlab-ci", + "status": "success", + "source": "push", + "created_at": "2023-10-29T11:36:32.053Z", + "updated_at": "2023-10-29T11:40:18.807Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1053688581" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5408866484", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 2231, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270845, + "description": "1-green.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.248", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": false, + "status": "offline" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + } +] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053688581/test_report.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053688581/test_report.json new file mode 100644 index 0000000..6728c4e --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053688581/test_report.json @@ -0,0 +1,9 @@ +{ + "total_time": 0, + "total_count": 0, + "success_count": 0, + "failed_count": 0, + "skipped_count": 0, + "error_count": 0, + "test_suites": [] +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053688581/test_report_summary.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053688581/test_report_summary.json new file mode 100644 index 0000000..aa9246d --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053688581/test_report_summary.json @@ -0,0 +1,26 @@ +{ + "total": { + "time": 0.0, + "count": 18, + "success": 18, + "failed": 0, + "skipped": 0, + "error": 0, + "suite_error": null + }, + "test_suites": [ + { + "name": "test", + "total_time": 0.0, + "total_count": 18, + "success_count": 18, + "failed_count": 0, + "skipped_count": 0, + "error_count": 0, + "build_ids": [ + 5408866487 + ], + "suite_error": null + } + ] +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053714541.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053714541.json new file mode 100644 index 0000000..3d5fb5e --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053714541.json @@ -0,0 +1,42 @@ +{ + "id": 1053714541, + "iid": 5, + "project_id": 50817395, + "sha": "3b9ddfd61ffd847c3cc841b19a2a3d694531a02e", + "ref": "gitlab-ci", + "status": "failed", + "source": "push", + "created_at": "2023-10-29T12:38:46.934Z", + "updated_at": "2023-10-29T12:38:46.934Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1053714541", + "before_sha": "6c38aeec7b2953bdab95538cb1d15ffef6e38d8f", + "tag": false, + "yaml_errors": "default config contains unknown keys: variables", + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev" + }, + "started_at": null, + "finished_at": "2023-10-29T12:38:46.933Z", + "committed_at": null, + "duration": null, + "queued_duration": null, + "coverage": null, + "detailed_status": { + "icon": "status_failed", + "text": "Failed", + "label": "failed", + "group": "failed", + "tooltip": "failed", + "has_details": false, + "details_path": "/cluttrdev/gitlab-exporter/-/pipelines/1053714541", + "illustration": null, + "favicon": "/assets/ci_favicons/favicon_status_failed-41304d7f7e3828808b0c26771f0309e55296819a9beea3ea9fbf6689d9857c12.png" + }, + "name": null +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053714541/bridges.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053714541/bridges.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053714541/bridges.json @@ -0,0 +1 @@ +[] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053714541/jobs.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053714541/jobs.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053714541/jobs.json @@ -0,0 +1 @@ +[] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053714541/test_report.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053714541/test_report.json new file mode 100644 index 0000000..6728c4e --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053714541/test_report.json @@ -0,0 +1,9 @@ +{ + "total_time": 0, + "total_count": 0, + "success_count": 0, + "failed_count": 0, + "skipped_count": 0, + "error_count": 0, + "test_suites": [] +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053714541/test_report_summary.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053714541/test_report_summary.json new file mode 100644 index 0000000..6e39e02 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053714541/test_report_summary.json @@ -0,0 +1,12 @@ +{ + "total": { + "time": 0, + "count": 0, + "success": 0, + "failed": 0, + "skipped": 0, + "error": 0, + "suite_error": null + }, + "test_suites": [] +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053715873.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053715873.json new file mode 100644 index 0000000..39b103b --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053715873.json @@ -0,0 +1,42 @@ +{ + "id": 1053715873, + "iid": 6, + "project_id": 50817395, + "sha": "f6e403ee0c612b445be509209e067a2c33f48949", + "ref": "gitlab-ci", + "status": "failed", + "source": "push", + "created_at": "2023-10-29T12:41:29.071Z", + "updated_at": "2023-10-29T12:45:44.365Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1053715873", + "before_sha": "3b9ddfd61ffd847c3cc841b19a2a3d694531a02e", + "tag": false, + "yaml_errors": null, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev" + }, + "started_at": "2023-10-29T12:41:30.027Z", + "finished_at": "2023-10-29T12:45:44.358Z", + "committed_at": null, + "duration": 253, + "queued_duration": null, + "coverage": null, + "detailed_status": { + "icon": "status_failed", + "text": "Failed", + "label": "failed", + "group": "failed", + "tooltip": "failed", + "has_details": false, + "details_path": "/cluttrdev/gitlab-exporter/-/pipelines/1053715873", + "illustration": null, + "favicon": "/assets/ci_favicons/favicon_status_failed-41304d7f7e3828808b0c26771f0309e55296819a9beea3ea9fbf6689d9857c12.png" + }, + "name": null +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053715873/bridges.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053715873/bridges.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053715873/bridges.json @@ -0,0 +1 @@ +[] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053715873/jobs.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053715873/jobs.json new file mode 100644 index 0000000..7dd47af --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053715873/jobs.json @@ -0,0 +1,503 @@ +[ + { + "id": 5409002397, + "status": "failed", + "stage": "test", + "name": "test", + "ref": "gitlab-ci", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2023-10-29T12:41:29.108Z", + "started_at": "2023-10-29T12:44:50.150Z", + "finished_at": "2023-10-29T12:45:44.277Z", + "erased_at": null, + "duration": 54.126573, + "queued_duration": 0.318156, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "f6e403ee0c612b445be509209e067a2c33f48949", + "short_id": "f6e403ee", + "created_at": "2023-10-29T13:41:15.000+01:00", + "parent_ids": [ + "6c38aeec7b2953bdab95538cb1d15ffef6e38d8f" + ], + "title": "Cache gopath in ci", + "message": "Cache gopath in ci\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-10-29T13:38:41.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-10-29T13:41:15.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/f6e403ee0c612b445be509209e067a2c33f48949" + }, + "pipeline": { + "id": 1053715873, + "iid": 6, + "project_id": 50817395, + "sha": "f6e403ee0c612b445be509209e067a2c33f48949", + "ref": "gitlab-ci", + "status": "failed", + "source": "push", + "created_at": "2023-10-29T12:41:29.071Z", + "updated_at": "2023-10-29T12:45:44.365Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1053715873" + }, + "failure_reason": "script_failure", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5409002397", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 3758, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270845, + "description": "1-green.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.248", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": false, + "status": "offline" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 5409002396, + "status": "success", + "stage": "build", + "name": "build", + "ref": "gitlab-ci", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2023-10-29T12:41:29.101Z", + "started_at": "2023-10-29T12:43:36.734Z", + "finished_at": "2023-10-29T12:44:49.706Z", + "erased_at": null, + "duration": 72.971892, + "queued_duration": 0.202533, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "f6e403ee0c612b445be509209e067a2c33f48949", + "short_id": "f6e403ee", + "created_at": "2023-10-29T13:41:15.000+01:00", + "parent_ids": [ + "6c38aeec7b2953bdab95538cb1d15ffef6e38d8f" + ], + "title": "Cache gopath in ci", + "message": "Cache gopath in ci\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-10-29T13:38:41.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-10-29T13:41:15.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/f6e403ee0c612b445be509209e067a2c33f48949" + }, + "pipeline": { + "id": 1053715873, + "iid": 6, + "project_id": 50817395, + "sha": "f6e403ee0c612b445be509209e067a2c33f48949", + "ref": "gitlab-ci", + "status": "failed", + "source": "push", + "created_at": "2023-10-29T12:41:29.071Z", + "updated_at": "2023-10-29T12:45:44.365Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1053715873" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5409002396", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 2627, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270859, + "description": "5-green.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.249", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": false, + "status": "offline" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 5409002395, + "status": "success", + "stage": "lint", + "name": "vet", + "ref": "gitlab-ci", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2023-10-29T12:41:29.093Z", + "started_at": "2023-10-29T12:42:11.019Z", + "finished_at": "2023-10-29T12:43:28.722Z", + "erased_at": null, + "duration": 77.702728, + "queued_duration": 0.290245, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "f6e403ee0c612b445be509209e067a2c33f48949", + "short_id": "f6e403ee", + "created_at": "2023-10-29T13:41:15.000+01:00", + "parent_ids": [ + "6c38aeec7b2953bdab95538cb1d15ffef6e38d8f" + ], + "title": "Cache gopath in ci", + "message": "Cache gopath in ci\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-10-29T13:38:41.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-10-29T13:41:15.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/f6e403ee0c612b445be509209e067a2c33f48949" + }, + "pipeline": { + "id": 1053715873, + "iid": 6, + "project_id": 50817395, + "sha": "f6e403ee0c612b445be509209e067a2c33f48949", + "ref": "gitlab-ci", + "status": "failed", + "source": "push", + "created_at": "2023-10-29T12:41:29.071Z", + "updated_at": "2023-10-29T12:45:44.365Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1053715873" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5409002395", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 2629, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270859, + "description": "5-green.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.249", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": false, + "status": "offline" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 5409002394, + "status": "success", + "stage": "lint", + "name": "lint", + "ref": "gitlab-ci", + "tag": false, + "coverage": null, + "allow_failure": true, + "created_at": "2023-10-29T12:41:29.086Z", + "started_at": "2023-10-29T12:42:10.973Z", + "finished_at": "2023-10-29T12:43:36.407Z", + "erased_at": null, + "duration": 85.434041, + "queued_duration": 0.299834, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "f6e403ee0c612b445be509209e067a2c33f48949", + "short_id": "f6e403ee", + "created_at": "2023-10-29T13:41:15.000+01:00", + "parent_ids": [ + "6c38aeec7b2953bdab95538cb1d15ffef6e38d8f" + ], + "title": "Cache gopath in ci", + "message": "Cache gopath in ci\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-10-29T13:38:41.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-10-29T13:41:15.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/f6e403ee0c612b445be509209e067a2c33f48949" + }, + "pipeline": { + "id": 1053715873, + "iid": 6, + "project_id": 50817395, + "sha": "f6e403ee0c612b445be509209e067a2c33f48949", + "ref": "gitlab-ci", + "status": "failed", + "source": "push", + "created_at": "2023-10-29T12:41:29.071Z", + "updated_at": "2023-10-29T12:45:44.365Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1053715873" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5409002394", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 2784, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270848, + "description": "2-green.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.66", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": false, + "status": "offline" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 5409002393, + "status": "success", + "stage": ".pre", + "name": "download", + "ref": "gitlab-ci", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2023-10-29T12:41:29.078Z", + "started_at": "2023-10-29T12:41:29.888Z", + "finished_at": "2023-10-29T12:42:10.495Z", + "erased_at": null, + "duration": 40.607284, + "queued_duration": 0.376031, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "f6e403ee0c612b445be509209e067a2c33f48949", + "short_id": "f6e403ee", + "created_at": "2023-10-29T13:41:15.000+01:00", + "parent_ids": [ + "6c38aeec7b2953bdab95538cb1d15ffef6e38d8f" + ], + "title": "Cache gopath in ci", + "message": "Cache gopath in ci\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-10-29T13:38:41.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-10-29T13:41:15.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/f6e403ee0c612b445be509209e067a2c33f48949" + }, + "pipeline": { + "id": 1053715873, + "iid": 6, + "project_id": 50817395, + "sha": "f6e403ee0c612b445be509209e067a2c33f48949", + "ref": "gitlab-ci", + "status": "failed", + "source": "push", + "created_at": "2023-10-29T12:41:29.071Z", + "updated_at": "2023-10-29T12:45:44.365Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1053715873" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5409002393", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 2808, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270848, + "description": "2-green.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.66", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": false, + "status": "offline" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + } +] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053715873/test_report.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053715873/test_report.json new file mode 100644 index 0000000..6728c4e --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053715873/test_report.json @@ -0,0 +1,9 @@ +{ + "total_time": 0, + "total_count": 0, + "success_count": 0, + "failed_count": 0, + "skipped_count": 0, + "error_count": 0, + "test_suites": [] +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053715873/test_report_summary.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053715873/test_report_summary.json new file mode 100644 index 0000000..6e39e02 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053715873/test_report_summary.json @@ -0,0 +1,12 @@ +{ + "total": { + "time": 0, + "count": 0, + "success": 0, + "failed": 0, + "skipped": 0, + "error": 0, + "suite_error": null + }, + "test_suites": [] +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053733851.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053733851.json new file mode 100644 index 0000000..aa5beca --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053733851.json @@ -0,0 +1,42 @@ +{ + "id": 1053733851, + "iid": 7, + "project_id": 50817395, + "sha": "0f70911cf8be855821e2eacd73762dbd2b07ff0b", + "ref": "gitlab-ci", + "status": "failed", + "source": "push", + "created_at": "2023-10-29T13:21:23.459Z", + "updated_at": "2023-10-29T13:21:50.418Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1053733851", + "before_sha": "f6e403ee0c612b445be509209e067a2c33f48949", + "tag": false, + "yaml_errors": null, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev" + }, + "started_at": "2023-10-29T13:21:26.350Z", + "finished_at": "2023-10-29T13:21:50.407Z", + "committed_at": null, + "duration": 23, + "queued_duration": 2, + "coverage": null, + "detailed_status": { + "icon": "status_failed", + "text": "Failed", + "label": "failed", + "group": "failed", + "tooltip": "failed", + "has_details": false, + "details_path": "/cluttrdev/gitlab-exporter/-/pipelines/1053733851", + "illustration": null, + "favicon": "/assets/ci_favicons/favicon_status_failed-41304d7f7e3828808b0c26771f0309e55296819a9beea3ea9fbf6689d9857c12.png" + }, + "name": null +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053733851/bridges.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053733851/bridges.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053733851/bridges.json @@ -0,0 +1 @@ +[] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053733851/jobs.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053733851/jobs.json new file mode 100644 index 0000000..22efa44 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053733851/jobs.json @@ -0,0 +1,431 @@ +[ + { + "id": 5409135575, + "status": "skipped", + "stage": "test", + "name": "test", + "ref": "gitlab-ci", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2023-10-29T13:21:25.163Z", + "started_at": null, + "finished_at": null, + "erased_at": null, + "duration": null, + "queued_duration": null, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "0f70911cf8be855821e2eacd73762dbd2b07ff0b", + "short_id": "0f70911c", + "created_at": "2023-10-29T14:21:19.000+01:00", + "parent_ids": [ + "6c38aeec7b2953bdab95538cb1d15ffef6e38d8f" + ], + "title": "Cache gopath in ci", + "message": "Cache gopath in ci\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-10-29T13:38:41.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-10-29T14:21:19.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/0f70911cf8be855821e2eacd73762dbd2b07ff0b" + }, + "pipeline": { + "id": 1053733851, + "iid": 7, + "project_id": 50817395, + "sha": "0f70911cf8be855821e2eacd73762dbd2b07ff0b", + "ref": "gitlab-ci", + "status": "failed", + "source": "push", + "created_at": "2023-10-29T13:21:23.459Z", + "updated_at": "2023-10-29T13:21:50.418Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1053733851" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5409135575", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [], + "runner": null, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 5409135574, + "status": "skipped", + "stage": "build", + "name": "build", + "ref": "gitlab-ci", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2023-10-29T13:21:25.138Z", + "started_at": null, + "finished_at": null, + "erased_at": null, + "duration": null, + "queued_duration": null, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "0f70911cf8be855821e2eacd73762dbd2b07ff0b", + "short_id": "0f70911c", + "created_at": "2023-10-29T14:21:19.000+01:00", + "parent_ids": [ + "6c38aeec7b2953bdab95538cb1d15ffef6e38d8f" + ], + "title": "Cache gopath in ci", + "message": "Cache gopath in ci\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-10-29T13:38:41.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-10-29T14:21:19.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/0f70911cf8be855821e2eacd73762dbd2b07ff0b" + }, + "pipeline": { + "id": 1053733851, + "iid": 7, + "project_id": 50817395, + "sha": "0f70911cf8be855821e2eacd73762dbd2b07ff0b", + "ref": "gitlab-ci", + "status": "failed", + "source": "push", + "created_at": "2023-10-29T13:21:23.459Z", + "updated_at": "2023-10-29T13:21:50.418Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1053733851" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5409135574", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [], + "runner": null, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 5409135572, + "status": "skipped", + "stage": "lint", + "name": "vet", + "ref": "gitlab-ci", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2023-10-29T13:21:25.095Z", + "started_at": null, + "finished_at": null, + "erased_at": null, + "duration": null, + "queued_duration": null, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "0f70911cf8be855821e2eacd73762dbd2b07ff0b", + "short_id": "0f70911c", + "created_at": "2023-10-29T14:21:19.000+01:00", + "parent_ids": [ + "6c38aeec7b2953bdab95538cb1d15ffef6e38d8f" + ], + "title": "Cache gopath in ci", + "message": "Cache gopath in ci\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-10-29T13:38:41.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-10-29T14:21:19.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/0f70911cf8be855821e2eacd73762dbd2b07ff0b" + }, + "pipeline": { + "id": 1053733851, + "iid": 7, + "project_id": 50817395, + "sha": "0f70911cf8be855821e2eacd73762dbd2b07ff0b", + "ref": "gitlab-ci", + "status": "failed", + "source": "push", + "created_at": "2023-10-29T13:21:23.459Z", + "updated_at": "2023-10-29T13:21:50.418Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1053733851" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5409135572", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [], + "runner": null, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 5409135571, + "status": "skipped", + "stage": "lint", + "name": "lint", + "ref": "gitlab-ci", + "tag": false, + "coverage": null, + "allow_failure": true, + "created_at": "2023-10-29T13:21:25.081Z", + "started_at": null, + "finished_at": null, + "erased_at": null, + "duration": null, + "queued_duration": null, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "0f70911cf8be855821e2eacd73762dbd2b07ff0b", + "short_id": "0f70911c", + "created_at": "2023-10-29T14:21:19.000+01:00", + "parent_ids": [ + "6c38aeec7b2953bdab95538cb1d15ffef6e38d8f" + ], + "title": "Cache gopath in ci", + "message": "Cache gopath in ci\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-10-29T13:38:41.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-10-29T14:21:19.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/0f70911cf8be855821e2eacd73762dbd2b07ff0b" + }, + "pipeline": { + "id": 1053733851, + "iid": 7, + "project_id": 50817395, + "sha": "0f70911cf8be855821e2eacd73762dbd2b07ff0b", + "ref": "gitlab-ci", + "status": "failed", + "source": "push", + "created_at": "2023-10-29T13:21:23.459Z", + "updated_at": "2023-10-29T13:21:50.418Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1053733851" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5409135571", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [], + "runner": null, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 5409135570, + "status": "failed", + "stage": ".pre", + "name": "download", + "ref": "gitlab-ci", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2023-10-29T13:21:25.054Z", + "started_at": "2023-10-29T13:21:26.185Z", + "finished_at": "2023-10-29T13:21:50.105Z", + "erased_at": null, + "duration": 23.919466, + "queued_duration": 0.45745, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "0f70911cf8be855821e2eacd73762dbd2b07ff0b", + "short_id": "0f70911c", + "created_at": "2023-10-29T14:21:19.000+01:00", + "parent_ids": [ + "6c38aeec7b2953bdab95538cb1d15ffef6e38d8f" + ], + "title": "Cache gopath in ci", + "message": "Cache gopath in ci\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-10-29T13:38:41.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-10-29T14:21:19.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/0f70911cf8be855821e2eacd73762dbd2b07ff0b" + }, + "pipeline": { + "id": 1053733851, + "iid": 7, + "project_id": 50817395, + "sha": "0f70911cf8be855821e2eacd73762dbd2b07ff0b", + "ref": "gitlab-ci", + "status": "failed", + "source": "push", + "created_at": "2023-10-29T13:21:23.459Z", + "updated_at": "2023-10-29T13:21:50.418Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1053733851" + }, + "failure_reason": "script_failure", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5409135570", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 1101, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270848, + "description": "2-green.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.66", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": false, + "status": "offline" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + } +] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053733851/test_report.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053733851/test_report.json new file mode 100644 index 0000000..6728c4e --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053733851/test_report.json @@ -0,0 +1,9 @@ +{ + "total_time": 0, + "total_count": 0, + "success_count": 0, + "failed_count": 0, + "skipped_count": 0, + "error_count": 0, + "test_suites": [] +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053733851/test_report_summary.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053733851/test_report_summary.json new file mode 100644 index 0000000..6e39e02 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053733851/test_report_summary.json @@ -0,0 +1,12 @@ +{ + "total": { + "time": 0, + "count": 0, + "success": 0, + "failed": 0, + "skipped": 0, + "error": 0, + "suite_error": null + }, + "test_suites": [] +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053741635.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053741635.json new file mode 100644 index 0000000..2b9a8cb --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053741635.json @@ -0,0 +1,42 @@ +{ + "id": 1053741635, + "iid": 8, + "project_id": 50817395, + "sha": "2224c54abb7d48dac246cf4a393d87a232845488", + "ref": "gitlab-ci", + "status": "success", + "source": "push", + "created_at": "2023-10-29T13:52:08.366Z", + "updated_at": "2023-10-29T13:56:49.682Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1053741635", + "before_sha": "0f70911cf8be855821e2eacd73762dbd2b07ff0b", + "tag": false, + "yaml_errors": null, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev" + }, + "started_at": "2023-10-29T13:52:09.062Z", + "finished_at": "2023-10-29T13:56:49.675Z", + "committed_at": null, + "duration": 279, + "queued_duration": null, + "coverage": null, + "detailed_status": { + "icon": "status_success", + "text": "Passed", + "label": "passed", + "group": "success", + "tooltip": "passed", + "has_details": false, + "details_path": "/cluttrdev/gitlab-exporter/-/pipelines/1053741635", + "illustration": null, + "favicon": "/assets/ci_favicons/favicon_status_success-8451333011eee8ce9f2ab25dc487fe24a8758c694827a582f17f42b0a90446a2.png" + }, + "name": null +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053741635/bridges.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053741635/bridges.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053741635/bridges.json @@ -0,0 +1 @@ +[] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053741635/jobs.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053741635/jobs.json new file mode 100644 index 0000000..722cf97 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053741635/jobs.json @@ -0,0 +1,502 @@ +[ + { + "id": 5409171542, + "status": "success", + "stage": "test", + "name": "test", + "ref": "gitlab-ci", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2023-10-29T13:52:08.407Z", + "started_at": "2023-10-29T13:55:28.009Z", + "finished_at": "2023-10-29T13:56:49.539Z", + "erased_at": null, + "duration": 81.530193, + "queued_duration": 0.341961, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "2224c54abb7d48dac246cf4a393d87a232845488", + "short_id": "2224c54a", + "created_at": "2023-10-29T14:52:03.000+01:00", + "parent_ids": [ + "6c38aeec7b2953bdab95538cb1d15ffef6e38d8f" + ], + "title": "Cache gopath in ci", + "message": "Cache gopath in ci\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-10-29T13:38:41.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-10-29T14:52:03.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/2224c54abb7d48dac246cf4a393d87a232845488" + }, + "pipeline": { + "id": 1053741635, + "iid": 8, + "project_id": 50817395, + "sha": "2224c54abb7d48dac246cf4a393d87a232845488", + "ref": "gitlab-ci", + "status": "success", + "source": "push", + "created_at": "2023-10-29T13:52:08.366Z", + "updated_at": "2023-10-29T13:56:49.682Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1053741635" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5409171542", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 5514, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270859, + "description": "5-green.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.249", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": false, + "status": "offline" + }, + "artifacts_expire_at": "2023-11-28T13:56:47.091Z", + "archived": false, + "tag_list": [] + }, + { + "id": 5409171541, + "status": "success", + "stage": "build", + "name": "build", + "ref": "gitlab-ci", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2023-10-29T13:52:08.400Z", + "started_at": "2023-10-29T13:54:11.752Z", + "finished_at": "2023-10-29T13:55:27.532Z", + "erased_at": null, + "duration": 75.779332, + "queued_duration": 0.336803, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "2224c54abb7d48dac246cf4a393d87a232845488", + "short_id": "2224c54a", + "created_at": "2023-10-29T14:52:03.000+01:00", + "parent_ids": [ + "6c38aeec7b2953bdab95538cb1d15ffef6e38d8f" + ], + "title": "Cache gopath in ci", + "message": "Cache gopath in ci\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-10-29T13:38:41.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-10-29T14:52:03.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/2224c54abb7d48dac246cf4a393d87a232845488" + }, + "pipeline": { + "id": 1053741635, + "iid": 8, + "project_id": 50817395, + "sha": "2224c54abb7d48dac246cf4a393d87a232845488", + "ref": "gitlab-ci", + "status": "success", + "source": "push", + "created_at": "2023-10-29T13:52:08.366Z", + "updated_at": "2023-10-29T13:56:49.682Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1053741635" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5409171541", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 2627, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270857, + "description": "4-green.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.252", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": false, + "status": "offline" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 5409171540, + "status": "success", + "stage": "lint", + "name": "vet", + "ref": "gitlab-ci", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2023-10-29T13:52:08.392Z", + "started_at": "2023-10-29T13:52:43.648Z", + "finished_at": "2023-10-29T13:54:01.836Z", + "erased_at": null, + "duration": 78.18763, + "queued_duration": 0.16711, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "2224c54abb7d48dac246cf4a393d87a232845488", + "short_id": "2224c54a", + "created_at": "2023-10-29T14:52:03.000+01:00", + "parent_ids": [ + "6c38aeec7b2953bdab95538cb1d15ffef6e38d8f" + ], + "title": "Cache gopath in ci", + "message": "Cache gopath in ci\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-10-29T13:38:41.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-10-29T14:52:03.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/2224c54abb7d48dac246cf4a393d87a232845488" + }, + "pipeline": { + "id": 1053741635, + "iid": 8, + "project_id": 50817395, + "sha": "2224c54abb7d48dac246cf4a393d87a232845488", + "ref": "gitlab-ci", + "status": "success", + "source": "push", + "created_at": "2023-10-29T13:52:08.366Z", + "updated_at": "2023-10-29T13:56:49.682Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1053741635" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5409171540", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 2629, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270857, + "description": "4-green.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.252", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": false, + "status": "offline" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 5409171539, + "status": "success", + "stage": "lint", + "name": "lint", + "ref": "gitlab-ci", + "tag": false, + "coverage": null, + "allow_failure": true, + "created_at": "2023-10-29T13:52:08.386Z", + "started_at": "2023-10-29T13:52:43.624Z", + "finished_at": "2023-10-29T13:54:11.116Z", + "erased_at": null, + "duration": 87.492219, + "queued_duration": 0.199647, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "2224c54abb7d48dac246cf4a393d87a232845488", + "short_id": "2224c54a", + "created_at": "2023-10-29T14:52:03.000+01:00", + "parent_ids": [ + "6c38aeec7b2953bdab95538cb1d15ffef6e38d8f" + ], + "title": "Cache gopath in ci", + "message": "Cache gopath in ci\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-10-29T13:38:41.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-10-29T14:52:03.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/2224c54abb7d48dac246cf4a393d87a232845488" + }, + "pipeline": { + "id": 1053741635, + "iid": 8, + "project_id": 50817395, + "sha": "2224c54abb7d48dac246cf4a393d87a232845488", + "ref": "gitlab-ci", + "status": "success", + "source": "push", + "created_at": "2023-10-29T13:52:08.366Z", + "updated_at": "2023-10-29T13:56:49.682Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1053741635" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5409171539", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 2782, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270852, + "description": "3-green.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.251", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": false, + "status": "offline" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 5409171538, + "status": "success", + "stage": ".pre", + "name": "download", + "ref": "gitlab-ci", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2023-10-29T13:52:08.376Z", + "started_at": "2023-10-29T13:52:08.913Z", + "finished_at": "2023-10-29T13:52:43.305Z", + "erased_at": null, + "duration": 34.392297, + "queued_duration": 0.182407, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "2224c54abb7d48dac246cf4a393d87a232845488", + "short_id": "2224c54a", + "created_at": "2023-10-29T14:52:03.000+01:00", + "parent_ids": [ + "6c38aeec7b2953bdab95538cb1d15ffef6e38d8f" + ], + "title": "Cache gopath in ci", + "message": "Cache gopath in ci\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-10-29T13:38:41.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-10-29T14:52:03.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/2224c54abb7d48dac246cf4a393d87a232845488" + }, + "pipeline": { + "id": 1053741635, + "iid": 8, + "project_id": 50817395, + "sha": "2224c54abb7d48dac246cf4a393d87a232845488", + "ref": "gitlab-ci", + "status": "success", + "source": "push", + "created_at": "2023-10-29T13:52:08.366Z", + "updated_at": "2023-10-29T13:56:49.682Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1053741635" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5409171538", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 2806, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270859, + "description": "5-green.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.249", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": false, + "status": "offline" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + } +] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053741635/test_report.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053741635/test_report.json new file mode 100644 index 0000000..6728c4e --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053741635/test_report.json @@ -0,0 +1,9 @@ +{ + "total_time": 0, + "total_count": 0, + "success_count": 0, + "failed_count": 0, + "skipped_count": 0, + "error_count": 0, + "test_suites": [] +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053741635/test_report_summary.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053741635/test_report_summary.json new file mode 100644 index 0000000..7399065 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1053741635/test_report_summary.json @@ -0,0 +1,26 @@ +{ + "total": { + "time": 0.0, + "count": 18, + "success": 18, + "failed": 0, + "skipped": 0, + "error": 0, + "suite_error": null + }, + "test_suites": [ + { + "name": "test", + "total_time": 0.0, + "total_count": 18, + "success_count": 18, + "failed_count": 0, + "skipped_count": 0, + "error_count": 0, + "build_ids": [ + 5409171542 + ], + "suite_error": null + } + ] +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1058892793.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1058892793.json new file mode 100644 index 0000000..a77f6ea --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1058892793.json @@ -0,0 +1,42 @@ +{ + "id": 1058892793, + "iid": 9, + "project_id": 50817395, + "sha": "249039544119d7673d22b7979942c079c3cfe4fa", + "ref": "gitlab-ci", + "status": "success", + "source": "push", + "created_at": "2023-11-02T12:47:05.694Z", + "updated_at": "2023-11-02T12:51:39.855Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1058892793", + "before_sha": "2224c54abb7d48dac246cf4a393d87a232845488", + "tag": false, + "yaml_errors": null, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev" + }, + "started_at": "2023-11-02T12:47:07.399Z", + "finished_at": "2023-11-02T12:51:39.844Z", + "committed_at": null, + "duration": 271, + "queued_duration": 1, + "coverage": null, + "detailed_status": { + "icon": "status_success", + "text": "Passed", + "label": "passed", + "group": "success", + "tooltip": "passed", + "has_details": false, + "details_path": "/cluttrdev/gitlab-exporter/-/pipelines/1058892793", + "illustration": null, + "favicon": "/assets/ci_favicons/favicon_status_success-8451333011eee8ce9f2ab25dc487fe24a8758c694827a582f17f42b0a90446a2.png" + }, + "name": null +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1058892793/bridges.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1058892793/bridges.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1058892793/bridges.json @@ -0,0 +1 @@ +[] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1058892793/jobs.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1058892793/jobs.json new file mode 100644 index 0000000..905d3b9 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1058892793/jobs.json @@ -0,0 +1,408 @@ +[ + { + "id": 5445656251, + "status": "success", + "stage": "test", + "name": "test", + "ref": "gitlab-ci", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2023-11-02T12:47:05.839Z", + "started_at": "2023-11-02T12:50:17.368Z", + "finished_at": "2023-11-02T12:51:39.740Z", + "erased_at": null, + "duration": 82.371882, + "queued_duration": 0.193322, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "249039544119d7673d22b7979942c079c3cfe4fa", + "short_id": "24903954", + "created_at": "2023-11-02T13:46:57.000+01:00", + "parent_ids": [ + "2224c54abb7d48dac246cf4a393d87a232845488" + ], + "title": "Remove vet job since golangci-lint includes it", + "message": "Remove vet job since golangci-lint includes it\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-11-02T13:46:57.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-11-02T13:46:57.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/249039544119d7673d22b7979942c079c3cfe4fa" + }, + "pipeline": { + "id": 1058892793, + "iid": 9, + "project_id": 50817395, + "sha": "249039544119d7673d22b7979942c079c3cfe4fa", + "ref": "gitlab-ci", + "status": "success", + "source": "push", + "created_at": "2023-11-02T12:47:05.694Z", + "updated_at": "2023-11-02T12:51:39.855Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1058892793" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5445656251", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "junit", + "size": 542, + "filename": "junit.xml.gz", + "file_format": "gzip" + }, + { + "file_type": "trace", + "size": 5512, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270852, + "description": "3-green.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.251", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": false, + "status": "offline" + }, + "artifacts_expire_at": "2023-12-02T12:51:37.464Z", + "archived": false, + "tag_list": [] + }, + { + "id": 5445656245, + "status": "success", + "stage": "build", + "name": "build", + "ref": "gitlab-ci", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2023-11-02T12:47:05.808Z", + "started_at": "2023-11-02T12:49:05.156Z", + "finished_at": "2023-11-02T12:50:17.041Z", + "erased_at": null, + "duration": 71.884399, + "queued_duration": 0.18848, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "249039544119d7673d22b7979942c079c3cfe4fa", + "short_id": "24903954", + "created_at": "2023-11-02T13:46:57.000+01:00", + "parent_ids": [ + "2224c54abb7d48dac246cf4a393d87a232845488" + ], + "title": "Remove vet job since golangci-lint includes it", + "message": "Remove vet job since golangci-lint includes it\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-11-02T13:46:57.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-11-02T13:46:57.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/249039544119d7673d22b7979942c079c3cfe4fa" + }, + "pipeline": { + "id": 1058892793, + "iid": 9, + "project_id": 50817395, + "sha": "249039544119d7673d22b7979942c079c3cfe4fa", + "ref": "gitlab-ci", + "status": "success", + "source": "push", + "created_at": "2023-11-02T12:47:05.694Z", + "updated_at": "2023-11-02T12:51:39.855Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1058892793" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5445656245", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 2627, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270845, + "description": "1-green.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.248", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": false, + "status": "offline" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 5445656235, + "status": "success", + "stage": "lint", + "name": "lint", + "ref": "gitlab-ci", + "tag": false, + "coverage": null, + "allow_failure": true, + "created_at": "2023-11-02T12:47:05.768Z", + "started_at": "2023-11-02T12:47:40.152Z", + "finished_at": "2023-11-02T12:49:04.823Z", + "erased_at": null, + "duration": 84.671258, + "queued_duration": 0.269285, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "249039544119d7673d22b7979942c079c3cfe4fa", + "short_id": "24903954", + "created_at": "2023-11-02T13:46:57.000+01:00", + "parent_ids": [ + "2224c54abb7d48dac246cf4a393d87a232845488" + ], + "title": "Remove vet job since golangci-lint includes it", + "message": "Remove vet job since golangci-lint includes it\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-11-02T13:46:57.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-11-02T13:46:57.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/249039544119d7673d22b7979942c079c3cfe4fa" + }, + "pipeline": { + "id": 1058892793, + "iid": 9, + "project_id": 50817395, + "sha": "249039544119d7673d22b7979942c079c3cfe4fa", + "ref": "gitlab-ci", + "status": "success", + "source": "push", + "created_at": "2023-11-02T12:47:05.694Z", + "updated_at": "2023-11-02T12:51:39.855Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1058892793" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5445656235", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 2784, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270859, + "description": "5-green.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.249", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": false, + "status": "offline" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 5445656228, + "status": "success", + "stage": ".pre", + "name": "download", + "ref": "gitlab-ci", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2023-11-02T12:47:05.734Z", + "started_at": "2023-11-02T12:47:06.683Z", + "finished_at": "2023-11-02T12:47:39.593Z", + "erased_at": null, + "duration": 32.910936, + "queued_duration": 0.135521, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "249039544119d7673d22b7979942c079c3cfe4fa", + "short_id": "24903954", + "created_at": "2023-11-02T13:46:57.000+01:00", + "parent_ids": [ + "2224c54abb7d48dac246cf4a393d87a232845488" + ], + "title": "Remove vet job since golangci-lint includes it", + "message": "Remove vet job since golangci-lint includes it\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-11-02T13:46:57.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-11-02T13:46:57.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/249039544119d7673d22b7979942c079c3cfe4fa" + }, + "pipeline": { + "id": 1058892793, + "iid": 9, + "project_id": 50817395, + "sha": "249039544119d7673d22b7979942c079c3cfe4fa", + "ref": "gitlab-ci", + "status": "success", + "source": "push", + "created_at": "2023-11-02T12:47:05.694Z", + "updated_at": "2023-11-02T12:51:39.855Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1058892793" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5445656228", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 2806, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270845, + "description": "1-green.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.248", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": false, + "status": "offline" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + } +] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1058892793/test_report.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1058892793/test_report.json new file mode 100644 index 0000000..107b93d --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1058892793/test_report.json @@ -0,0 +1,202 @@ +{ + "total_time": 0.0, + "total_count": 18, + "success_count": 18, + "failed_count": 0, + "skipped_count": 0, + "error_count": 0, + "test_suites": [ + { + "name": "test", + "total_time": 0.0, + "total_count": 18, + "success_count": 18, + "failed_count": 0, + "skipped_count": 0, + "error_count": 0, + "suite_error": null, + "test_cases": [ + { + "status": "success", + "name": "Test_NewDefault", + "classname": "github.com/cluttrdev/gitlab-clickhouse-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "Test_NewDefaultProjectSettings", + "classname": "github.com/cluttrdev/gitlab-clickhouse-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestLoad_EmptyData", + "classname": "github.com/cluttrdev/gitlab-clickhouse-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestLoad_PartialData", + "classname": "github.com/cluttrdev/gitlab-clickhouse-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestLoad_UnknownData", + "classname": "github.com/cluttrdev/gitlab-clickhouse-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestLoad_InvalidData", + "classname": "github.com/cluttrdev/gitlab-clickhouse-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestLoad_DataWithDefaults", + "classname": "github.com/cluttrdev/gitlab-clickhouse-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestLoad_DataWithProjects", + "classname": "github.com/cluttrdev/gitlab-clickhouse-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestLoad_DataWithCustomServerAddress", + "classname": "github.com/cluttrdev/gitlab-clickhouse-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestPrepareDeduplicateQuery_Minimal", + "classname": "github.com/cluttrdev/gitlab-clickhouse-exporter/test/tasks", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestPrepareDeduplicateQuery_Full", + "classname": "github.com/cluttrdev/gitlab-clickhouse-exporter/test/tasks", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestPrepareDeduplicateQuery_WithFinal", + "classname": "github.com/cluttrdev/gitlab-clickhouse-exporter/test/tasks", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestPrepareDeduplicateQuery_WithThrowIfNoopTrue", + "classname": "github.com/cluttrdev/gitlab-clickhouse-exporter/test/tasks", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestPrepareDeduplicateQuery_WithThrowIfNoopFalse", + "classname": "github.com/cluttrdev/gitlab-clickhouse-exporter/test/tasks", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestPrepareDeduplicateQuery_WithBy", + "classname": "github.com/cluttrdev/gitlab-clickhouse-exporter/test/tasks", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestPrepareDeduplicateQuery_WithSingleExcept", + "classname": "github.com/cluttrdev/gitlab-clickhouse-exporter/test/tasks", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestPrepareDeduplicateQuery_WithMultipleExcept", + "classname": "github.com/cluttrdev/gitlab-clickhouse-exporter/test/tasks", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestPrepareDeduplicateQuery_WithByAndExcept", + "classname": "github.com/cluttrdev/gitlab-clickhouse-exporter/test/tasks", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + } + ] + } + ] +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1058892793/test_report_summary.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1058892793/test_report_summary.json new file mode 100644 index 0000000..6bca3c7 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1058892793/test_report_summary.json @@ -0,0 +1,26 @@ +{ + "total": { + "time": 0.0, + "count": 18, + "success": 18, + "failed": 0, + "skipped": 0, + "error": 0, + "suite_error": null + }, + "test_suites": [ + { + "name": "test", + "total_time": 0.0, + "total_count": 18, + "success_count": 18, + "failed_count": 0, + "skipped_count": 0, + "error_count": 0, + "build_ids": [ + 5445656251 + ], + "suite_error": null + } + ] +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1059953266.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1059953266.json new file mode 100644 index 0000000..9372737 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1059953266.json @@ -0,0 +1,42 @@ +{ + "id": 1059953266, + "iid": 10, + "project_id": 50817395, + "sha": "249039544119d7673d22b7979942c079c3cfe4fa", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2023-11-03T09:22:38.524Z", + "updated_at": "2023-11-03T09:27:24.306Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1059953266", + "before_sha": "f737313386ba9119ebeb2ff7e63ce60917384dd1", + "tag": false, + "yaml_errors": null, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev" + }, + "started_at": "2023-11-03T09:22:39.495Z", + "finished_at": "2023-11-03T09:27:24.295Z", + "committed_at": null, + "duration": 283, + "queued_duration": null, + "coverage": null, + "detailed_status": { + "icon": "status_success", + "text": "Passed", + "label": "passed", + "group": "success", + "tooltip": "passed", + "has_details": false, + "details_path": "/cluttrdev/gitlab-exporter/-/pipelines/1059953266", + "illustration": null, + "favicon": "/assets/ci_favicons/favicon_status_success-8451333011eee8ce9f2ab25dc487fe24a8758c694827a582f17f42b0a90446a2.png" + }, + "name": null +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1059953266/bridges.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1059953266/bridges.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1059953266/bridges.json @@ -0,0 +1 @@ +[] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1059953266/jobs.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1059953266/jobs.json new file mode 100644 index 0000000..0c001f8 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1059953266/jobs.json @@ -0,0 +1,402 @@ +[ + { + "id": 5453437402, + "status": "success", + "stage": "test", + "name": "test", + "ref": "main", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2023-11-03T09:22:38.602Z", + "started_at": "2023-11-03T09:26:01.698Z", + "finished_at": "2023-11-03T09:27:24.168Z", + "erased_at": null, + "duration": 82.470139, + "queued_duration": 0.132422, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "249039544119d7673d22b7979942c079c3cfe4fa", + "short_id": "24903954", + "created_at": "2023-11-02T13:46:57.000+01:00", + "parent_ids": [ + "2224c54abb7d48dac246cf4a393d87a232845488" + ], + "title": "Remove vet job since golangci-lint includes it", + "message": "Remove vet job since golangci-lint includes it\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-11-02T13:46:57.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-11-02T13:46:57.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/249039544119d7673d22b7979942c079c3cfe4fa" + }, + "pipeline": { + "id": 1059953266, + "iid": 10, + "project_id": 50817395, + "sha": "249039544119d7673d22b7979942c079c3cfe4fa", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2023-11-03T09:22:38.524Z", + "updated_at": "2023-11-03T09:27:24.306Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1059953266" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5453437402", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 5482, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270848, + "description": "2-green.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.66", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": false, + "status": "offline" + }, + "artifacts_expire_at": "2023-12-03T09:27:21.781Z", + "archived": false, + "tag_list": [] + }, + { + "id": 5453437399, + "status": "success", + "stage": "build", + "name": "build", + "ref": "main", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2023-11-03T09:22:38.584Z", + "started_at": "2023-11-03T09:24:45.737Z", + "finished_at": "2023-11-03T09:26:01.458Z", + "erased_at": null, + "duration": 75.721347, + "queued_duration": 0.231038, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "249039544119d7673d22b7979942c079c3cfe4fa", + "short_id": "24903954", + "created_at": "2023-11-02T13:46:57.000+01:00", + "parent_ids": [ + "2224c54abb7d48dac246cf4a393d87a232845488" + ], + "title": "Remove vet job since golangci-lint includes it", + "message": "Remove vet job since golangci-lint includes it\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-11-02T13:46:57.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-11-02T13:46:57.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/249039544119d7673d22b7979942c079c3cfe4fa" + }, + "pipeline": { + "id": 1059953266, + "iid": 10, + "project_id": 50817395, + "sha": "249039544119d7673d22b7979942c079c3cfe4fa", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2023-11-03T09:22:38.524Z", + "updated_at": "2023-11-03T09:27:24.306Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1059953266" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5453437399", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 2593, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270852, + "description": "3-green.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.251", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": false, + "status": "offline" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 5453437397, + "status": "success", + "stage": "lint", + "name": "lint", + "ref": "main", + "tag": false, + "coverage": null, + "allow_failure": true, + "created_at": "2023-11-03T09:22:38.569Z", + "started_at": "2023-11-03T09:23:19.713Z", + "finished_at": "2023-11-03T09:24:45.338Z", + "erased_at": null, + "duration": 85.62494, + "queued_duration": 0.152483, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "249039544119d7673d22b7979942c079c3cfe4fa", + "short_id": "24903954", + "created_at": "2023-11-02T13:46:57.000+01:00", + "parent_ids": [ + "2224c54abb7d48dac246cf4a393d87a232845488" + ], + "title": "Remove vet job since golangci-lint includes it", + "message": "Remove vet job since golangci-lint includes it\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-11-02T13:46:57.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-11-02T13:46:57.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/249039544119d7673d22b7979942c079c3cfe4fa" + }, + "pipeline": { + "id": 1059953266, + "iid": 10, + "project_id": 50817395, + "sha": "249039544119d7673d22b7979942c079c3cfe4fa", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2023-11-03T09:22:38.524Z", + "updated_at": "2023-11-03T09:27:24.306Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1059953266" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5453437397", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 2752, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270848, + "description": "2-green.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.66", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": false, + "status": "offline" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 5453437395, + "status": "success", + "stage": ".pre", + "name": "download", + "ref": "main", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2023-11-03T09:22:38.546Z", + "started_at": "2023-11-03T09:22:39.300Z", + "finished_at": "2023-11-03T09:23:19.434Z", + "erased_at": null, + "duration": 40.134417, + "queued_duration": 0.198526, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "249039544119d7673d22b7979942c079c3cfe4fa", + "short_id": "24903954", + "created_at": "2023-11-02T13:46:57.000+01:00", + "parent_ids": [ + "2224c54abb7d48dac246cf4a393d87a232845488" + ], + "title": "Remove vet job since golangci-lint includes it", + "message": "Remove vet job since golangci-lint includes it\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-11-02T13:46:57.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-11-02T13:46:57.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/249039544119d7673d22b7979942c079c3cfe4fa" + }, + "pipeline": { + "id": 1059953266, + "iid": 10, + "project_id": 50817395, + "sha": "249039544119d7673d22b7979942c079c3cfe4fa", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2023-11-03T09:22:38.524Z", + "updated_at": "2023-11-03T09:27:24.306Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1059953266" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5453437395", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 2774, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270852, + "description": "3-green.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.251", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": false, + "status": "offline" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + } +] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1059953266/test_report.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1059953266/test_report.json new file mode 100644 index 0000000..6728c4e --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1059953266/test_report.json @@ -0,0 +1,9 @@ +{ + "total_time": 0, + "total_count": 0, + "success_count": 0, + "failed_count": 0, + "skipped_count": 0, + "error_count": 0, + "test_suites": [] +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1059953266/test_report_summary.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1059953266/test_report_summary.json new file mode 100644 index 0000000..2ac566c --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1059953266/test_report_summary.json @@ -0,0 +1,26 @@ +{ + "total": { + "time": 0.0, + "count": 18, + "success": 18, + "failed": 0, + "skipped": 0, + "error": 0, + "suite_error": null + }, + "test_suites": [ + { + "name": "test", + "total_time": 0.0, + "total_count": 18, + "success_count": 18, + "failed_count": 0, + "skipped_count": 0, + "error_count": 0, + "build_ids": [ + 5453437402 + ], + "suite_error": null + } + ] +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1079025538.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1079025538.json new file mode 100644 index 0000000..be6a4f5 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1079025538.json @@ -0,0 +1,42 @@ +{ + "id": 1079025538, + "iid": 11, + "project_id": 50817395, + "sha": "7180ae586f19ae465387ddfa5f02522fa1521f6e", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2023-11-20T16:51:26.685Z", + "updated_at": "2023-11-20T16:58:29.430Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1079025538", + "before_sha": "249039544119d7673d22b7979942c079c3cfe4fa", + "tag": false, + "yaml_errors": null, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev" + }, + "started_at": "2023-11-20T16:53:23.739Z", + "finished_at": "2023-11-20T16:58:29.183Z", + "committed_at": null, + "duration": 295, + "queued_duration": 117, + "coverage": null, + "detailed_status": { + "icon": "status_success", + "text": "Passed", + "label": "passed", + "group": "success", + "tooltip": "passed", + "has_details": false, + "details_path": "/cluttrdev/gitlab-exporter/-/pipelines/1079025538", + "illustration": null, + "favicon": "/assets/ci_favicons/favicon_status_success-8451333011eee8ce9f2ab25dc487fe24a8758c694827a582f17f42b0a90446a2.png" + }, + "name": null +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1079025538/bridges.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1079025538/bridges.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1079025538/bridges.json @@ -0,0 +1 @@ +[] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1079025538/jobs.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1079025538/jobs.json new file mode 100644 index 0000000..38620d5 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1079025538/jobs.json @@ -0,0 +1,402 @@ +[ + { + "id": 5577848766, + "status": "success", + "stage": "test", + "name": "test", + "ref": "main", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2023-11-20T16:51:27.274Z", + "started_at": "2023-11-20T16:56:59.425Z", + "finished_at": "2023-11-20T16:58:27.444Z", + "erased_at": null, + "duration": 88.019311, + "queued_duration": 1.233511, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "7180ae586f19ae465387ddfa5f02522fa1521f6e", + "short_id": "7180ae58", + "created_at": "2023-11-20T17:11:54.000+01:00", + "parent_ids": [ + "249039544119d7673d22b7979942c079c3cfe4fa" + ], + "title": "Update dev environment dashboard provisioning", + "message": "Update dev environment dashboard provisioning\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-11-20T17:11:54.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-11-20T17:11:54.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/7180ae586f19ae465387ddfa5f02522fa1521f6e" + }, + "pipeline": { + "id": 1079025538, + "iid": 11, + "project_id": 50817395, + "sha": "7180ae586f19ae465387ddfa5f02522fa1521f6e", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2023-11-20T16:51:26.685Z", + "updated_at": "2023-11-20T16:58:29.430Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1079025538" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5577848766", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 5448, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270837, + "description": "4-blue.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.253", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": true, + "status": "online" + }, + "artifacts_expire_at": "2023-12-20T16:58:23.920Z", + "archived": false, + "tag_list": [] + }, + { + "id": 5577848756, + "status": "success", + "stage": "build", + "name": "build", + "ref": "main", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2023-11-20T16:51:27.242Z", + "started_at": "2023-11-20T16:55:38.451Z", + "finished_at": "2023-11-20T16:56:55.525Z", + "erased_at": null, + "duration": 77.073242, + "queued_duration": 0.836804, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "7180ae586f19ae465387ddfa5f02522fa1521f6e", + "short_id": "7180ae58", + "created_at": "2023-11-20T17:11:54.000+01:00", + "parent_ids": [ + "249039544119d7673d22b7979942c079c3cfe4fa" + ], + "title": "Update dev environment dashboard provisioning", + "message": "Update dev environment dashboard provisioning\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-11-20T17:11:54.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-11-20T17:11:54.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/7180ae586f19ae465387ddfa5f02522fa1521f6e" + }, + "pipeline": { + "id": 1079025538, + "iid": 11, + "project_id": 50817395, + "sha": "7180ae586f19ae465387ddfa5f02522fa1521f6e", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2023-11-20T16:51:26.685Z", + "updated_at": "2023-11-20T16:58:29.430Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1079025538" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5577848756", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 2560, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270840, + "description": "5-blue.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.247", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": true, + "status": "online" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 5577848752, + "status": "success", + "stage": "lint", + "name": "lint", + "ref": "main", + "tag": false, + "coverage": null, + "allow_failure": true, + "created_at": "2023-11-20T16:51:27.220Z", + "started_at": "2023-11-20T16:54:06.796Z", + "finished_at": "2023-11-20T16:55:34.372Z", + "erased_at": null, + "duration": 87.575576, + "queued_duration": 0.715011, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "7180ae586f19ae465387ddfa5f02522fa1521f6e", + "short_id": "7180ae58", + "created_at": "2023-11-20T17:11:54.000+01:00", + "parent_ids": [ + "249039544119d7673d22b7979942c079c3cfe4fa" + ], + "title": "Update dev environment dashboard provisioning", + "message": "Update dev environment dashboard provisioning\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-11-20T17:11:54.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-11-20T17:11:54.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/7180ae586f19ae465387ddfa5f02522fa1521f6e" + }, + "pipeline": { + "id": 1079025538, + "iid": 11, + "project_id": 50817395, + "sha": "7180ae586f19ae465387ddfa5f02522fa1521f6e", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2023-11-20T16:51:26.685Z", + "updated_at": "2023-11-20T16:58:29.430Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1079025538" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5577848752", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 2718, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270831, + "description": "2-blue.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.65", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": true, + "status": "online" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 5577848746, + "status": "success", + "stage": ".pre", + "name": "download", + "ref": "main", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2023-11-20T16:51:27.206Z", + "started_at": "2023-11-20T16:53:19.191Z", + "finished_at": "2023-11-20T16:54:02.290Z", + "erased_at": null, + "duration": 43.098591, + "queued_duration": 104.007567, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "7180ae586f19ae465387ddfa5f02522fa1521f6e", + "short_id": "7180ae58", + "created_at": "2023-11-20T17:11:54.000+01:00", + "parent_ids": [ + "249039544119d7673d22b7979942c079c3cfe4fa" + ], + "title": "Update dev environment dashboard provisioning", + "message": "Update dev environment dashboard provisioning\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-11-20T17:11:54.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-11-20T17:11:54.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/7180ae586f19ae465387ddfa5f02522fa1521f6e" + }, + "pipeline": { + "id": 1079025538, + "iid": 11, + "project_id": 50817395, + "sha": "7180ae586f19ae465387ddfa5f02522fa1521f6e", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2023-11-20T16:51:26.685Z", + "updated_at": "2023-11-20T16:58:29.430Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1079025538" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5577848746", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 2736, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270807, + "description": "1-blue.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.250", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": true, + "status": "online" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + } +] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1079025538/test_report.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1079025538/test_report.json new file mode 100644 index 0000000..6728c4e --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1079025538/test_report.json @@ -0,0 +1,9 @@ +{ + "total_time": 0, + "total_count": 0, + "success_count": 0, + "failed_count": 0, + "skipped_count": 0, + "error_count": 0, + "test_suites": [] +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1079025538/test_report_summary.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1079025538/test_report_summary.json new file mode 100644 index 0000000..8e8e8cf --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1079025538/test_report_summary.json @@ -0,0 +1,26 @@ +{ + "total": { + "time": 0.0, + "count": 18, + "success": 18, + "failed": 0, + "skipped": 0, + "error": 0, + "suite_error": null + }, + "test_suites": [ + { + "name": "test", + "total_time": 0.0, + "total_count": 18, + "success_count": 18, + "failed_count": 0, + "skipped_count": 0, + "error_count": 0, + "build_ids": [ + 5577848766 + ], + "suite_error": null + } + ] +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1082136862.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1082136862.json new file mode 100644 index 0000000..b0d9e0c --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1082136862.json @@ -0,0 +1,42 @@ +{ + "id": 1082136862, + "iid": 12, + "project_id": 50817395, + "sha": "e860ecdc74aee9aab22f6336a705bab05634c0c3", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2023-11-22T22:04:17.951Z", + "updated_at": "2023-11-22T22:08:53.886Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1082136862", + "before_sha": "7180ae586f19ae465387ddfa5f02522fa1521f6e", + "tag": false, + "yaml_errors": null, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev" + }, + "started_at": "2023-11-22T22:04:19.010Z", + "finished_at": "2023-11-22T22:08:53.875Z", + "committed_at": null, + "duration": 273, + "queued_duration": 1, + "coverage": null, + "detailed_status": { + "icon": "status_success", + "text": "Passed", + "label": "passed", + "group": "success", + "tooltip": "passed", + "has_details": false, + "details_path": "/cluttrdev/gitlab-exporter/-/pipelines/1082136862", + "illustration": null, + "favicon": "/assets/ci_favicons/favicon_status_success-8451333011eee8ce9f2ab25dc487fe24a8758c694827a582f17f42b0a90446a2.png" + }, + "name": null +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1082136862/bridges.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1082136862/bridges.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1082136862/bridges.json @@ -0,0 +1 @@ +[] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1082136862/jobs.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1082136862/jobs.json new file mode 100644 index 0000000..5c56f57 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1082136862/jobs.json @@ -0,0 +1,402 @@ +[ + { + "id": 5599404160, + "status": "success", + "stage": "test", + "name": "test", + "ref": "main", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2023-11-22T22:04:17.999Z", + "started_at": "2023-11-22T22:07:31.366Z", + "finished_at": "2023-11-22T22:08:53.765Z", + "erased_at": null, + "duration": 82.399463, + "queued_duration": 0.359749, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "e860ecdc74aee9aab22f6336a705bab05634c0c3", + "short_id": "e860ecdc", + "created_at": "2023-11-22T22:55:25.000+01:00", + "parent_ids": [ + "cf8ae2926dbabcf78e3c7f6236bd018088e81265" + ], + "title": "BREAKING: Rename project", + "message": "BREAKING: Rename project\n\nThe introduction of the data store interface allows adding more backends\nto export the data to, so the application is not limited to only using\nClickHouse (although it's the preferred one).\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-11-22T22:55:25.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-11-22T22:55:25.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/e860ecdc74aee9aab22f6336a705bab05634c0c3" + }, + "pipeline": { + "id": 1082136862, + "iid": 12, + "project_id": 50817395, + "sha": "e860ecdc74aee9aab22f6336a705bab05634c0c3", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2023-11-22T22:04:17.951Z", + "updated_at": "2023-11-22T22:08:53.886Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1082136862" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5599404160", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 5437, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270837, + "description": "4-blue.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.253", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": true, + "status": "online" + }, + "artifacts_expire_at": "2023-12-22T22:08:50.401Z", + "archived": false, + "tag_list": [] + }, + { + "id": 5599404159, + "status": "success", + "stage": "build", + "name": "build", + "ref": "main", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2023-11-22T22:04:17.988Z", + "started_at": "2023-11-22T22:06:16.202Z", + "finished_at": "2023-11-22T22:07:30.877Z", + "erased_at": null, + "duration": 74.675249, + "queued_duration": 0.245061, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "e860ecdc74aee9aab22f6336a705bab05634c0c3", + "short_id": "e860ecdc", + "created_at": "2023-11-22T22:55:25.000+01:00", + "parent_ids": [ + "cf8ae2926dbabcf78e3c7f6236bd018088e81265" + ], + "title": "BREAKING: Rename project", + "message": "BREAKING: Rename project\n\nThe introduction of the data store interface allows adding more backends\nto export the data to, so the application is not limited to only using\nClickHouse (although it's the preferred one).\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-11-22T22:55:25.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-11-22T22:55:25.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/e860ecdc74aee9aab22f6336a705bab05634c0c3" + }, + "pipeline": { + "id": 1082136862, + "iid": 12, + "project_id": 50817395, + "sha": "e860ecdc74aee9aab22f6336a705bab05634c0c3", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2023-11-22T22:04:17.951Z", + "updated_at": "2023-11-22T22:08:53.886Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1082136862" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5599404159", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 2550, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270831, + "description": "2-blue.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.65", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": true, + "status": "online" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 5599404158, + "status": "success", + "stage": "lint", + "name": "lint", + "ref": "main", + "tag": false, + "coverage": null, + "allow_failure": true, + "created_at": "2023-11-22T22:04:17.980Z", + "started_at": "2023-11-22T22:04:53.680Z", + "finished_at": "2023-11-22T22:06:15.848Z", + "erased_at": null, + "duration": 82.167587, + "queued_duration": 0.097338, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "e860ecdc74aee9aab22f6336a705bab05634c0c3", + "short_id": "e860ecdc", + "created_at": "2023-11-22T22:55:25.000+01:00", + "parent_ids": [ + "cf8ae2926dbabcf78e3c7f6236bd018088e81265" + ], + "title": "BREAKING: Rename project", + "message": "BREAKING: Rename project\n\nThe introduction of the data store interface allows adding more backends\nto export the data to, so the application is not limited to only using\nClickHouse (although it's the preferred one).\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-11-22T22:55:25.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-11-22T22:55:25.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/e860ecdc74aee9aab22f6336a705bab05634c0c3" + }, + "pipeline": { + "id": 1082136862, + "iid": 12, + "project_id": 50817395, + "sha": "e860ecdc74aee9aab22f6336a705bab05634c0c3", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2023-11-22T22:04:17.951Z", + "updated_at": "2023-11-22T22:08:53.886Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1082136862" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5599404158", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 2707, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270837, + "description": "4-blue.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.253", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": true, + "status": "online" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 5599404156, + "status": "success", + "stage": ".pre", + "name": "download", + "ref": "main", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2023-11-22T22:04:17.969Z", + "started_at": "2023-11-22T22:04:18.782Z", + "finished_at": "2023-11-22T22:04:53.465Z", + "erased_at": null, + "duration": 34.682836, + "queued_duration": 0.11855, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "e860ecdc74aee9aab22f6336a705bab05634c0c3", + "short_id": "e860ecdc", + "created_at": "2023-11-22T22:55:25.000+01:00", + "parent_ids": [ + "cf8ae2926dbabcf78e3c7f6236bd018088e81265" + ], + "title": "BREAKING: Rename project", + "message": "BREAKING: Rename project\n\nThe introduction of the data store interface allows adding more backends\nto export the data to, so the application is not limited to only using\nClickHouse (although it's the preferred one).\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-11-22T22:55:25.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-11-22T22:55:25.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/e860ecdc74aee9aab22f6336a705bab05634c0c3" + }, + "pipeline": { + "id": 1082136862, + "iid": 12, + "project_id": 50817395, + "sha": "e860ecdc74aee9aab22f6336a705bab05634c0c3", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2023-11-22T22:04:17.951Z", + "updated_at": "2023-11-22T22:08:53.886Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1082136862" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5599404156", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 2718, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270837, + "description": "4-blue.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.253", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": true, + "status": "online" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + } +] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1082136862/test_report.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1082136862/test_report.json new file mode 100644 index 0000000..6728c4e --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1082136862/test_report.json @@ -0,0 +1,9 @@ +{ + "total_time": 0, + "total_count": 0, + "success_count": 0, + "failed_count": 0, + "skipped_count": 0, + "error_count": 0, + "test_suites": [] +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1082136862/test_report_summary.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1082136862/test_report_summary.json new file mode 100644 index 0000000..31eaa35 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1082136862/test_report_summary.json @@ -0,0 +1,26 @@ +{ + "total": { + "time": 0.0, + "count": 18, + "success": 18, + "failed": 0, + "skipped": 0, + "error": 0, + "suite_error": null + }, + "test_suites": [ + { + "name": "test", + "total_time": 0.0, + "total_count": 18, + "success_count": 18, + "failed_count": 0, + "skipped_count": 0, + "error_count": 0, + "build_ids": [ + 5599404160 + ], + "suite_error": null + } + ] +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1083833095.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1083833095.json new file mode 100644 index 0000000..020ecb9 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1083833095.json @@ -0,0 +1,42 @@ +{ + "id": 1083833095, + "iid": 13, + "project_id": 50817395, + "sha": "3c530002e6dc209390af18b9835dd02a8441f981", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2023-11-24T09:55:24.650Z", + "updated_at": "2023-11-24T10:00:04.043Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1083833095", + "before_sha": "e860ecdc74aee9aab22f6336a705bab05634c0c3", + "tag": false, + "yaml_errors": null, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev" + }, + "started_at": "2023-11-24T09:55:27.079Z", + "finished_at": "2023-11-24T10:00:04.027Z", + "committed_at": null, + "duration": 275, + "queued_duration": 2, + "coverage": null, + "detailed_status": { + "icon": "status_warning", + "text": "Warning", + "label": "passed with warnings", + "group": "success-with-warnings", + "tooltip": "passed", + "has_details": false, + "details_path": "/cluttrdev/gitlab-exporter/-/pipelines/1083833095", + "illustration": null, + "favicon": "/assets/ci_favicons/favicon_status_success-8451333011eee8ce9f2ab25dc487fe24a8758c694827a582f17f42b0a90446a2.png" + }, + "name": null +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1083833095/bridges.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1083833095/bridges.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1083833095/bridges.json @@ -0,0 +1 @@ +[] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1083833095/jobs.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1083833095/jobs.json new file mode 100644 index 0000000..eca14de --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1083833095/jobs.json @@ -0,0 +1,403 @@ +[ + { + "id": 5609651214, + "status": "success", + "stage": "test", + "name": "test", + "ref": "main", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2023-11-24T09:55:24.706Z", + "started_at": "2023-11-24T09:58:39.154Z", + "finished_at": "2023-11-24T10:00:03.711Z", + "erased_at": null, + "duration": 84.557115, + "queued_duration": 0.227473, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "3c530002e6dc209390af18b9835dd02a8441f981", + "short_id": "3c530002", + "created_at": "2023-11-24T10:54:00.000+01:00", + "parent_ids": [ + "9743fab81724d6172e23d4a0063c5d90ee6c4194" + ], + "title": "Fix gitlab-ci config file name", + "message": "Fix gitlab-ci config file name\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-11-24T10:54:00.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-11-24T10:54:00.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/3c530002e6dc209390af18b9835dd02a8441f981" + }, + "pipeline": { + "id": 1083833095, + "iid": 13, + "project_id": 50817395, + "sha": "3c530002e6dc209390af18b9835dd02a8441f981", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2023-11-24T09:55:24.650Z", + "updated_at": "2023-11-24T10:00:04.043Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1083833095" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5609651214", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 5437, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270835, + "description": "3-blue.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.64", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": true, + "status": "online" + }, + "artifacts_expire_at": "2023-12-24T10:00:01.029Z", + "archived": false, + "tag_list": [] + }, + { + "id": 5609651212, + "status": "success", + "stage": "build", + "name": "build", + "ref": "main", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2023-11-24T09:55:24.697Z", + "started_at": "2023-11-24T09:57:25.659Z", + "finished_at": "2023-11-24T09:58:38.762Z", + "erased_at": null, + "duration": 73.103579, + "queued_duration": 0.263486, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "3c530002e6dc209390af18b9835dd02a8441f981", + "short_id": "3c530002", + "created_at": "2023-11-24T10:54:00.000+01:00", + "parent_ids": [ + "9743fab81724d6172e23d4a0063c5d90ee6c4194" + ], + "title": "Fix gitlab-ci config file name", + "message": "Fix gitlab-ci config file name\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-11-24T10:54:00.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-11-24T10:54:00.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/3c530002e6dc209390af18b9835dd02a8441f981" + }, + "pipeline": { + "id": 1083833095, + "iid": 13, + "project_id": 50817395, + "sha": "3c530002e6dc209390af18b9835dd02a8441f981", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2023-11-24T09:55:24.650Z", + "updated_at": "2023-11-24T10:00:04.043Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1083833095" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5609651212", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 2550, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270837, + "description": "4-blue.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.253", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": true, + "status": "online" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 5609651208, + "status": "failed", + "stage": "lint", + "name": "lint", + "ref": "main", + "tag": false, + "coverage": null, + "allow_failure": true, + "created_at": "2023-11-24T09:55:24.687Z", + "started_at": "2023-11-24T09:55:59.935Z", + "finished_at": "2023-11-24T09:57:25.273Z", + "erased_at": null, + "duration": 85.337814, + "queued_duration": 0.140638, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "3c530002e6dc209390af18b9835dd02a8441f981", + "short_id": "3c530002", + "created_at": "2023-11-24T10:54:00.000+01:00", + "parent_ids": [ + "9743fab81724d6172e23d4a0063c5d90ee6c4194" + ], + "title": "Fix gitlab-ci config file name", + "message": "Fix gitlab-ci config file name\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-11-24T10:54:00.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-11-24T10:54:00.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/3c530002e6dc209390af18b9835dd02a8441f981" + }, + "pipeline": { + "id": 1083833095, + "iid": 13, + "project_id": 50817395, + "sha": "3c530002e6dc209390af18b9835dd02a8441f981", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2023-11-24T09:55:24.650Z", + "updated_at": "2023-11-24T10:00:04.043Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1083833095" + }, + "failure_reason": "script_failure", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5609651208", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 2634, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270831, + "description": "2-blue.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.65", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": true, + "status": "online" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 5609651202, + "status": "success", + "stage": ".pre", + "name": "download", + "ref": "main", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2023-11-24T09:55:24.666Z", + "started_at": "2023-11-24T09:55:26.664Z", + "finished_at": "2023-11-24T09:55:59.657Z", + "erased_at": null, + "duration": 32.992584, + "queued_duration": 0.223686, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "3c530002e6dc209390af18b9835dd02a8441f981", + "short_id": "3c530002", + "created_at": "2023-11-24T10:54:00.000+01:00", + "parent_ids": [ + "9743fab81724d6172e23d4a0063c5d90ee6c4194" + ], + "title": "Fix gitlab-ci config file name", + "message": "Fix gitlab-ci config file name\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-11-24T10:54:00.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-11-24T10:54:00.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/3c530002e6dc209390af18b9835dd02a8441f981" + }, + "pipeline": { + "id": 1083833095, + "iid": 13, + "project_id": 50817395, + "sha": "3c530002e6dc209390af18b9835dd02a8441f981", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2023-11-24T09:55:24.650Z", + "updated_at": "2023-11-24T10:00:04.043Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1083833095" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5609651202", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 2712, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270807, + "description": "1-blue.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.250", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": true, + "status": "online" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + } +] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1083833095/test_report.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1083833095/test_report.json new file mode 100644 index 0000000..6728c4e --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1083833095/test_report.json @@ -0,0 +1,9 @@ +{ + "total_time": 0, + "total_count": 0, + "success_count": 0, + "failed_count": 0, + "skipped_count": 0, + "error_count": 0, + "test_suites": [] +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1083833095/test_report_summary.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1083833095/test_report_summary.json new file mode 100644 index 0000000..0eb93f9 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1083833095/test_report_summary.json @@ -0,0 +1,26 @@ +{ + "total": { + "time": 0.0, + "count": 18, + "success": 18, + "failed": 0, + "skipped": 0, + "error": 0, + "suite_error": null + }, + "test_suites": [ + { + "name": "test", + "total_time": 0.0, + "total_count": 18, + "success_count": 18, + "failed_count": 0, + "skipped_count": 0, + "error_count": 0, + "build_ids": [ + 5609651214 + ], + "suite_error": null + } + ] +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1094770143.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1094770143.json new file mode 100644 index 0000000..28c2be8 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1094770143.json @@ -0,0 +1,42 @@ +{ + "id": 1094770143, + "iid": 14, + "project_id": 50817395, + "sha": "6646717fb5f99db06c3b8e836a38da46c265ecd5", + "ref": "log_embedded_metrics", + "status": "success", + "source": "push", + "created_at": "2023-12-04T16:35:40.345Z", + "updated_at": "2023-12-04T16:40:29.388Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1094770143", + "before_sha": "0000000000000000000000000000000000000000", + "tag": false, + "yaml_errors": null, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev" + }, + "started_at": "2023-12-04T16:35:42.062Z", + "finished_at": "2023-12-04T16:40:29.379Z", + "committed_at": null, + "duration": 287, + "queued_duration": 1, + "coverage": null, + "detailed_status": { + "icon": "status_warning", + "text": "Warning", + "label": "passed with warnings", + "group": "success-with-warnings", + "tooltip": "passed", + "has_details": false, + "details_path": "/cluttrdev/gitlab-exporter/-/pipelines/1094770143", + "illustration": null, + "favicon": "/assets/ci_favicons/favicon_status_success-8451333011eee8ce9f2ab25dc487fe24a8758c694827a582f17f42b0a90446a2.png" + }, + "name": null +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1094770143/bridges.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1094770143/bridges.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1094770143/bridges.json @@ -0,0 +1 @@ +[] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1094770143/jobs.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1094770143/jobs.json new file mode 100644 index 0000000..9641d45 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1094770143/jobs.json @@ -0,0 +1,409 @@ +[ + { + "id": 5676345587, + "status": "success", + "stage": "test", + "name": "test", + "ref": "log_embedded_metrics", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2023-12-04T16:35:40.404Z", + "started_at": "2023-12-04T16:39:04.845Z", + "finished_at": "2023-12-04T16:40:29.265Z", + "erased_at": null, + "duration": 84.420117, + "queued_duration": 0.178688, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "6646717fb5f99db06c3b8e836a38da46c265ecd5", + "short_id": "6646717f", + "created_at": "2023-12-04T17:22:46.000+01:00", + "parent_ids": [ + "adb00e3315666f8e16696062852862106fa69cc1" + ], + "title": "Update CHANGELOG.md", + "message": "Update CHANGELOG.md\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-12-04T17:22:46.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-12-04T17:22:46.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/6646717fb5f99db06c3b8e836a38da46c265ecd5" + }, + "pipeline": { + "id": 1094770143, + "iid": 14, + "project_id": 50817395, + "sha": "6646717fb5f99db06c3b8e836a38da46c265ecd5", + "ref": "log_embedded_metrics", + "status": "success", + "source": "push", + "created_at": "2023-12-04T16:35:40.345Z", + "updated_at": "2023-12-04T16:40:29.388Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1094770143" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5676345587", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "junit", + "size": 535, + "filename": "junit.xml.gz", + "file_format": "gzip" + }, + { + "file_type": "trace", + "size": 5513, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270837, + "description": "4-blue.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.253", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": true, + "status": "online" + }, + "artifacts_expire_at": "2024-01-03T16:40:26.978Z", + "archived": false, + "tag_list": [] + }, + { + "id": 5676345585, + "status": "success", + "stage": "build", + "name": "build", + "ref": "log_embedded_metrics", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2023-12-04T16:35:40.390Z", + "started_at": "2023-12-04T16:37:51.660Z", + "finished_at": "2023-12-04T16:39:04.506Z", + "erased_at": null, + "duration": 72.845631, + "queued_duration": 0.101921, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "6646717fb5f99db06c3b8e836a38da46c265ecd5", + "short_id": "6646717f", + "created_at": "2023-12-04T17:22:46.000+01:00", + "parent_ids": [ + "adb00e3315666f8e16696062852862106fa69cc1" + ], + "title": "Update CHANGELOG.md", + "message": "Update CHANGELOG.md\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-12-04T17:22:46.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-12-04T17:22:46.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/6646717fb5f99db06c3b8e836a38da46c265ecd5" + }, + "pipeline": { + "id": 1094770143, + "iid": 14, + "project_id": 50817395, + "sha": "6646717fb5f99db06c3b8e836a38da46c265ecd5", + "ref": "log_embedded_metrics", + "status": "success", + "source": "push", + "created_at": "2023-12-04T16:35:40.345Z", + "updated_at": "2023-12-04T16:40:29.388Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1094770143" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5676345585", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 2620, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270807, + "description": "1-blue.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.250", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": true, + "status": "online" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 5676345583, + "status": "failed", + "stage": "lint", + "name": "lint", + "ref": "log_embedded_metrics", + "tag": false, + "coverage": null, + "allow_failure": true, + "created_at": "2023-12-04T16:35:40.375Z", + "started_at": "2023-12-04T16:36:23.108Z", + "finished_at": "2023-12-04T16:37:51.458Z", + "erased_at": null, + "duration": 88.350098, + "queued_duration": 0.155015, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "6646717fb5f99db06c3b8e836a38da46c265ecd5", + "short_id": "6646717f", + "created_at": "2023-12-04T17:22:46.000+01:00", + "parent_ids": [ + "adb00e3315666f8e16696062852862106fa69cc1" + ], + "title": "Update CHANGELOG.md", + "message": "Update CHANGELOG.md\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-12-04T17:22:46.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-12-04T17:22:46.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/6646717fb5f99db06c3b8e836a38da46c265ecd5" + }, + "pipeline": { + "id": 1094770143, + "iid": 14, + "project_id": 50817395, + "sha": "6646717fb5f99db06c3b8e836a38da46c265ecd5", + "ref": "log_embedded_metrics", + "status": "success", + "source": "push", + "created_at": "2023-12-04T16:35:40.345Z", + "updated_at": "2023-12-04T16:40:29.388Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1094770143" + }, + "failure_reason": "script_failure", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5676345583", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 2866, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270835, + "description": "3-blue.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.64", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": true, + "status": "online" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 5676345582, + "status": "success", + "stage": ".pre", + "name": "download", + "ref": "log_embedded_metrics", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2023-12-04T16:35:40.361Z", + "started_at": "2023-12-04T16:35:41.364Z", + "finished_at": "2023-12-04T16:36:22.800Z", + "erased_at": null, + "duration": 41.436086, + "queued_duration": 0.216275, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "6646717fb5f99db06c3b8e836a38da46c265ecd5", + "short_id": "6646717f", + "created_at": "2023-12-04T17:22:46.000+01:00", + "parent_ids": [ + "adb00e3315666f8e16696062852862106fa69cc1" + ], + "title": "Update CHANGELOG.md", + "message": "Update CHANGELOG.md\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-12-04T17:22:46.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-12-04T17:22:46.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/6646717fb5f99db06c3b8e836a38da46c265ecd5" + }, + "pipeline": { + "id": 1094770143, + "iid": 14, + "project_id": 50817395, + "sha": "6646717fb5f99db06c3b8e836a38da46c265ecd5", + "ref": "log_embedded_metrics", + "status": "success", + "source": "push", + "created_at": "2023-12-04T16:35:40.345Z", + "updated_at": "2023-12-04T16:40:29.388Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1094770143" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5676345582", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 2796, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270837, + "description": "4-blue.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.253", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": true, + "status": "online" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + } +] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1094770143/test_report.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1094770143/test_report.json new file mode 100644 index 0000000..282a9d2 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1094770143/test_report.json @@ -0,0 +1,202 @@ +{ + "total_time": 0.0, + "total_count": 18, + "success_count": 18, + "failed_count": 0, + "skipped_count": 0, + "error_count": 0, + "test_suites": [ + { + "name": "test", + "total_time": 0.0, + "total_count": 18, + "success_count": 18, + "failed_count": 0, + "skipped_count": 0, + "error_count": 0, + "suite_error": null, + "test_cases": [ + { + "status": "success", + "name": "Test_NewDefault", + "classname": "github.com/cluttrdev/gitlab-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "Test_NewDefaultProjectSettings", + "classname": "github.com/cluttrdev/gitlab-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestLoad_EmptyData", + "classname": "github.com/cluttrdev/gitlab-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestLoad_PartialData", + "classname": "github.com/cluttrdev/gitlab-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestLoad_UnknownData", + "classname": "github.com/cluttrdev/gitlab-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestLoad_InvalidData", + "classname": "github.com/cluttrdev/gitlab-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestLoad_DataWithDefaults", + "classname": "github.com/cluttrdev/gitlab-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestLoad_DataWithProjects", + "classname": "github.com/cluttrdev/gitlab-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestLoad_DataWithCustomServerAddress", + "classname": "github.com/cluttrdev/gitlab-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestPrepareDeduplicateQuery_Minimal", + "classname": "github.com/cluttrdev/gitlab-exporter/test/tasks", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestPrepareDeduplicateQuery_Full", + "classname": "github.com/cluttrdev/gitlab-exporter/test/tasks", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestPrepareDeduplicateQuery_WithFinal", + "classname": "github.com/cluttrdev/gitlab-exporter/test/tasks", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestPrepareDeduplicateQuery_WithThrowIfNoopTrue", + "classname": "github.com/cluttrdev/gitlab-exporter/test/tasks", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestPrepareDeduplicateQuery_WithThrowIfNoopFalse", + "classname": "github.com/cluttrdev/gitlab-exporter/test/tasks", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestPrepareDeduplicateQuery_WithBy", + "classname": "github.com/cluttrdev/gitlab-exporter/test/tasks", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestPrepareDeduplicateQuery_WithSingleExcept", + "classname": "github.com/cluttrdev/gitlab-exporter/test/tasks", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestPrepareDeduplicateQuery_WithMultipleExcept", + "classname": "github.com/cluttrdev/gitlab-exporter/test/tasks", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestPrepareDeduplicateQuery_WithByAndExcept", + "classname": "github.com/cluttrdev/gitlab-exporter/test/tasks", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + } + ] + } + ] +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1094770143/test_report_summary.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1094770143/test_report_summary.json new file mode 100644 index 0000000..5f87d4d --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1094770143/test_report_summary.json @@ -0,0 +1,26 @@ +{ + "total": { + "time": 0.0, + "count": 18, + "success": 18, + "failed": 0, + "skipped": 0, + "error": 0, + "suite_error": null + }, + "test_suites": [ + { + "name": "test", + "total_time": 0.0, + "total_count": 18, + "success_count": 18, + "failed_count": 0, + "skipped_count": 0, + "error_count": 0, + "build_ids": [ + 5676345587 + ], + "suite_error": null + } + ] +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1097349658.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1097349658.json new file mode 100644 index 0000000..d407f76 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1097349658.json @@ -0,0 +1,42 @@ +{ + "id": 1097349658, + "iid": 15, + "project_id": 50817395, + "sha": "85ff3602e090f7a5c2e2691982ff3d8a6dfb1e22", + "ref": "main", + "status": "canceled", + "source": "push", + "created_at": "2023-12-06T12:43:21.693Z", + "updated_at": "2023-12-06T14:09:19.155Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1097349658", + "before_sha": "3c530002e6dc209390af18b9835dd02a8441f981", + "tag": false, + "yaml_errors": null, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev" + }, + "started_at": null, + "finished_at": "2023-12-06T14:09:19.154Z", + "committed_at": null, + "duration": null, + "queued_duration": null, + "coverage": null, + "detailed_status": { + "icon": "status_canceled", + "text": "Canceled", + "label": "canceled", + "group": "canceled", + "tooltip": "canceled", + "has_details": false, + "details_path": "/cluttrdev/gitlab-exporter/-/pipelines/1097349658", + "illustration": null, + "favicon": "/assets/ci_favicons/favicon_status_canceled-ca35321a6cda9943ebdf6631c8057ffd54064f3ba20cfe0ebc4b0b992041c430.png" + }, + "name": null +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1097349658/bridges.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1097349658/bridges.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1097349658/bridges.json @@ -0,0 +1 @@ +[] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1097349658/jobs.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1097349658/jobs.json new file mode 100644 index 0000000..905dcf6 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1097349658/jobs.json @@ -0,0 +1,338 @@ +[ + { + "id": 5693671749, + "status": "canceled", + "stage": ".pre", + "name": "download", + "ref": "main", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2023-12-06T14:05:46.596Z", + "started_at": null, + "finished_at": "2023-12-06T14:09:19.030Z", + "erased_at": null, + "duration": null, + "queued_duration": 11557719.144979559, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "85ff3602e090f7a5c2e2691982ff3d8a6dfb1e22", + "short_id": "85ff3602", + "created_at": "2023-12-06T13:33:21.000+01:00", + "parent_ids": [ + "0b3adf156423be6567925f944d365a0b066a6c19" + ], + "title": "Change project logo", + "message": "Change project logo\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-12-06T13:33:21.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-12-06T13:33:21.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/85ff3602e090f7a5c2e2691982ff3d8a6dfb1e22" + }, + "pipeline": { + "id": 1097349658, + "iid": 15, + "project_id": 50817395, + "sha": "85ff3602e090f7a5c2e2691982ff3d8a6dfb1e22", + "ref": "main", + "status": "canceled", + "source": "push", + "created_at": "2023-12-06T12:43:21.693Z", + "updated_at": "2023-12-06T14:09:19.155Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1097349658" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5693671749", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [], + "runner": null, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [ + "$GITLAB_CI_DEFAULT_TAGS" + ] + }, + { + "id": 5693671746, + "status": "canceled", + "stage": "test", + "name": "test", + "ref": "main", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2023-12-06T14:05:46.556Z", + "started_at": null, + "finished_at": "2023-12-06T14:09:19.025Z", + "erased_at": null, + "duration": null, + "queued_duration": null, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "85ff3602e090f7a5c2e2691982ff3d8a6dfb1e22", + "short_id": "85ff3602", + "created_at": "2023-12-06T13:33:21.000+01:00", + "parent_ids": [ + "0b3adf156423be6567925f944d365a0b066a6c19" + ], + "title": "Change project logo", + "message": "Change project logo\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-12-06T13:33:21.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-12-06T13:33:21.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/85ff3602e090f7a5c2e2691982ff3d8a6dfb1e22" + }, + "pipeline": { + "id": 1097349658, + "iid": 15, + "project_id": 50817395, + "sha": "85ff3602e090f7a5c2e2691982ff3d8a6dfb1e22", + "ref": "main", + "status": "canceled", + "source": "push", + "created_at": "2023-12-06T12:43:21.693Z", + "updated_at": "2023-12-06T14:09:19.155Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1097349658" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5693671746", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [], + "runner": null, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [ + "$GITLAB_CI_DEFAULT_TAGS" + ] + }, + { + "id": 5693671740, + "status": "canceled", + "stage": "build", + "name": "build", + "ref": "main", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2023-12-06T14:05:46.518Z", + "started_at": null, + "finished_at": "2023-12-06T14:09:19.019Z", + "erased_at": null, + "duration": null, + "queued_duration": null, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "85ff3602e090f7a5c2e2691982ff3d8a6dfb1e22", + "short_id": "85ff3602", + "created_at": "2023-12-06T13:33:21.000+01:00", + "parent_ids": [ + "0b3adf156423be6567925f944d365a0b066a6c19" + ], + "title": "Change project logo", + "message": "Change project logo\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-12-06T13:33:21.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-12-06T13:33:21.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/85ff3602e090f7a5c2e2691982ff3d8a6dfb1e22" + }, + "pipeline": { + "id": 1097349658, + "iid": 15, + "project_id": 50817395, + "sha": "85ff3602e090f7a5c2e2691982ff3d8a6dfb1e22", + "ref": "main", + "status": "canceled", + "source": "push", + "created_at": "2023-12-06T12:43:21.693Z", + "updated_at": "2023-12-06T14:09:19.155Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1097349658" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5693671740", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [], + "runner": null, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [ + "$GITLAB_CI_DEFAULT_TAGS" + ] + }, + { + "id": 5693671734, + "status": "canceled", + "stage": "lint", + "name": "lint", + "ref": "main", + "tag": false, + "coverage": null, + "allow_failure": true, + "created_at": "2023-12-06T14:05:46.443Z", + "started_at": null, + "finished_at": "2023-12-06T14:09:19.003Z", + "erased_at": null, + "duration": null, + "queued_duration": null, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "85ff3602e090f7a5c2e2691982ff3d8a6dfb1e22", + "short_id": "85ff3602", + "created_at": "2023-12-06T13:33:21.000+01:00", + "parent_ids": [ + "0b3adf156423be6567925f944d365a0b066a6c19" + ], + "title": "Change project logo", + "message": "Change project logo\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2023-12-06T13:33:21.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2023-12-06T13:33:21.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/85ff3602e090f7a5c2e2691982ff3d8a6dfb1e22" + }, + "pipeline": { + "id": 1097349658, + "iid": 15, + "project_id": 50817395, + "sha": "85ff3602e090f7a5c2e2691982ff3d8a6dfb1e22", + "ref": "main", + "status": "canceled", + "source": "push", + "created_at": "2023-12-06T12:43:21.693Z", + "updated_at": "2023-12-06T14:09:19.155Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1097349658" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/5693671734", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [], + "runner": null, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [ + "$GITLAB_CI_DEFAULT_TAGS" + ] + } +] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1097349658/test_report.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1097349658/test_report.json new file mode 100644 index 0000000..6728c4e --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1097349658/test_report.json @@ -0,0 +1,9 @@ +{ + "total_time": 0, + "total_count": 0, + "success_count": 0, + "failed_count": 0, + "skipped_count": 0, + "error_count": 0, + "test_suites": [] +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1097349658/test_report_summary.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1097349658/test_report_summary.json new file mode 100644 index 0000000..6e39e02 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1097349658/test_report_summary.json @@ -0,0 +1,12 @@ +{ + "total": { + "time": 0, + "count": 0, + "success": 0, + "failed": 0, + "skipped": 0, + "error": 0, + "suite_error": null + }, + "test_suites": [] +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1152841291.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1152841291.json new file mode 100644 index 0000000..aa3028c --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1152841291.json @@ -0,0 +1,42 @@ +{ + "id": 1152841291, + "iid": 16, + "project_id": 50817395, + "sha": "5e0c3f2408466c952ea366346c5d8dc6fb8486f7", + "ref": "main", + "status": "failed", + "source": "push", + "created_at": "2024-01-26T05:45:54.032Z", + "updated_at": "2024-01-26T05:46:21.720Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1152841291", + "before_sha": "85ff3602e090f7a5c2e2691982ff3d8a6dfb1e22", + "tag": false, + "yaml_errors": null, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev" + }, + "started_at": "2024-01-26T05:45:54.976Z", + "finished_at": "2024-01-26T05:46:21.713Z", + "committed_at": null, + "duration": 26, + "queued_duration": null, + "coverage": null, + "detailed_status": { + "icon": "status_failed", + "text": "Failed", + "label": "failed", + "group": "failed", + "tooltip": "failed", + "has_details": false, + "details_path": "/cluttrdev/gitlab-exporter/-/pipelines/1152841291", + "illustration": null, + "favicon": "/assets/ci_favicons/favicon_status_failed-41304d7f7e3828808b0c26771f0309e55296819a9beea3ea9fbf6689d9857c12.png" + }, + "name": null +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1152841291/bridges.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1152841291/bridges.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1152841291/bridges.json @@ -0,0 +1 @@ +[] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1152841291/jobs.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1152841291/jobs.json new file mode 100644 index 0000000..b7f8378 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1152841291/jobs.json @@ -0,0 +1,349 @@ +[ + { + "id": 6023070569, + "status": "skipped", + "stage": "test", + "name": "test", + "ref": "main", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2024-01-26T05:45:54.076Z", + "started_at": null, + "finished_at": null, + "erased_at": null, + "duration": null, + "queued_duration": null, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "5e0c3f2408466c952ea366346c5d8dc6fb8486f7", + "short_id": "5e0c3f24", + "created_at": "2024-01-26T06:45:40.000+01:00", + "parent_ids": [ + "5099d6c21a9ee69220f6eb6e56f5b1e4595ea5bd" + ], + "title": "Fix testreport cases pb conversion", + "message": "Fix testreport cases pb conversion\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2024-01-26T06:45:40.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2024-01-26T06:45:40.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/5e0c3f2408466c952ea366346c5d8dc6fb8486f7" + }, + "pipeline": { + "id": 1152841291, + "iid": 16, + "project_id": 50817395, + "sha": "5e0c3f2408466c952ea366346c5d8dc6fb8486f7", + "ref": "main", + "status": "failed", + "source": "push", + "created_at": "2024-01-26T05:45:54.032Z", + "updated_at": "2024-01-26T05:46:21.720Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1152841291" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/6023070569", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [], + "runner": null, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 6023070568, + "status": "skipped", + "stage": "build", + "name": "build", + "ref": "main", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2024-01-26T05:45:54.068Z", + "started_at": null, + "finished_at": null, + "erased_at": null, + "duration": null, + "queued_duration": null, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "5e0c3f2408466c952ea366346c5d8dc6fb8486f7", + "short_id": "5e0c3f24", + "created_at": "2024-01-26T06:45:40.000+01:00", + "parent_ids": [ + "5099d6c21a9ee69220f6eb6e56f5b1e4595ea5bd" + ], + "title": "Fix testreport cases pb conversion", + "message": "Fix testreport cases pb conversion\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2024-01-26T06:45:40.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2024-01-26T06:45:40.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/5e0c3f2408466c952ea366346c5d8dc6fb8486f7" + }, + "pipeline": { + "id": 1152841291, + "iid": 16, + "project_id": 50817395, + "sha": "5e0c3f2408466c952ea366346c5d8dc6fb8486f7", + "ref": "main", + "status": "failed", + "source": "push", + "created_at": "2024-01-26T05:45:54.032Z", + "updated_at": "2024-01-26T05:46:21.720Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1152841291" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/6023070568", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [], + "runner": null, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 6023070567, + "status": "skipped", + "stage": "lint", + "name": "lint", + "ref": "main", + "tag": false, + "coverage": null, + "allow_failure": true, + "created_at": "2024-01-26T05:45:54.060Z", + "started_at": null, + "finished_at": null, + "erased_at": null, + "duration": null, + "queued_duration": null, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "5e0c3f2408466c952ea366346c5d8dc6fb8486f7", + "short_id": "5e0c3f24", + "created_at": "2024-01-26T06:45:40.000+01:00", + "parent_ids": [ + "5099d6c21a9ee69220f6eb6e56f5b1e4595ea5bd" + ], + "title": "Fix testreport cases pb conversion", + "message": "Fix testreport cases pb conversion\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2024-01-26T06:45:40.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2024-01-26T06:45:40.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/5e0c3f2408466c952ea366346c5d8dc6fb8486f7" + }, + "pipeline": { + "id": 1152841291, + "iid": 16, + "project_id": 50817395, + "sha": "5e0c3f2408466c952ea366346c5d8dc6fb8486f7", + "ref": "main", + "status": "failed", + "source": "push", + "created_at": "2024-01-26T05:45:54.032Z", + "updated_at": "2024-01-26T05:46:21.720Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1152841291" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/6023070567", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [], + "runner": null, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 6023070565, + "status": "failed", + "stage": ".pre", + "name": "download", + "ref": "main", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2024-01-26T05:45:54.050Z", + "started_at": "2024-01-26T05:45:54.868Z", + "finished_at": "2024-01-26T05:46:21.414Z", + "erased_at": null, + "duration": 26.546159, + "queued_duration": 0.443955, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "5e0c3f2408466c952ea366346c5d8dc6fb8486f7", + "short_id": "5e0c3f24", + "created_at": "2024-01-26T06:45:40.000+01:00", + "parent_ids": [ + "5099d6c21a9ee69220f6eb6e56f5b1e4595ea5bd" + ], + "title": "Fix testreport cases pb conversion", + "message": "Fix testreport cases pb conversion\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2024-01-26T06:45:40.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2024-01-26T06:45:40.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/5e0c3f2408466c952ea366346c5d8dc6fb8486f7" + }, + "pipeline": { + "id": 1152841291, + "iid": 16, + "project_id": 50817395, + "sha": "5e0c3f2408466c952ea366346c5d8dc6fb8486f7", + "ref": "main", + "status": "failed", + "source": "push", + "created_at": "2024-01-26T05:45:54.032Z", + "updated_at": "2024-01-26T05:46:21.720Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1152841291" + }, + "failure_reason": "script_failure", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/6023070565", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 2469, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270807, + "description": "1-blue.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.250", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": true, + "status": "online" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + } +] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1152841291/test_report.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1152841291/test_report.json new file mode 100644 index 0000000..6728c4e --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1152841291/test_report.json @@ -0,0 +1,9 @@ +{ + "total_time": 0, + "total_count": 0, + "success_count": 0, + "failed_count": 0, + "skipped_count": 0, + "error_count": 0, + "test_suites": [] +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1152841291/test_report_summary.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1152841291/test_report_summary.json new file mode 100644 index 0000000..6e39e02 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1152841291/test_report_summary.json @@ -0,0 +1,12 @@ +{ + "total": { + "time": 0, + "count": 0, + "success": 0, + "failed": 0, + "skipped": 0, + "error": 0, + "suite_error": null + }, + "test_suites": [] +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1152848130.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1152848130.json new file mode 100644 index 0000000..036b2ff --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1152848130.json @@ -0,0 +1,42 @@ +{ + "id": 1152848130, + "iid": 17, + "project_id": 50817395, + "sha": "69cc1f0e34c553860c1fd6b6e091650409490daf", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2024-01-26T05:55:34.230Z", + "updated_at": "2024-01-26T05:58:43.564Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1152848130", + "before_sha": "5e0c3f2408466c952ea366346c5d8dc6fb8486f7", + "tag": false, + "yaml_errors": null, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev" + }, + "started_at": "2024-01-26T05:55:34.991Z", + "finished_at": "2024-01-26T05:58:43.558Z", + "committed_at": null, + "duration": 187, + "queued_duration": null, + "coverage": null, + "detailed_status": { + "icon": "status_warning", + "text": "Warning", + "label": "passed with warnings", + "group": "success-with-warnings", + "tooltip": "passed", + "has_details": false, + "details_path": "/cluttrdev/gitlab-exporter/-/pipelines/1152848130", + "illustration": null, + "favicon": "/assets/ci_favicons/favicon_status_success-8451333011eee8ce9f2ab25dc487fe24a8758c694827a582f17f42b0a90446a2.png" + }, + "name": null +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1152848130/bridges.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1152848130/bridges.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1152848130/bridges.json @@ -0,0 +1 @@ +[] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1152848130/jobs.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1152848130/jobs.json new file mode 100644 index 0000000..af07ee4 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1152848130/jobs.json @@ -0,0 +1,403 @@ +[ + { + "id": 6023123883, + "status": "success", + "stage": "test", + "name": "test", + "ref": "main", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2024-01-26T05:55:34.263Z", + "started_at": "2024-01-26T05:57:47.251Z", + "finished_at": "2024-01-26T05:58:43.456Z", + "erased_at": null, + "duration": 56.204891, + "queued_duration": 0.271924, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "69cc1f0e34c553860c1fd6b6e091650409490daf", + "short_id": "69cc1f0e", + "created_at": "2024-01-26T06:55:27.000+01:00", + "parent_ids": [ + "5e0c3f2408466c952ea366346c5d8dc6fb8486f7" + ], + "title": "Fix go version used in .gitlab-ci.yml", + "message": "Fix go version used in .gitlab-ci.yml\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2024-01-26T06:55:27.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2024-01-26T06:55:27.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/69cc1f0e34c553860c1fd6b6e091650409490daf" + }, + "pipeline": { + "id": 1152848130, + "iid": 17, + "project_id": 50817395, + "sha": "69cc1f0e34c553860c1fd6b6e091650409490daf", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2024-01-26T05:55:34.230Z", + "updated_at": "2024-01-26T05:58:43.564Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1152848130" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/6023123883", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 5819, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270807, + "description": "1-blue.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.250", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": true, + "status": "online" + }, + "artifacts_expire_at": "2024-02-25T05:58:41.237Z", + "archived": false, + "tag_list": [] + }, + { + "id": 6023123882, + "status": "success", + "stage": "build", + "name": "build", + "ref": "main", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2024-01-26T05:55:34.254Z", + "started_at": "2024-01-26T05:56:36.229Z", + "finished_at": "2024-01-26T05:57:46.822Z", + "erased_at": null, + "duration": 70.592955, + "queued_duration": 0.096446, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "69cc1f0e34c553860c1fd6b6e091650409490daf", + "short_id": "69cc1f0e", + "created_at": "2024-01-26T06:55:27.000+01:00", + "parent_ids": [ + "5e0c3f2408466c952ea366346c5d8dc6fb8486f7" + ], + "title": "Fix go version used in .gitlab-ci.yml", + "message": "Fix go version used in .gitlab-ci.yml\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2024-01-26T06:55:27.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2024-01-26T06:55:27.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/69cc1f0e34c553860c1fd6b6e091650409490daf" + }, + "pipeline": { + "id": 1152848130, + "iid": 17, + "project_id": 50817395, + "sha": "69cc1f0e34c553860c1fd6b6e091650409490daf", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2024-01-26T05:55:34.230Z", + "updated_at": "2024-01-26T05:58:43.564Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1152848130" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/6023123882", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 2999, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270807, + "description": "1-blue.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.250", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": true, + "status": "online" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 6023123880, + "status": "failed", + "stage": "lint", + "name": "lint", + "ref": "main", + "tag": false, + "coverage": null, + "allow_failure": true, + "created_at": "2024-01-26T05:55:34.247Z", + "started_at": "2024-01-26T05:56:07.210Z", + "finished_at": "2024-01-26T05:56:36.037Z", + "erased_at": null, + "duration": 28.827148, + "queued_duration": 0.400442, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "69cc1f0e34c553860c1fd6b6e091650409490daf", + "short_id": "69cc1f0e", + "created_at": "2024-01-26T06:55:27.000+01:00", + "parent_ids": [ + "5e0c3f2408466c952ea366346c5d8dc6fb8486f7" + ], + "title": "Fix go version used in .gitlab-ci.yml", + "message": "Fix go version used in .gitlab-ci.yml\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2024-01-26T06:55:27.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2024-01-26T06:55:27.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/69cc1f0e34c553860c1fd6b6e091650409490daf" + }, + "pipeline": { + "id": 1152848130, + "iid": 17, + "project_id": 50817395, + "sha": "69cc1f0e34c553860c1fd6b6e091650409490daf", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2024-01-26T05:55:34.230Z", + "updated_at": "2024-01-26T05:58:43.564Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1152848130" + }, + "failure_reason": "script_failure", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/6023123880", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 3227, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270807, + "description": "1-blue.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.250", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": true, + "status": "online" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 6023123879, + "status": "success", + "stage": ".pre", + "name": "download", + "ref": "main", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2024-01-26T05:55:34.238Z", + "started_at": "2024-01-26T05:55:34.860Z", + "finished_at": "2024-01-26T05:56:06.684Z", + "erased_at": null, + "duration": 31.823659, + "queued_duration": 0.249417, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "69cc1f0e34c553860c1fd6b6e091650409490daf", + "short_id": "69cc1f0e", + "created_at": "2024-01-26T06:55:27.000+01:00", + "parent_ids": [ + "5e0c3f2408466c952ea366346c5d8dc6fb8486f7" + ], + "title": "Fix go version used in .gitlab-ci.yml", + "message": "Fix go version used in .gitlab-ci.yml\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2024-01-26T06:55:27.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2024-01-26T06:55:27.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/69cc1f0e34c553860c1fd6b6e091650409490daf" + }, + "pipeline": { + "id": 1152848130, + "iid": 17, + "project_id": 50817395, + "sha": "69cc1f0e34c553860c1fd6b6e091650409490daf", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2024-01-26T05:55:34.230Z", + "updated_at": "2024-01-26T05:58:43.564Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1152848130" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/6023123879", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 3038, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270840, + "description": "5-blue.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.247", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": true, + "status": "online" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + } +] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1152848130/test_report.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1152848130/test_report.json new file mode 100644 index 0000000..6728c4e --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1152848130/test_report.json @@ -0,0 +1,9 @@ +{ + "total_time": 0, + "total_count": 0, + "success_count": 0, + "failed_count": 0, + "skipped_count": 0, + "error_count": 0, + "test_suites": [] +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1152848130/test_report_summary.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1152848130/test_report_summary.json new file mode 100644 index 0000000..bc12315 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1152848130/test_report_summary.json @@ -0,0 +1,26 @@ +{ + "total": { + "time": 0.0, + "count": 10, + "success": 10, + "failed": 0, + "skipped": 0, + "error": 0, + "suite_error": null + }, + "test_suites": [ + { + "name": "test", + "total_time": 0.0, + "total_count": 10, + "success_count": 10, + "failed_count": 0, + "skipped_count": 0, + "error_count": 0, + "build_ids": [ + 6023123883 + ], + "suite_error": null + } + ] +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1153225469.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1153225469.json new file mode 100644 index 0000000..af00691 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1153225469.json @@ -0,0 +1,42 @@ +{ + "id": 1153225469, + "iid": 18, + "project_id": 50817395, + "sha": "e8420b5fe7c3cfc444e27f0f24fb2f1855462e2b", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2024-01-26T10:20:32.166Z", + "updated_at": "2024-01-26T20:00:17.534Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1153225469", + "before_sha": "69cc1f0e34c553860c1fd6b6e091650409490daf", + "tag": false, + "yaml_errors": null, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev" + }, + "started_at": "2024-01-26T10:20:33.521Z", + "finished_at": "2024-01-26T20:00:17.528Z", + "committed_at": null, + "duration": 176, + "queued_duration": 1, + "coverage": null, + "detailed_status": { + "icon": "status_warning", + "text": "Warning", + "label": "passed with warnings", + "group": "success-with-warnings", + "tooltip": "passed", + "has_details": false, + "details_path": "/cluttrdev/gitlab-exporter/-/pipelines/1153225469", + "illustration": null, + "favicon": "/assets/ci_favicons/favicon_status_success-8451333011eee8ce9f2ab25dc487fe24a8758c694827a582f17f42b0a90446a2.png" + }, + "name": null +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1153225469/bridges.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1153225469/bridges.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1153225469/bridges.json @@ -0,0 +1 @@ +[] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1153225469/jobs.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1153225469/jobs.json new file mode 100644 index 0000000..470a95a --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1153225469/jobs.json @@ -0,0 +1,403 @@ +[ + { + "id": 6032927095, + "status": "success", + "stage": "test", + "name": "test", + "ref": "main", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2024-01-26T19:59:27.600Z", + "started_at": "2024-01-26T19:59:28.121Z", + "finished_at": "2024-01-26T20:00:17.448Z", + "erased_at": null, + "duration": 49.32683, + "queued_duration": 0.213692, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "e8420b5fe7c3cfc444e27f0f24fb2f1855462e2b", + "short_id": "e8420b5f", + "created_at": "2024-01-26T11:20:22.000+01:00", + "parent_ids": [ + "7c8e4219704f1096b9debed5c62400daf8b90339" + ], + "title": "Update helm chart appVersion and default registry", + "message": "Update helm chart appVersion and default registry\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2024-01-26T11:20:22.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2024-01-26T11:20:22.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/e8420b5fe7c3cfc444e27f0f24fb2f1855462e2b" + }, + "pipeline": { + "id": 1153225469, + "iid": 18, + "project_id": 50817395, + "sha": "e8420b5fe7c3cfc444e27f0f24fb2f1855462e2b", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2024-01-26T10:20:32.166Z", + "updated_at": "2024-01-26T20:00:17.534Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1153225469" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/6032927095", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 5108, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270835, + "description": "3-blue.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.64", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": true, + "status": "online" + }, + "artifacts_expire_at": "2024-02-25T20:00:15.045Z", + "archived": false, + "tag_list": [] + }, + { + "id": 6026205685, + "status": "success", + "stage": "build", + "name": "build", + "ref": "main", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2024-01-26T10:20:32.217Z", + "started_at": "2024-01-26T10:21:54.106Z", + "finished_at": "2024-01-26T10:22:41.036Z", + "erased_at": null, + "duration": 46.929167, + "queued_duration": 0.132809, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "e8420b5fe7c3cfc444e27f0f24fb2f1855462e2b", + "short_id": "e8420b5f", + "created_at": "2024-01-26T11:20:22.000+01:00", + "parent_ids": [ + "7c8e4219704f1096b9debed5c62400daf8b90339" + ], + "title": "Update helm chart appVersion and default registry", + "message": "Update helm chart appVersion and default registry\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2024-01-26T11:20:22.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2024-01-26T11:20:22.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/e8420b5fe7c3cfc444e27f0f24fb2f1855462e2b" + }, + "pipeline": { + "id": 1153225469, + "iid": 18, + "project_id": 50817395, + "sha": "e8420b5fe7c3cfc444e27f0f24fb2f1855462e2b", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2024-01-26T10:20:32.166Z", + "updated_at": "2024-01-26T20:00:17.534Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1153225469" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/6026205685", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 3005, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270837, + "description": "4-blue.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.253", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": true, + "status": "online" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 6026205681, + "status": "failed", + "stage": "lint", + "name": "lint", + "ref": "main", + "tag": false, + "coverage": null, + "allow_failure": true, + "created_at": "2024-01-26T10:20:32.203Z", + "started_at": "2024-01-26T10:21:18.470Z", + "finished_at": "2024-01-26T10:21:53.857Z", + "erased_at": null, + "duration": 35.386329, + "queued_duration": 0.160108, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "e8420b5fe7c3cfc444e27f0f24fb2f1855462e2b", + "short_id": "e8420b5f", + "created_at": "2024-01-26T11:20:22.000+01:00", + "parent_ids": [ + "7c8e4219704f1096b9debed5c62400daf8b90339" + ], + "title": "Update helm chart appVersion and default registry", + "message": "Update helm chart appVersion and default registry\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2024-01-26T11:20:22.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2024-01-26T11:20:22.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/e8420b5fe7c3cfc444e27f0f24fb2f1855462e2b" + }, + "pipeline": { + "id": 1153225469, + "iid": 18, + "project_id": 50817395, + "sha": "e8420b5fe7c3cfc444e27f0f24fb2f1855462e2b", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2024-01-26T10:20:32.166Z", + "updated_at": "2024-01-26T20:00:17.534Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1153225469" + }, + "failure_reason": "script_failure", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/6026205681", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 3232, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270837, + "description": "4-blue.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.253", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": true, + "status": "online" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 6026205678, + "status": "success", + "stage": ".pre", + "name": "download", + "ref": "main", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2024-01-26T10:20:32.191Z", + "started_at": "2024-01-26T10:20:32.919Z", + "finished_at": "2024-01-26T10:21:18.168Z", + "erased_at": null, + "duration": 45.248839, + "queued_duration": 0.162188, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "e8420b5fe7c3cfc444e27f0f24fb2f1855462e2b", + "short_id": "e8420b5f", + "created_at": "2024-01-26T11:20:22.000+01:00", + "parent_ids": [ + "7c8e4219704f1096b9debed5c62400daf8b90339" + ], + "title": "Update helm chart appVersion and default registry", + "message": "Update helm chart appVersion and default registry\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2024-01-26T11:20:22.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2024-01-26T11:20:22.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/e8420b5fe7c3cfc444e27f0f24fb2f1855462e2b" + }, + "pipeline": { + "id": 1153225469, + "iid": 18, + "project_id": 50817395, + "sha": "e8420b5fe7c3cfc444e27f0f24fb2f1855462e2b", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2024-01-26T10:20:32.166Z", + "updated_at": "2024-01-26T20:00:17.534Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1153225469" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/6026205678", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 3011, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270837, + "description": "4-blue.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.253", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": true, + "status": "online" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + } +] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1153225469/test_report.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1153225469/test_report.json new file mode 100644 index 0000000..6728c4e --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1153225469/test_report.json @@ -0,0 +1,9 @@ +{ + "total_time": 0, + "total_count": 0, + "success_count": 0, + "failed_count": 0, + "skipped_count": 0, + "error_count": 0, + "test_suites": [] +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1153225469/test_report_summary.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1153225469/test_report_summary.json new file mode 100644 index 0000000..93ea13f --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1153225469/test_report_summary.json @@ -0,0 +1,26 @@ +{ + "total": { + "time": 0.0, + "count": 10, + "success": 10, + "failed": 0, + "skipped": 0, + "error": 0, + "suite_error": null + }, + "test_suites": [ + { + "name": "test", + "total_time": 0.0, + "total_count": 10, + "success_count": 10, + "failed_count": 0, + "skipped_count": 0, + "error_count": 0, + "build_ids": [ + 6032927095 + ], + "suite_error": null + } + ] +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1164454482.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1164454482.json new file mode 100644 index 0000000..971a942 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1164454482.json @@ -0,0 +1,42 @@ +{ + "id": 1164454482, + "iid": 19, + "project_id": 50817395, + "sha": "f10fc73679895a9c7f86ea1dc72aa29cecba2083", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2024-02-05T09:27:09.477Z", + "updated_at": "2024-02-05T09:30:05.079Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1164454482", + "before_sha": "e8420b5fe7c3cfc444e27f0f24fb2f1855462e2b", + "tag": false, + "yaml_errors": null, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev" + }, + "started_at": "2024-02-05T09:27:10.423Z", + "finished_at": "2024-02-05T09:30:05.060Z", + "committed_at": null, + "duration": 173, + "queued_duration": null, + "coverage": null, + "detailed_status": { + "icon": "status_warning", + "text": "Warning", + "label": "passed with warnings", + "group": "success-with-warnings", + "tooltip": "passed", + "has_details": false, + "details_path": "/cluttrdev/gitlab-exporter/-/pipelines/1164454482", + "illustration": null, + "favicon": "/assets/ci_favicons/favicon_status_success-8451333011eee8ce9f2ab25dc487fe24a8758c694827a582f17f42b0a90446a2.png" + }, + "name": null +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1164454482/bridges.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1164454482/bridges.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1164454482/bridges.json @@ -0,0 +1 @@ +[] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1164454482/jobs.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1164454482/jobs.json new file mode 100644 index 0000000..ba1b867 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1164454482/jobs.json @@ -0,0 +1,403 @@ +[ + { + "id": 6094859750, + "status": "success", + "stage": "test", + "name": "test", + "ref": "main", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2024-02-05T09:27:09.747Z", + "started_at": "2024-02-05T09:29:07.776Z", + "finished_at": "2024-02-05T09:30:04.875Z", + "erased_at": null, + "duration": 57.099415, + "queued_duration": 0.285593, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "f10fc73679895a9c7f86ea1dc72aa29cecba2083", + "short_id": "f10fc736", + "created_at": "2024-02-04T21:19:29.000+01:00", + "parent_ids": [ + "4c1550dd11e8dbc76a2ea942f5de3bc506272cf5" + ], + "title": "Update helm chart versions", + "message": "Update helm chart versions\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2024-02-04T21:19:29.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2024-02-04T21:19:29.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/f10fc73679895a9c7f86ea1dc72aa29cecba2083" + }, + "pipeline": { + "id": 1164454482, + "iid": 19, + "project_id": 50817395, + "sha": "f10fc73679895a9c7f86ea1dc72aa29cecba2083", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2024-02-05T09:27:09.477Z", + "updated_at": "2024-02-05T09:30:05.079Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1164454482" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/6094859750", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 5093, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270807, + "description": "1-blue.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.250", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": true, + "status": "online" + }, + "artifacts_expire_at": "2024-03-06T09:30:02.575Z", + "archived": false, + "tag_list": [] + }, + { + "id": 6094859738, + "status": "success", + "stage": "build", + "name": "build", + "ref": "main", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2024-02-05T09:27:09.648Z", + "started_at": "2024-02-05T09:28:21.578Z", + "finished_at": "2024-02-05T09:29:07.344Z", + "erased_at": null, + "duration": 45.765946, + "queued_duration": 0.108443, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "f10fc73679895a9c7f86ea1dc72aa29cecba2083", + "short_id": "f10fc736", + "created_at": "2024-02-04T21:19:29.000+01:00", + "parent_ids": [ + "4c1550dd11e8dbc76a2ea942f5de3bc506272cf5" + ], + "title": "Update helm chart versions", + "message": "Update helm chart versions\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2024-02-04T21:19:29.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2024-02-04T21:19:29.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/f10fc73679895a9c7f86ea1dc72aa29cecba2083" + }, + "pipeline": { + "id": 1164454482, + "iid": 19, + "project_id": 50817395, + "sha": "f10fc73679895a9c7f86ea1dc72aa29cecba2083", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2024-02-05T09:27:09.477Z", + "updated_at": "2024-02-05T09:30:05.079Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1164454482" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/6094859738", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 3004, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270840, + "description": "5-blue.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.247", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": true, + "status": "online" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 6094859732, + "status": "failed", + "stage": "lint", + "name": "lint", + "ref": "main", + "tag": false, + "coverage": null, + "allow_failure": true, + "created_at": "2024-02-05T09:27:09.611Z", + "started_at": "2024-02-05T09:27:46.479Z", + "finished_at": "2024-02-05T09:28:21.345Z", + "erased_at": null, + "duration": 34.866324, + "queued_duration": 0.280708, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "f10fc73679895a9c7f86ea1dc72aa29cecba2083", + "short_id": "f10fc736", + "created_at": "2024-02-04T21:19:29.000+01:00", + "parent_ids": [ + "4c1550dd11e8dbc76a2ea942f5de3bc506272cf5" + ], + "title": "Update helm chart versions", + "message": "Update helm chart versions\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2024-02-04T21:19:29.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2024-02-04T21:19:29.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/f10fc73679895a9c7f86ea1dc72aa29cecba2083" + }, + "pipeline": { + "id": 1164454482, + "iid": 19, + "project_id": 50817395, + "sha": "f10fc73679895a9c7f86ea1dc72aa29cecba2083", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2024-02-05T09:27:09.477Z", + "updated_at": "2024-02-05T09:30:05.079Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1164454482" + }, + "failure_reason": "script_failure", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/6094859732", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 3227, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270807, + "description": "1-blue.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.250", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": true, + "status": "online" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 6094859719, + "status": "success", + "stage": ".pre", + "name": "download", + "ref": "main", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2024-02-05T09:27:09.559Z", + "started_at": "2024-02-05T09:27:10.290Z", + "finished_at": "2024-02-05T09:27:45.900Z", + "erased_at": null, + "duration": 35.610265, + "queued_duration": 0.094818, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "f10fc73679895a9c7f86ea1dc72aa29cecba2083", + "short_id": "f10fc736", + "created_at": "2024-02-04T21:19:29.000+01:00", + "parent_ids": [ + "4c1550dd11e8dbc76a2ea942f5de3bc506272cf5" + ], + "title": "Update helm chart versions", + "message": "Update helm chart versions\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2024-02-04T21:19:29.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2024-02-04T21:19:29.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/f10fc73679895a9c7f86ea1dc72aa29cecba2083" + }, + "pipeline": { + "id": 1164454482, + "iid": 19, + "project_id": 50817395, + "sha": "f10fc73679895a9c7f86ea1dc72aa29cecba2083", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2024-02-05T09:27:09.477Z", + "updated_at": "2024-02-05T09:30:05.079Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1164454482" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/6094859719", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 2945, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270807, + "description": "1-blue.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.250", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": true, + "status": "online" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + } +] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1164454482/test_report.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1164454482/test_report.json new file mode 100644 index 0000000..6728c4e --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1164454482/test_report.json @@ -0,0 +1,9 @@ +{ + "total_time": 0, + "total_count": 0, + "success_count": 0, + "failed_count": 0, + "skipped_count": 0, + "error_count": 0, + "test_suites": [] +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1164454482/test_report_summary.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1164454482/test_report_summary.json new file mode 100644 index 0000000..521f861 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1164454482/test_report_summary.json @@ -0,0 +1,26 @@ +{ + "total": { + "time": 0.0, + "count": 10, + "success": 10, + "failed": 0, + "skipped": 0, + "error": 0, + "suite_error": null + }, + "test_suites": [ + { + "name": "test", + "total_time": 0.0, + "total_count": 10, + "success_count": 10, + "failed_count": 0, + "skipped_count": 0, + "error_count": 0, + "build_ids": [ + 6094859750 + ], + "suite_error": null + } + ] +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1181733739.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1181733739.json new file mode 100644 index 0000000..ab088ae --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1181733739.json @@ -0,0 +1,42 @@ +{ + "id": 1181733739, + "iid": 20, + "project_id": 50817395, + "sha": "a195a889a676f72513cda690ffc80298777dfacb", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2024-02-19T10:00:24.940Z", + "updated_at": "2024-02-19T10:04:46.738Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1181733739", + "before_sha": "f10fc73679895a9c7f86ea1dc72aa29cecba2083", + "tag": false, + "yaml_errors": null, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev" + }, + "started_at": "2024-02-19T10:00:28.278Z", + "finished_at": "2024-02-19T10:04:46.728Z", + "committed_at": null, + "duration": 257, + "queued_duration": 3, + "coverage": null, + "detailed_status": { + "icon": "status_warning", + "text": "Warning", + "label": "passed with warnings", + "group": "success-with-warnings", + "tooltip": "passed", + "has_details": false, + "details_path": "/cluttrdev/gitlab-exporter/-/pipelines/1181733739", + "illustration": null, + "favicon": "/assets/ci_favicons/favicon_status_success-8451333011eee8ce9f2ab25dc487fe24a8758c694827a582f17f42b0a90446a2.png" + }, + "name": null +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1181733739/bridges.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1181733739/bridges.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1181733739/bridges.json @@ -0,0 +1 @@ +[] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1181733739/jobs.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1181733739/jobs.json new file mode 100644 index 0000000..4c00bfb --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1181733739/jobs.json @@ -0,0 +1,403 @@ +[ + { + "id": 6202264956, + "status": "success", + "stage": "test", + "name": "test", + "ref": "main", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2024-02-19T10:00:24.985Z", + "started_at": "2024-02-19T10:03:49.274Z", + "finished_at": "2024-02-19T10:04:46.634Z", + "erased_at": null, + "duration": 57.360288, + "queued_duration": 0.181922, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "a195a889a676f72513cda690ffc80298777dfacb", + "short_id": "a195a889", + "created_at": "2024-02-19T10:59:33.000+01:00", + "parent_ids": [ + "3f8958547cf7e1869a03162fdb5b0074bfd60216" + ], + "title": "Add --catchup flag to run command", + "message": "Add --catchup flag to run command\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2024-02-19T10:59:33.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2024-02-19T10:59:33.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/a195a889a676f72513cda690ffc80298777dfacb" + }, + "pipeline": { + "id": 1181733739, + "iid": 20, + "project_id": 50817395, + "sha": "a195a889a676f72513cda690ffc80298777dfacb", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2024-02-19T10:00:24.940Z", + "updated_at": "2024-02-19T10:04:46.738Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1181733739" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/6202264956", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 5093, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270807, + "description": "1-blue.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.250", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": true, + "status": "online" + }, + "artifacts_expire_at": "2024-03-20T10:04:44.552Z", + "archived": false, + "tag_list": [] + }, + { + "id": 6202264953, + "status": "success", + "stage": "build", + "name": "build", + "ref": "main", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2024-02-19T10:00:24.976Z", + "started_at": "2024-02-19T10:02:29.203Z", + "finished_at": "2024-02-19T10:03:48.885Z", + "erased_at": null, + "duration": 79.682309, + "queued_duration": 0.160659, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "a195a889a676f72513cda690ffc80298777dfacb", + "short_id": "a195a889", + "created_at": "2024-02-19T10:59:33.000+01:00", + "parent_ids": [ + "3f8958547cf7e1869a03162fdb5b0074bfd60216" + ], + "title": "Add --catchup flag to run command", + "message": "Add --catchup flag to run command\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2024-02-19T10:59:33.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2024-02-19T10:59:33.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/a195a889a676f72513cda690ffc80298777dfacb" + }, + "pipeline": { + "id": 1181733739, + "iid": 20, + "project_id": 50817395, + "sha": "a195a889a676f72513cda690ffc80298777dfacb", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2024-02-19T10:00:24.940Z", + "updated_at": "2024-02-19T10:04:46.738Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1181733739" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/6202264953", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 3005, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270840, + "description": "5-blue.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.247", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": true, + "status": "online" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 6202264952, + "status": "failed", + "stage": "lint", + "name": "lint", + "ref": "main", + "tag": false, + "coverage": null, + "allow_failure": true, + "created_at": "2024-02-19T10:00:24.965Z", + "started_at": "2024-02-19T10:01:04.692Z", + "finished_at": "2024-02-19T10:02:28.941Z", + "erased_at": null, + "duration": 84.248999, + "queued_duration": 0.261672, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "a195a889a676f72513cda690ffc80298777dfacb", + "short_id": "a195a889", + "created_at": "2024-02-19T10:59:33.000+01:00", + "parent_ids": [ + "3f8958547cf7e1869a03162fdb5b0074bfd60216" + ], + "title": "Add --catchup flag to run command", + "message": "Add --catchup flag to run command\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2024-02-19T10:59:33.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2024-02-19T10:59:33.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/a195a889a676f72513cda690ffc80298777dfacb" + }, + "pipeline": { + "id": 1181733739, + "iid": 20, + "project_id": 50817395, + "sha": "a195a889a676f72513cda690ffc80298777dfacb", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2024-02-19T10:00:24.940Z", + "updated_at": "2024-02-19T10:04:46.738Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1181733739" + }, + "failure_reason": "script_failure", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/6202264952", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 4767, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270807, + "description": "1-blue.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.250", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": true, + "status": "online" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 6202264948, + "status": "success", + "stage": ".pre", + "name": "download", + "ref": "main", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2024-02-19T10:00:24.956Z", + "started_at": "2024-02-19T10:00:27.841Z", + "finished_at": "2024-02-19T10:01:04.175Z", + "erased_at": null, + "duration": 36.333514, + "queued_duration": 1.886241, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "a195a889a676f72513cda690ffc80298777dfacb", + "short_id": "a195a889", + "created_at": "2024-02-19T10:59:33.000+01:00", + "parent_ids": [ + "3f8958547cf7e1869a03162fdb5b0074bfd60216" + ], + "title": "Add --catchup flag to run command", + "message": "Add --catchup flag to run command\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2024-02-19T10:59:33.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2024-02-19T10:59:33.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/a195a889a676f72513cda690ffc80298777dfacb" + }, + "pipeline": { + "id": 1181733739, + "iid": 20, + "project_id": 50817395, + "sha": "a195a889a676f72513cda690ffc80298777dfacb", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2024-02-19T10:00:24.940Z", + "updated_at": "2024-02-19T10:04:46.738Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1181733739" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/6202264948", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 2951, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270831, + "description": "2-blue.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.65", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": true, + "status": "online" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + } +] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1181733739/test_report.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1181733739/test_report.json new file mode 100644 index 0000000..6728c4e --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1181733739/test_report.json @@ -0,0 +1,9 @@ +{ + "total_time": 0, + "total_count": 0, + "success_count": 0, + "failed_count": 0, + "skipped_count": 0, + "error_count": 0, + "test_suites": [] +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1181733739/test_report_summary.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1181733739/test_report_summary.json new file mode 100644 index 0000000..bdcfdcb --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1181733739/test_report_summary.json @@ -0,0 +1,26 @@ +{ + "total": { + "time": 0.0, + "count": 10, + "success": 10, + "failed": 0, + "skipped": 0, + "error": 0, + "suite_error": null + }, + "test_suites": [ + { + "name": "test", + "total_time": 0.0, + "total_count": 10, + "success_count": 10, + "failed_count": 0, + "skipped_count": 0, + "error_count": 0, + "build_ids": [ + 6202264956 + ], + "suite_error": null + } + ] +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1190130970.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1190130970.json new file mode 100644 index 0000000..b4d6f91 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1190130970.json @@ -0,0 +1,42 @@ +{ + "id": 1190130970, + "iid": 21, + "project_id": 50817395, + "sha": "e5e89430184a636a4bf3e7afeb5f83c6af79b59e", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2024-02-25T21:34:40.344Z", + "updated_at": "2024-03-04T08:00:33.890Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1190130970", + "before_sha": "a195a889a676f72513cda690ffc80298777dfacb", + "tag": false, + "yaml_errors": null, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev" + }, + "started_at": "2024-02-25T21:34:41.205Z", + "finished_at": "2024-03-04T08:00:33.876Z", + "committed_at": null, + "duration": 243, + "queued_duration": null, + "coverage": null, + "detailed_status": { + "icon": "status_warning", + "text": "Warning", + "label": "passed with warnings", + "group": "success-with-warnings", + "tooltip": "passed", + "has_details": false, + "details_path": "/cluttrdev/gitlab-exporter/-/pipelines/1190130970", + "illustration": null, + "favicon": "/assets/ci_favicons/favicon_status_success-8451333011eee8ce9f2ab25dc487fe24a8758c694827a582f17f42b0a90446a2.png" + }, + "name": null +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1190130970/bridges.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1190130970/bridges.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1190130970/bridges.json @@ -0,0 +1 @@ +[] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1190130970/jobs.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1190130970/jobs.json new file mode 100644 index 0000000..f4d582d --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1190130970/jobs.json @@ -0,0 +1,403 @@ +[ + { + "id": 6308490339, + "status": "success", + "stage": "test", + "name": "test", + "ref": "main", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2024-03-04T07:59:38.704Z", + "started_at": "2024-03-04T07:59:39.030Z", + "finished_at": "2024-03-04T08:00:33.380Z", + "erased_at": null, + "duration": 54.350139, + "queued_duration": 0.136247, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "e5e89430184a636a4bf3e7afeb5f83c6af79b59e", + "short_id": "e5e89430", + "created_at": "2024-02-25T22:33:59.000+01:00", + "parent_ids": [ + "687536e42f47414fbe86a68364bb5c666a095e1b" + ], + "title": "Release v0.7.0", + "message": "Release v0.7.0\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2024-02-25T22:33:59.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2024-02-25T22:33:59.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/e5e89430184a636a4bf3e7afeb5f83c6af79b59e" + }, + "pipeline": { + "id": 1190130970, + "iid": 21, + "project_id": 50817395, + "sha": "e5e89430184a636a4bf3e7afeb5f83c6af79b59e", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2024-02-25T21:34:40.344Z", + "updated_at": "2024-03-04T08:00:33.890Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1190130970" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/6308490339", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 5098, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270840, + "description": "5-blue.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.247", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": true, + "status": "online" + }, + "artifacts_expire_at": "2024-04-03T08:00:30.159Z", + "archived": false, + "tag_list": [] + }, + { + "id": 6252785470, + "status": "success", + "stage": "build", + "name": "build", + "ref": "main", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2024-02-25T21:34:40.381Z", + "started_at": "2024-02-25T21:36:51.708Z", + "finished_at": "2024-02-25T21:37:50.653Z", + "erased_at": null, + "duration": 58.94445, + "queued_duration": 0.575741, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "e5e89430184a636a4bf3e7afeb5f83c6af79b59e", + "short_id": "e5e89430", + "created_at": "2024-02-25T22:33:59.000+01:00", + "parent_ids": [ + "687536e42f47414fbe86a68364bb5c666a095e1b" + ], + "title": "Release v0.7.0", + "message": "Release v0.7.0\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2024-02-25T22:33:59.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2024-02-25T22:33:59.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/e5e89430184a636a4bf3e7afeb5f83c6af79b59e" + }, + "pipeline": { + "id": 1190130970, + "iid": 21, + "project_id": 50817395, + "sha": "e5e89430184a636a4bf3e7afeb5f83c6af79b59e", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2024-02-25T21:34:40.344Z", + "updated_at": "2024-03-04T08:00:33.890Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1190130970" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/6252785470", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 3006, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270835, + "description": "3-blue.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.64", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": true, + "status": "online" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 6252785469, + "status": "failed", + "stage": "lint", + "name": "lint", + "ref": "main", + "tag": false, + "coverage": null, + "allow_failure": true, + "created_at": "2024-02-25T21:34:40.373Z", + "started_at": "2024-02-25T21:35:29.189Z", + "finished_at": "2024-02-25T21:36:51.014Z", + "erased_at": null, + "duration": 81.824477, + "queued_duration": 0.244478, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "e5e89430184a636a4bf3e7afeb5f83c6af79b59e", + "short_id": "e5e89430", + "created_at": "2024-02-25T22:33:59.000+01:00", + "parent_ids": [ + "687536e42f47414fbe86a68364bb5c666a095e1b" + ], + "title": "Release v0.7.0", + "message": "Release v0.7.0\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2024-02-25T22:33:59.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2024-02-25T22:33:59.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/e5e89430184a636a4bf3e7afeb5f83c6af79b59e" + }, + "pipeline": { + "id": 1190130970, + "iid": 21, + "project_id": 50817395, + "sha": "e5e89430184a636a4bf3e7afeb5f83c6af79b59e", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2024-02-25T21:34:40.344Z", + "updated_at": "2024-03-04T08:00:33.890Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1190130970" + }, + "failure_reason": "script_failure", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/6252785469", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 4769, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270840, + "description": "5-blue.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.247", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": true, + "status": "online" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 6252785467, + "status": "success", + "stage": ".pre", + "name": "download", + "ref": "main", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2024-02-25T21:34:40.361Z", + "started_at": "2024-02-25T21:34:40.935Z", + "finished_at": "2024-02-25T21:35:28.818Z", + "erased_at": null, + "duration": 47.883192, + "queued_duration": 0.144417, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "e5e89430184a636a4bf3e7afeb5f83c6af79b59e", + "short_id": "e5e89430", + "created_at": "2024-02-25T22:33:59.000+01:00", + "parent_ids": [ + "687536e42f47414fbe86a68364bb5c666a095e1b" + ], + "title": "Release v0.7.0", + "message": "Release v0.7.0\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2024-02-25T22:33:59.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2024-02-25T22:33:59.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/e5e89430184a636a4bf3e7afeb5f83c6af79b59e" + }, + "pipeline": { + "id": 1190130970, + "iid": 21, + "project_id": 50817395, + "sha": "e5e89430184a636a4bf3e7afeb5f83c6af79b59e", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2024-02-25T21:34:40.344Z", + "updated_at": "2024-03-04T08:00:33.890Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1190130970" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/6252785467", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 3005, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270807, + "description": "1-blue.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.250", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": true, + "status": "online" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + } +] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1190130970/test_report.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1190130970/test_report.json new file mode 100644 index 0000000..6728c4e --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1190130970/test_report.json @@ -0,0 +1,9 @@ +{ + "total_time": 0, + "total_count": 0, + "success_count": 0, + "failed_count": 0, + "skipped_count": 0, + "error_count": 0, + "test_suites": [] +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1190130970/test_report_summary.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1190130970/test_report_summary.json new file mode 100644 index 0000000..fd0faa9 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1190130970/test_report_summary.json @@ -0,0 +1,26 @@ +{ + "total": { + "time": 0.0, + "count": 10, + "success": 10, + "failed": 0, + "skipped": 0, + "error": 0, + "suite_error": null + }, + "test_suites": [ + { + "name": "test", + "total_time": 0.0, + "total_count": 10, + "success_count": 10, + "failed_count": 0, + "skipped_count": 0, + "error_count": 0, + "build_ids": [ + 6308490339 + ], + "suite_error": null + } + ] +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1190131018.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1190131018.json new file mode 100644 index 0000000..a78c89c --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1190131018.json @@ -0,0 +1,42 @@ +{ + "id": 1190131018, + "iid": 22, + "project_id": 50817395, + "sha": "7c8e4219704f1096b9debed5c62400daf8b90339", + "ref": "v0.5.0", + "status": "success", + "source": "push", + "created_at": "2024-02-25T21:34:58.653Z", + "updated_at": "2024-02-25T21:39:19.687Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1190131018", + "before_sha": "0000000000000000000000000000000000000000", + "tag": true, + "yaml_errors": null, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev" + }, + "started_at": "2024-02-25T21:35:00.347Z", + "finished_at": "2024-02-25T21:39:19.676Z", + "committed_at": null, + "duration": 257, + "queued_duration": 1, + "coverage": null, + "detailed_status": { + "icon": "status_success", + "text": "Passed", + "label": "passed", + "group": "success", + "tooltip": "passed", + "has_details": false, + "details_path": "/cluttrdev/gitlab-exporter/-/pipelines/1190131018", + "illustration": null, + "favicon": "/assets/ci_favicons/favicon_status_success-8451333011eee8ce9f2ab25dc487fe24a8758c694827a582f17f42b0a90446a2.png" + }, + "name": null +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1190131018/bridges.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1190131018/bridges.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1190131018/bridges.json @@ -0,0 +1 @@ +[] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1190131018/jobs.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1190131018/jobs.json new file mode 100644 index 0000000..ba321fd --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1190131018/jobs.json @@ -0,0 +1,408 @@ +[ + { + "id": 6252785905, + "status": "success", + "stage": "test", + "name": "test", + "ref": "v0.5.0", + "tag": true, + "coverage": null, + "allow_failure": false, + "created_at": "2024-02-25T21:34:58.699Z", + "started_at": "2024-02-25T21:38:15.565Z", + "finished_at": "2024-02-25T21:39:19.564Z", + "erased_at": null, + "duration": 63.999592, + "queued_duration": 1.26542, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "7c8e4219704f1096b9debed5c62400daf8b90339", + "short_id": "7c8e4219", + "created_at": "2024-01-26T10:18:15.000+01:00", + "parent_ids": [ + "7c655b2188a43d4e86116e293c656d1d2fcb6fbb" + ], + "title": "Release v0.5.0", + "message": "Release v0.5.0\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2024-01-26T07:41:06.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2024-01-26T10:18:15.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/7c8e4219704f1096b9debed5c62400daf8b90339" + }, + "pipeline": { + "id": 1190131018, + "iid": 22, + "project_id": 50817395, + "sha": "7c8e4219704f1096b9debed5c62400daf8b90339", + "ref": "v0.5.0", + "status": "success", + "source": "push", + "created_at": "2024-02-25T21:34:58.653Z", + "updated_at": "2024-02-25T21:39:19.687Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1190131018" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/6252785905", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "junit", + "size": 407, + "filename": "junit.xml.gz", + "file_format": "gzip" + }, + { + "file_type": "trace", + "size": 5850, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270840, + "description": "5-blue.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.247", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": true, + "status": "online" + }, + "artifacts_expire_at": "2024-03-26T21:39:17.381Z", + "archived": false, + "tag_list": [] + }, + { + "id": 6252785904, + "status": "success", + "stage": "build", + "name": "build", + "ref": "v0.5.0", + "tag": true, + "coverage": null, + "allow_failure": false, + "created_at": "2024-02-25T21:34:58.689Z", + "started_at": "2024-02-25T21:36:56.033Z", + "finished_at": "2024-02-25T21:38:14.198Z", + "erased_at": null, + "duration": 78.164729, + "queued_duration": 0.299926, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "7c8e4219704f1096b9debed5c62400daf8b90339", + "short_id": "7c8e4219", + "created_at": "2024-01-26T10:18:15.000+01:00", + "parent_ids": [ + "7c655b2188a43d4e86116e293c656d1d2fcb6fbb" + ], + "title": "Release v0.5.0", + "message": "Release v0.5.0\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2024-01-26T07:41:06.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2024-01-26T10:18:15.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/7c8e4219704f1096b9debed5c62400daf8b90339" + }, + "pipeline": { + "id": 1190131018, + "iid": 22, + "project_id": 50817395, + "sha": "7c8e4219704f1096b9debed5c62400daf8b90339", + "ref": "v0.5.0", + "status": "success", + "source": "push", + "created_at": "2024-02-25T21:34:58.653Z", + "updated_at": "2024-02-25T21:39:19.687Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1190131018" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/6252785904", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 3025, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270807, + "description": "1-blue.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.250", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": true, + "status": "online" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 6252785903, + "status": "success", + "stage": "lint", + "name": "lint", + "ref": "v0.5.0", + "tag": true, + "coverage": null, + "allow_failure": true, + "created_at": "2024-02-25T21:34:58.676Z", + "started_at": "2024-02-25T21:35:33.701Z", + "finished_at": "2024-02-25T21:36:55.605Z", + "erased_at": null, + "duration": 81.90452, + "queued_duration": 0.242911, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "7c8e4219704f1096b9debed5c62400daf8b90339", + "short_id": "7c8e4219", + "created_at": "2024-01-26T10:18:15.000+01:00", + "parent_ids": [ + "7c655b2188a43d4e86116e293c656d1d2fcb6fbb" + ], + "title": "Release v0.5.0", + "message": "Release v0.5.0\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2024-01-26T07:41:06.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2024-01-26T10:18:15.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/7c8e4219704f1096b9debed5c62400daf8b90339" + }, + "pipeline": { + "id": 1190131018, + "iid": 22, + "project_id": 50817395, + "sha": "7c8e4219704f1096b9debed5c62400daf8b90339", + "ref": "v0.5.0", + "status": "success", + "source": "push", + "created_at": "2024-02-25T21:34:58.653Z", + "updated_at": "2024-02-25T21:39:19.687Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1190131018" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/6252785903", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 4640, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270835, + "description": "3-blue.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.64", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": true, + "status": "online" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 6252785902, + "status": "success", + "stage": ".pre", + "name": "download", + "ref": "v0.5.0", + "tag": true, + "coverage": null, + "allow_failure": false, + "created_at": "2024-02-25T21:34:58.663Z", + "started_at": "2024-02-25T21:35:00.203Z", + "finished_at": "2024-02-25T21:35:33.335Z", + "erased_at": null, + "duration": 33.132873, + "queued_duration": 0.211264, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "7c8e4219704f1096b9debed5c62400daf8b90339", + "short_id": "7c8e4219", + "created_at": "2024-01-26T10:18:15.000+01:00", + "parent_ids": [ + "7c655b2188a43d4e86116e293c656d1d2fcb6fbb" + ], + "title": "Release v0.5.0", + "message": "Release v0.5.0\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2024-01-26T07:41:06.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2024-01-26T10:18:15.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/7c8e4219704f1096b9debed5c62400daf8b90339" + }, + "pipeline": { + "id": 1190131018, + "iid": 22, + "project_id": 50817395, + "sha": "7c8e4219704f1096b9debed5c62400daf8b90339", + "ref": "v0.5.0", + "status": "success", + "source": "push", + "created_at": "2024-02-25T21:34:58.653Z", + "updated_at": "2024-02-25T21:39:19.687Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1190131018" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/6252785902", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 3059, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270831, + "description": "2-blue.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.65", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": true, + "status": "online" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + } +] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1190131018/test_report.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1190131018/test_report.json new file mode 100644 index 0000000..54c534b --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1190131018/test_report.json @@ -0,0 +1,122 @@ +{ + "total_time": 0.0, + "total_count": 10, + "success_count": 10, + "failed_count": 0, + "skipped_count": 0, + "error_count": 0, + "test_suites": [ + { + "name": "test", + "total_time": 0.0, + "total_count": 10, + "success_count": 10, + "failed_count": 0, + "skipped_count": 0, + "error_count": 0, + "suite_error": null, + "test_cases": [ + { + "status": "success", + "name": "Test_NewDefault", + "classname": "github.com/cluttrdev/gitlab-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "Test_NewDefaultProjectSettings", + "classname": "github.com/cluttrdev/gitlab-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestLoad_EmptyData", + "classname": "github.com/cluttrdev/gitlab-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestLoad_PartialData", + "classname": "github.com/cluttrdev/gitlab-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestLoad_UnknownData", + "classname": "github.com/cluttrdev/gitlab-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestLoad_InvalidData", + "classname": "github.com/cluttrdev/gitlab-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestLoad_DataWithDefaults", + "classname": "github.com/cluttrdev/gitlab-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestLoad_DataWithProjects", + "classname": "github.com/cluttrdev/gitlab-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestLoad_DataWithCustomServerAddress", + "classname": "github.com/cluttrdev/gitlab-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestLoad_DataWithEndpoints", + "classname": "github.com/cluttrdev/gitlab-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + } + ] + } + ] +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1190131018/test_report_summary.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1190131018/test_report_summary.json new file mode 100644 index 0000000..c8a666a --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1190131018/test_report_summary.json @@ -0,0 +1,26 @@ +{ + "total": { + "time": 0.0, + "count": 10, + "success": 10, + "failed": 0, + "skipped": 0, + "error": 0, + "suite_error": null + }, + "test_suites": [ + { + "name": "test", + "total_time": 0.0, + "total_count": 10, + "success_count": 10, + "failed_count": 0, + "skipped_count": 0, + "error_count": 0, + "build_ids": [ + 6252785905 + ], + "suite_error": null + } + ] +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1190131020.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1190131020.json new file mode 100644 index 0000000..3f57210 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1190131020.json @@ -0,0 +1,42 @@ +{ + "id": 1190131020, + "iid": 23, + "project_id": 50817395, + "sha": "4c1550dd11e8dbc76a2ea942f5de3bc506272cf5", + "ref": "v0.5.1", + "status": "success", + "source": "push", + "created_at": "2024-02-25T21:34:59.109Z", + "updated_at": "2024-02-25T21:39:28.357Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1190131020", + "before_sha": "0000000000000000000000000000000000000000", + "tag": true, + "yaml_errors": null, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev" + }, + "started_at": "2024-02-25T21:34:59.739Z", + "finished_at": "2024-02-25T21:39:28.347Z", + "committed_at": null, + "duration": 267, + "queued_duration": null, + "coverage": null, + "detailed_status": { + "icon": "status_success", + "text": "Passed", + "label": "passed", + "group": "success", + "tooltip": "passed", + "has_details": false, + "details_path": "/cluttrdev/gitlab-exporter/-/pipelines/1190131020", + "illustration": null, + "favicon": "/assets/ci_favicons/favicon_status_success-8451333011eee8ce9f2ab25dc487fe24a8758c694827a582f17f42b0a90446a2.png" + }, + "name": null +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1190131020/bridges.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1190131020/bridges.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1190131020/bridges.json @@ -0,0 +1 @@ +[] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1190131020/jobs.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1190131020/jobs.json new file mode 100644 index 0000000..22035a7 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1190131020/jobs.json @@ -0,0 +1,408 @@ +[ + { + "id": 6252785912, + "status": "success", + "stage": "test", + "name": "test", + "ref": "v0.5.1", + "tag": true, + "coverage": null, + "allow_failure": false, + "created_at": "2024-02-25T21:34:59.153Z", + "started_at": "2024-02-25T21:38:20.427Z", + "finished_at": "2024-02-25T21:39:28.246Z", + "erased_at": null, + "duration": 67.818952, + "queued_duration": 0.258736, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "4c1550dd11e8dbc76a2ea942f5de3bc506272cf5", + "short_id": "4c1550dd", + "created_at": "2024-02-04T21:07:44.000+01:00", + "parent_ids": [ + "9edd1b59cd269892da086451d89ab765a9383f1d" + ], + "title": "Release v0.5.1", + "message": "Release v0.5.1\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2024-02-04T21:07:44.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2024-02-04T21:07:44.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/4c1550dd11e8dbc76a2ea942f5de3bc506272cf5" + }, + "pipeline": { + "id": 1190131020, + "iid": 23, + "project_id": 50817395, + "sha": "4c1550dd11e8dbc76a2ea942f5de3bc506272cf5", + "ref": "v0.5.1", + "status": "success", + "source": "push", + "created_at": "2024-02-25T21:34:59.109Z", + "updated_at": "2024-02-25T21:39:28.357Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1190131020" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/6252785912", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "junit", + "size": 405, + "filename": "junit.xml.gz", + "file_format": "gzip" + }, + { + "file_type": "trace", + "size": 5851, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270837, + "description": "4-blue.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.253", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": true, + "status": "online" + }, + "artifacts_expire_at": "2024-03-26T21:39:25.866Z", + "archived": false, + "tag_list": [] + }, + { + "id": 6252785911, + "status": "success", + "stage": "build", + "name": "build", + "ref": "v0.5.1", + "tag": true, + "coverage": null, + "allow_failure": false, + "created_at": "2024-02-25T21:34:59.142Z", + "started_at": "2024-02-25T21:36:59.190Z", + "finished_at": "2024-02-25T21:38:20.020Z", + "erased_at": null, + "duration": 80.830577, + "queued_duration": 0.137691, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "4c1550dd11e8dbc76a2ea942f5de3bc506272cf5", + "short_id": "4c1550dd", + "created_at": "2024-02-04T21:07:44.000+01:00", + "parent_ids": [ + "9edd1b59cd269892da086451d89ab765a9383f1d" + ], + "title": "Release v0.5.1", + "message": "Release v0.5.1\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2024-02-04T21:07:44.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2024-02-04T21:07:44.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/4c1550dd11e8dbc76a2ea942f5de3bc506272cf5" + }, + "pipeline": { + "id": 1190131020, + "iid": 23, + "project_id": 50817395, + "sha": "4c1550dd11e8dbc76a2ea942f5de3bc506272cf5", + "ref": "v0.5.1", + "status": "success", + "source": "push", + "created_at": "2024-02-25T21:34:59.109Z", + "updated_at": "2024-02-25T21:39:28.357Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1190131020" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/6252785911", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 3031, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270831, + "description": "2-blue.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.65", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": true, + "status": "online" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 6252785910, + "status": "success", + "stage": "lint", + "name": "lint", + "ref": "v0.5.1", + "tag": true, + "coverage": null, + "allow_failure": true, + "created_at": "2024-02-25T21:34:59.129Z", + "started_at": "2024-02-25T21:35:33.783Z", + "finished_at": "2024-02-25T21:36:58.806Z", + "erased_at": null, + "duration": 85.023021, + "queued_duration": 0.40195, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "4c1550dd11e8dbc76a2ea942f5de3bc506272cf5", + "short_id": "4c1550dd", + "created_at": "2024-02-04T21:07:44.000+01:00", + "parent_ids": [ + "9edd1b59cd269892da086451d89ab765a9383f1d" + ], + "title": "Release v0.5.1", + "message": "Release v0.5.1\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2024-02-04T21:07:44.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2024-02-04T21:07:44.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/4c1550dd11e8dbc76a2ea942f5de3bc506272cf5" + }, + "pipeline": { + "id": 1190131020, + "iid": 23, + "project_id": 50817395, + "sha": "4c1550dd11e8dbc76a2ea942f5de3bc506272cf5", + "ref": "v0.5.1", + "status": "success", + "source": "push", + "created_at": "2024-02-25T21:34:59.109Z", + "updated_at": "2024-02-25T21:39:28.357Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1190131020" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/6252785910", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 4642, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270840, + "description": "5-blue.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.247", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": true, + "status": "online" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 6252785909, + "status": "success", + "stage": ".pre", + "name": "download", + "ref": "v0.5.1", + "tag": true, + "coverage": null, + "allow_failure": false, + "created_at": "2024-02-25T21:34:59.120Z", + "started_at": "2024-02-25T21:34:59.606Z", + "finished_at": "2024-02-25T21:35:33.285Z", + "erased_at": null, + "duration": 33.679734, + "queued_duration": 0.094081, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "4c1550dd11e8dbc76a2ea942f5de3bc506272cf5", + "short_id": "4c1550dd", + "created_at": "2024-02-04T21:07:44.000+01:00", + "parent_ids": [ + "9edd1b59cd269892da086451d89ab765a9383f1d" + ], + "title": "Release v0.5.1", + "message": "Release v0.5.1\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2024-02-04T21:07:44.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2024-02-04T21:07:44.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/4c1550dd11e8dbc76a2ea942f5de3bc506272cf5" + }, + "pipeline": { + "id": 1190131020, + "iid": 23, + "project_id": 50817395, + "sha": "4c1550dd11e8dbc76a2ea942f5de3bc506272cf5", + "ref": "v0.5.1", + "status": "success", + "source": "push", + "created_at": "2024-02-25T21:34:59.109Z", + "updated_at": "2024-02-25T21:39:28.357Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1190131020" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/6252785909", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 3059, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270831, + "description": "2-blue.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.65", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": true, + "status": "online" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + } +] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1190131020/test_report.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1190131020/test_report.json new file mode 100644 index 0000000..54c534b --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1190131020/test_report.json @@ -0,0 +1,122 @@ +{ + "total_time": 0.0, + "total_count": 10, + "success_count": 10, + "failed_count": 0, + "skipped_count": 0, + "error_count": 0, + "test_suites": [ + { + "name": "test", + "total_time": 0.0, + "total_count": 10, + "success_count": 10, + "failed_count": 0, + "skipped_count": 0, + "error_count": 0, + "suite_error": null, + "test_cases": [ + { + "status": "success", + "name": "Test_NewDefault", + "classname": "github.com/cluttrdev/gitlab-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "Test_NewDefaultProjectSettings", + "classname": "github.com/cluttrdev/gitlab-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestLoad_EmptyData", + "classname": "github.com/cluttrdev/gitlab-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestLoad_PartialData", + "classname": "github.com/cluttrdev/gitlab-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestLoad_UnknownData", + "classname": "github.com/cluttrdev/gitlab-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestLoad_InvalidData", + "classname": "github.com/cluttrdev/gitlab-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestLoad_DataWithDefaults", + "classname": "github.com/cluttrdev/gitlab-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestLoad_DataWithProjects", + "classname": "github.com/cluttrdev/gitlab-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestLoad_DataWithCustomServerAddress", + "classname": "github.com/cluttrdev/gitlab-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestLoad_DataWithEndpoints", + "classname": "github.com/cluttrdev/gitlab-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + } + ] + } + ] +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1190131020/test_report_summary.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1190131020/test_report_summary.json new file mode 100644 index 0000000..5b60963 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1190131020/test_report_summary.json @@ -0,0 +1,26 @@ +{ + "total": { + "time": 0.0, + "count": 10, + "success": 10, + "failed": 0, + "skipped": 0, + "error": 0, + "suite_error": null + }, + "test_suites": [ + { + "name": "test", + "total_time": 0.0, + "total_count": 10, + "success_count": 10, + "failed_count": 0, + "skipped_count": 0, + "error_count": 0, + "build_ids": [ + 6252785912 + ], + "suite_error": null + } + ] +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204507964.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204507964.json new file mode 100644 index 0000000..8f83650 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204507964.json @@ -0,0 +1,42 @@ +{ + "id": 1204507964, + "iid": 24, + "project_id": 50817395, + "sha": "7b5d43c650a04710ecd9a88885700ab1918e6441", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2024-03-07T10:26:28.245Z", + "updated_at": "2024-03-07T10:31:01.391Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1204507964", + "before_sha": "e5e89430184a636a4bf3e7afeb5f83c6af79b59e", + "tag": false, + "yaml_errors": null, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev" + }, + "started_at": "2024-03-07T10:26:29.264Z", + "finished_at": "2024-03-07T10:31:01.342Z", + "committed_at": null, + "duration": 270, + "queued_duration": 1, + "coverage": null, + "detailed_status": { + "icon": "status_warning", + "text": "Warning", + "label": "passed with warnings", + "group": "success-with-warnings", + "tooltip": "passed", + "has_details": false, + "details_path": "/cluttrdev/gitlab-exporter/-/pipelines/1204507964", + "illustration": null, + "favicon": "/assets/ci_favicons/favicon_status_success-8451333011eee8ce9f2ab25dc487fe24a8758c694827a582f17f42b0a90446a2.png" + }, + "name": null +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204507964/bridges.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204507964/bridges.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204507964/bridges.json @@ -0,0 +1 @@ +[] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204507964/jobs.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204507964/jobs.json new file mode 100644 index 0000000..0de59e5 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204507964/jobs.json @@ -0,0 +1,403 @@ +[ + { + "id": 6339864447, + "status": "success", + "stage": "test", + "name": "test", + "ref": "main", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2024-03-07T10:26:28.302Z", + "started_at": "2024-03-07T10:29:51.590Z", + "finished_at": "2024-03-07T10:31:00.988Z", + "erased_at": null, + "duration": 69.397726, + "queued_duration": 0.08904, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "7b5d43c650a04710ecd9a88885700ab1918e6441", + "short_id": "7b5d43c6", + "created_at": "2024-03-07T07:45:16.000+01:00", + "parent_ids": [ + "35d27d3a6e6baa6c17dfc5743894872906c9b15d" + ], + "title": "Remove obsolete config.catch_up.forced option", + "message": "Remove obsolete config.catch_up.forced option\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2024-03-07T07:45:16.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2024-03-07T07:45:16.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/7b5d43c650a04710ecd9a88885700ab1918e6441" + }, + "pipeline": { + "id": 1204507964, + "iid": 24, + "project_id": 50817395, + "sha": "7b5d43c650a04710ecd9a88885700ab1918e6441", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2024-03-07T10:26:28.245Z", + "updated_at": "2024-03-07T10:31:01.391Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1204507964" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/6339864447", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 6279, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270857, + "description": "4-green.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.252", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": false, + "status": "offline" + }, + "artifacts_expire_at": "2024-04-06T10:30:57.923Z", + "archived": false, + "tag_list": [] + }, + { + "id": 6339864440, + "status": "success", + "stage": "build", + "name": "build", + "ref": "main", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2024-03-07T10:26:28.291Z", + "started_at": "2024-03-07T10:28:28.347Z", + "finished_at": "2024-03-07T10:29:51.392Z", + "erased_at": null, + "duration": 83.044913, + "queued_duration": 0.147947, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "7b5d43c650a04710ecd9a88885700ab1918e6441", + "short_id": "7b5d43c6", + "created_at": "2024-03-07T07:45:16.000+01:00", + "parent_ids": [ + "35d27d3a6e6baa6c17dfc5743894872906c9b15d" + ], + "title": "Remove obsolete config.catch_up.forced option", + "message": "Remove obsolete config.catch_up.forced option\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2024-03-07T07:45:16.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2024-03-07T07:45:16.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/7b5d43c650a04710ecd9a88885700ab1918e6441" + }, + "pipeline": { + "id": 1204507964, + "iid": 24, + "project_id": 50817395, + "sha": "7b5d43c650a04710ecd9a88885700ab1918e6441", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2024-03-07T10:26:28.245Z", + "updated_at": "2024-03-07T10:31:01.391Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1204507964" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/6339864440", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 2988, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270859, + "description": "5-green.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.249", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": false, + "status": "offline" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 6339864439, + "status": "failed", + "stage": "lint", + "name": "lint", + "ref": "main", + "tag": false, + "coverage": null, + "allow_failure": true, + "created_at": "2024-03-07T10:26:28.279Z", + "started_at": "2024-03-07T10:27:05.302Z", + "finished_at": "2024-03-07T10:28:28.093Z", + "erased_at": null, + "duration": 82.791368, + "queued_duration": 0.319241, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "7b5d43c650a04710ecd9a88885700ab1918e6441", + "short_id": "7b5d43c6", + "created_at": "2024-03-07T07:45:16.000+01:00", + "parent_ids": [ + "35d27d3a6e6baa6c17dfc5743894872906c9b15d" + ], + "title": "Remove obsolete config.catch_up.forced option", + "message": "Remove obsolete config.catch_up.forced option\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2024-03-07T07:45:16.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2024-03-07T07:45:16.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/7b5d43c650a04710ecd9a88885700ab1918e6441" + }, + "pipeline": { + "id": 1204507964, + "iid": 24, + "project_id": 50817395, + "sha": "7b5d43c650a04710ecd9a88885700ab1918e6441", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2024-03-07T10:26:28.245Z", + "updated_at": "2024-03-07T10:31:01.391Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1204507964" + }, + "failure_reason": "script_failure", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/6339864439", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 4752, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270848, + "description": "2-green.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.66", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": false, + "status": "offline" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 6339864434, + "status": "success", + "stage": ".pre", + "name": "download", + "ref": "main", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2024-03-07T10:26:28.264Z", + "started_at": "2024-03-07T10:26:29.005Z", + "finished_at": "2024-03-07T10:27:04.355Z", + "erased_at": null, + "duration": 35.349976, + "queued_duration": 0.189981, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "7b5d43c650a04710ecd9a88885700ab1918e6441", + "short_id": "7b5d43c6", + "created_at": "2024-03-07T07:45:16.000+01:00", + "parent_ids": [ + "35d27d3a6e6baa6c17dfc5743894872906c9b15d" + ], + "title": "Remove obsolete config.catch_up.forced option", + "message": "Remove obsolete config.catch_up.forced option\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2024-03-07T07:45:16.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2024-03-07T07:45:16.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/7b5d43c650a04710ecd9a88885700ab1918e6441" + }, + "pipeline": { + "id": 1204507964, + "iid": 24, + "project_id": 50817395, + "sha": "7b5d43c650a04710ecd9a88885700ab1918e6441", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2024-03-07T10:26:28.245Z", + "updated_at": "2024-03-07T10:31:01.391Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1204507964" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/6339864434", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 2933, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270857, + "description": "4-green.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.252", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": false, + "status": "offline" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + } +] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204507964/test_report.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204507964/test_report.json new file mode 100644 index 0000000..6728c4e --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204507964/test_report.json @@ -0,0 +1,9 @@ +{ + "total_time": 0, + "total_count": 0, + "success_count": 0, + "failed_count": 0, + "skipped_count": 0, + "error_count": 0, + "test_suites": [] +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204507964/test_report_summary.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204507964/test_report_summary.json new file mode 100644 index 0000000..c989c6c --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204507964/test_report_summary.json @@ -0,0 +1,26 @@ +{ + "total": { + "time": 0.0, + "count": 13, + "success": 13, + "failed": 0, + "skipped": 0, + "error": 0, + "suite_error": null + }, + "test_suites": [ + { + "name": "test", + "total_time": 0.0, + "total_count": 13, + "success_count": 13, + "failed_count": 0, + "skipped_count": 0, + "error_count": 0, + "build_ids": [ + 6339864447 + ], + "suite_error": null + } + ] +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204552176.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204552176.json new file mode 100644 index 0000000..27256a9 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204552176.json @@ -0,0 +1,42 @@ +{ + "id": 1204552176, + "iid": 25, + "project_id": 50817395, + "sha": "e051be877189db6c448be011e1d458e6761291bb", + "ref": "ci-custom-sections", + "status": "success", + "source": "push", + "created_at": "2024-03-07T10:46:02.293Z", + "updated_at": "2024-03-07T10:50:16.431Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1204552176", + "before_sha": "0000000000000000000000000000000000000000", + "tag": false, + "yaml_errors": null, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev" + }, + "started_at": "2024-03-07T10:46:07.207Z", + "finished_at": "2024-03-07T10:50:16.414Z", + "committed_at": null, + "duration": 250, + "queued_duration": 4, + "coverage": null, + "detailed_status": { + "icon": "status_warning", + "text": "Warning", + "label": "passed with warnings", + "group": "success-with-warnings", + "tooltip": "passed", + "has_details": false, + "details_path": "/cluttrdev/gitlab-exporter/-/pipelines/1204552176", + "illustration": null, + "favicon": "/assets/ci_favicons/favicon_status_success-8451333011eee8ce9f2ab25dc487fe24a8758c694827a582f17f42b0a90446a2.png" + }, + "name": null +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204552176/bridges.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204552176/bridges.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204552176/bridges.json @@ -0,0 +1 @@ +[] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204552176/jobs.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204552176/jobs.json new file mode 100644 index 0000000..91b1a60 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204552176/jobs.json @@ -0,0 +1,403 @@ +[ + { + "id": 6340249786, + "status": "success", + "stage": "test", + "name": "test", + "ref": "ci-custom-sections", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2024-03-07T10:46:02.517Z", + "started_at": "2024-03-07T10:49:11.879Z", + "finished_at": "2024-03-07T10:50:16.070Z", + "erased_at": null, + "duration": 64.191132, + "queued_duration": 0.103126, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "e051be877189db6c448be011e1d458e6761291bb", + "short_id": "e051be87", + "created_at": "2024-03-07T11:45:29.000+01:00", + "parent_ids": [ + "7b5d43c650a04710ecd9a88885700ab1918e6441" + ], + "title": "Add custom sections to gitlab-ci.yml", + "message": "Add custom sections to gitlab-ci.yml\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2024-03-07T11:45:29.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2024-03-07T11:45:29.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/e051be877189db6c448be011e1d458e6761291bb" + }, + "pipeline": { + "id": 1204552176, + "iid": 25, + "project_id": 50817395, + "sha": "e051be877189db6c448be011e1d458e6761291bb", + "ref": "ci-custom-sections", + "status": "success", + "source": "push", + "created_at": "2024-03-07T10:46:02.293Z", + "updated_at": "2024-03-07T10:50:16.431Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1204552176" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/6340249786", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 7855, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270845, + "description": "1-green.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.248", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": false, + "status": "offline" + }, + "artifacts_expire_at": "2024-04-06T10:50:13.747Z", + "archived": false, + "tag_list": [] + }, + { + "id": 6340249753, + "status": "success", + "stage": "build", + "name": "build", + "ref": "ci-custom-sections", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2024-03-07T10:46:02.416Z", + "started_at": "2024-03-07T10:47:58.133Z", + "finished_at": "2024-03-07T10:49:11.661Z", + "erased_at": null, + "duration": 73.52765, + "queued_duration": 0.448445, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "e051be877189db6c448be011e1d458e6761291bb", + "short_id": "e051be87", + "created_at": "2024-03-07T11:45:29.000+01:00", + "parent_ids": [ + "7b5d43c650a04710ecd9a88885700ab1918e6441" + ], + "title": "Add custom sections to gitlab-ci.yml", + "message": "Add custom sections to gitlab-ci.yml\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2024-03-07T11:45:29.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2024-03-07T11:45:29.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/e051be877189db6c448be011e1d458e6761291bb" + }, + "pipeline": { + "id": 1204552176, + "iid": 25, + "project_id": 50817395, + "sha": "e051be877189db6c448be011e1d458e6761291bb", + "ref": "ci-custom-sections", + "status": "success", + "source": "push", + "created_at": "2024-03-07T10:46:02.293Z", + "updated_at": "2024-03-07T10:50:16.431Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1204552176" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/6340249753", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 3071, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270852, + "description": "3-green.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.251", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": false, + "status": "offline" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 6340249745, + "status": "failed", + "stage": "lint", + "name": "lint", + "ref": "ci-custom-sections", + "tag": false, + "coverage": null, + "allow_failure": true, + "created_at": "2024-03-07T10:46:02.391Z", + "started_at": "2024-03-07T10:46:37.807Z", + "finished_at": "2024-03-07T10:47:57.106Z", + "erased_at": null, + "duration": 79.299173, + "queued_duration": 0.184872, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "e051be877189db6c448be011e1d458e6761291bb", + "short_id": "e051be87", + "created_at": "2024-03-07T11:45:29.000+01:00", + "parent_ids": [ + "7b5d43c650a04710ecd9a88885700ab1918e6441" + ], + "title": "Add custom sections to gitlab-ci.yml", + "message": "Add custom sections to gitlab-ci.yml\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2024-03-07T11:45:29.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2024-03-07T11:45:29.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/e051be877189db6c448be011e1d458e6761291bb" + }, + "pipeline": { + "id": 1204552176, + "iid": 25, + "project_id": 50817395, + "sha": "e051be877189db6c448be011e1d458e6761291bb", + "ref": "ci-custom-sections", + "status": "success", + "source": "push", + "created_at": "2024-03-07T10:46:02.293Z", + "updated_at": "2024-03-07T10:50:16.431Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1204552176" + }, + "failure_reason": "script_failure", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/6340249745", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 4801, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270845, + "description": "1-green.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.248", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": false, + "status": "offline" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 6340249722, + "status": "success", + "stage": ".pre", + "name": "download", + "ref": "ci-custom-sections", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2024-03-07T10:46:02.335Z", + "started_at": "2024-03-07T10:46:04.052Z", + "finished_at": "2024-03-07T10:46:37.502Z", + "erased_at": null, + "duration": 33.450719, + "queued_duration": 0.236232, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "e051be877189db6c448be011e1d458e6761291bb", + "short_id": "e051be87", + "created_at": "2024-03-07T11:45:29.000+01:00", + "parent_ids": [ + "7b5d43c650a04710ecd9a88885700ab1918e6441" + ], + "title": "Add custom sections to gitlab-ci.yml", + "message": "Add custom sections to gitlab-ci.yml\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2024-03-07T11:45:29.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2024-03-07T11:45:29.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/e051be877189db6c448be011e1d458e6761291bb" + }, + "pipeline": { + "id": 1204552176, + "iid": 25, + "project_id": 50817395, + "sha": "e051be877189db6c448be011e1d458e6761291bb", + "ref": "ci-custom-sections", + "status": "success", + "source": "push", + "created_at": "2024-03-07T10:46:02.293Z", + "updated_at": "2024-03-07T10:50:16.431Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1204552176" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/6340249722", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 3087, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270852, + "description": "3-green.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.251", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": false, + "status": "offline" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + } +] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204552176/test_report.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204552176/test_report.json new file mode 100644 index 0000000..6728c4e --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204552176/test_report.json @@ -0,0 +1,9 @@ +{ + "total_time": 0, + "total_count": 0, + "success_count": 0, + "failed_count": 0, + "skipped_count": 0, + "error_count": 0, + "test_suites": [] +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204552176/test_report_summary.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204552176/test_report_summary.json new file mode 100644 index 0000000..e07d355 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204552176/test_report_summary.json @@ -0,0 +1,26 @@ +{ + "total": { + "time": 0.01, + "count": 13, + "success": 13, + "failed": 0, + "skipped": 0, + "error": 0, + "suite_error": null + }, + "test_suites": [ + { + "name": "test", + "total_time": 0.01, + "total_count": 13, + "success_count": 13, + "failed_count": 0, + "skipped_count": 0, + "error_count": 0, + "build_ids": [ + 6340249786 + ], + "suite_error": null + } + ] +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204562891.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204562891.json new file mode 100644 index 0000000..52f3df4 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204562891.json @@ -0,0 +1,42 @@ +{ + "id": 1204562891, + "iid": 26, + "project_id": 50817395, + "sha": "94749c3122bbad0f94ab126f49f8b2c0e4812dbd", + "ref": "ci-custom-sections", + "status": "success", + "source": "push", + "created_at": "2024-03-07T10:52:06.554Z", + "updated_at": "2024-03-07T10:55:47.413Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1204562891", + "before_sha": "e051be877189db6c448be011e1d458e6761291bb", + "tag": false, + "yaml_errors": null, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev" + }, + "started_at": "2024-03-07T10:52:09.741Z", + "finished_at": "2024-03-07T10:55:47.398Z", + "committed_at": null, + "duration": 215, + "queued_duration": 3, + "coverage": null, + "detailed_status": { + "icon": "status_warning", + "text": "Warning", + "label": "passed with warnings", + "group": "success-with-warnings", + "tooltip": "passed", + "has_details": false, + "details_path": "/cluttrdev/gitlab-exporter/-/pipelines/1204562891", + "illustration": null, + "favicon": "/assets/ci_favicons/favicon_status_success-8451333011eee8ce9f2ab25dc487fe24a8758c694827a582f17f42b0a90446a2.png" + }, + "name": null +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204562891/bridges.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204562891/bridges.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204562891/bridges.json @@ -0,0 +1 @@ +[] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204562891/jobs.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204562891/jobs.json new file mode 100644 index 0000000..875c071 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204562891/jobs.json @@ -0,0 +1,409 @@ +[ + { + "id": 6340338089, + "status": "success", + "stage": "test", + "name": "test", + "ref": "ci-custom-sections", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2024-03-07T10:52:07.004Z", + "started_at": "2024-03-07T10:54:58.622Z", + "finished_at": "2024-03-07T10:55:47.183Z", + "erased_at": null, + "duration": 48.561269, + "queued_duration": 0.17748, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "94749c3122bbad0f94ab126f49f8b2c0e4812dbd", + "short_id": "94749c31", + "created_at": "2024-03-07T11:51:48.000+01:00", + "parent_ids": [ + "7b5d43c650a04710ecd9a88885700ab1918e6441" + ], + "title": "Add custom sections to gitlab-ci.yml", + "message": "Add custom sections to gitlab-ci.yml\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2024-03-07T11:45:29.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2024-03-07T11:51:48.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/94749c3122bbad0f94ab126f49f8b2c0e4812dbd" + }, + "pipeline": { + "id": 1204562891, + "iid": 26, + "project_id": 50817395, + "sha": "94749c3122bbad0f94ab126f49f8b2c0e4812dbd", + "ref": "ci-custom-sections", + "status": "success", + "source": "push", + "created_at": "2024-03-07T10:52:06.554Z", + "updated_at": "2024-03-07T10:55:47.413Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1204562891" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/6340338089", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "junit", + "size": 466, + "filename": "junit.xml.gz", + "file_format": "gzip" + }, + { + "file_type": "trace", + "size": 7065, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270852, + "description": "3-green.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.251", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": false, + "status": "offline" + }, + "artifacts_expire_at": "2024-04-06T10:55:45.011Z", + "archived": false, + "tag_list": [] + }, + { + "id": 6340338075, + "status": "success", + "stage": "build", + "name": "build", + "ref": "ci-custom-sections", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2024-03-07T10:52:06.904Z", + "started_at": "2024-03-07T10:54:10.925Z", + "finished_at": "2024-03-07T10:54:58.160Z", + "erased_at": null, + "duration": 47.234835, + "queued_duration": 0.302198, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "94749c3122bbad0f94ab126f49f8b2c0e4812dbd", + "short_id": "94749c31", + "created_at": "2024-03-07T11:51:48.000+01:00", + "parent_ids": [ + "7b5d43c650a04710ecd9a88885700ab1918e6441" + ], + "title": "Add custom sections to gitlab-ci.yml", + "message": "Add custom sections to gitlab-ci.yml\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2024-03-07T11:45:29.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2024-03-07T11:51:48.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/94749c3122bbad0f94ab126f49f8b2c0e4812dbd" + }, + "pipeline": { + "id": 1204562891, + "iid": 26, + "project_id": 50817395, + "sha": "94749c3122bbad0f94ab126f49f8b2c0e4812dbd", + "ref": "ci-custom-sections", + "status": "success", + "source": "push", + "created_at": "2024-03-07T10:52:06.554Z", + "updated_at": "2024-03-07T10:55:47.413Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1204562891" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/6340338075", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 3073, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270857, + "description": "4-green.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.252", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": false, + "status": "offline" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 6340338029, + "status": "failed", + "stage": "lint", + "name": "lint", + "ref": "ci-custom-sections", + "tag": false, + "coverage": null, + "allow_failure": true, + "created_at": "2024-03-07T10:52:06.738Z", + "started_at": "2024-03-07T10:52:45.968Z", + "finished_at": "2024-03-07T10:54:10.020Z", + "erased_at": null, + "duration": 84.052234, + "queued_duration": 0.225279, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "94749c3122bbad0f94ab126f49f8b2c0e4812dbd", + "short_id": "94749c31", + "created_at": "2024-03-07T11:51:48.000+01:00", + "parent_ids": [ + "7b5d43c650a04710ecd9a88885700ab1918e6441" + ], + "title": "Add custom sections to gitlab-ci.yml", + "message": "Add custom sections to gitlab-ci.yml\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2024-03-07T11:45:29.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2024-03-07T11:51:48.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/94749c3122bbad0f94ab126f49f8b2c0e4812dbd" + }, + "pipeline": { + "id": 1204562891, + "iid": 26, + "project_id": 50817395, + "sha": "94749c3122bbad0f94ab126f49f8b2c0e4812dbd", + "ref": "ci-custom-sections", + "status": "success", + "source": "push", + "created_at": "2024-03-07T10:52:06.554Z", + "updated_at": "2024-03-07T10:55:47.413Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1204562891" + }, + "failure_reason": "script_failure", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/6340338029", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 4804, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270845, + "description": "1-green.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.248", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": false, + "status": "offline" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 6340338007, + "status": "success", + "stage": ".pre", + "name": "download", + "ref": "ci-custom-sections", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2024-03-07T10:52:06.654Z", + "started_at": "2024-03-07T10:52:09.454Z", + "finished_at": "2024-03-07T10:52:45.507Z", + "erased_at": null, + "duration": 36.0534, + "queued_duration": 1.271269, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "94749c3122bbad0f94ab126f49f8b2c0e4812dbd", + "short_id": "94749c31", + "created_at": "2024-03-07T11:51:48.000+01:00", + "parent_ids": [ + "7b5d43c650a04710ecd9a88885700ab1918e6441" + ], + "title": "Add custom sections to gitlab-ci.yml", + "message": "Add custom sections to gitlab-ci.yml\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2024-03-07T11:45:29.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2024-03-07T11:51:48.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/94749c3122bbad0f94ab126f49f8b2c0e4812dbd" + }, + "pipeline": { + "id": 1204562891, + "iid": 26, + "project_id": 50817395, + "sha": "94749c3122bbad0f94ab126f49f8b2c0e4812dbd", + "ref": "ci-custom-sections", + "status": "success", + "source": "push", + "created_at": "2024-03-07T10:52:06.554Z", + "updated_at": "2024-03-07T10:55:47.413Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1204562891" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/6340338007", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 2999, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270852, + "description": "3-green.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.251", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": false, + "status": "offline" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + } +] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204562891/test_report.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204562891/test_report.json new file mode 100644 index 0000000..51ada6f --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204562891/test_report.json @@ -0,0 +1,152 @@ +{ + "total_time": 0.01, + "total_count": 13, + "success_count": 13, + "failed_count": 0, + "skipped_count": 0, + "error_count": 0, + "test_suites": [ + { + "name": "test", + "total_time": 0.01, + "total_count": 13, + "success_count": 13, + "failed_count": 0, + "skipped_count": 0, + "error_count": 0, + "suite_error": null, + "test_cases": [ + { + "status": "success", + "name": "TestLoad_DataWithProjects", + "classname": "github.com/cluttrdev/gitlab-exporter/test/config", + "file": null, + "execution_time": 0.01, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "Test_NewDefault", + "classname": "github.com/cluttrdev/gitlab-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "Test_NewDefaultProjectSettings", + "classname": "github.com/cluttrdev/gitlab-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestLoad_EmptyData", + "classname": "github.com/cluttrdev/gitlab-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestLoad_PartialData", + "classname": "github.com/cluttrdev/gitlab-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestLoad_UnknownData", + "classname": "github.com/cluttrdev/gitlab-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestLoad_InvalidData", + "classname": "github.com/cluttrdev/gitlab-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestLoad_DataWithDefaults", + "classname": "github.com/cluttrdev/gitlab-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestLoad_DataWithProjectDefaults", + "classname": "github.com/cluttrdev/gitlab-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestLoad_DataWithCustomServerAddress", + "classname": "github.com/cluttrdev/gitlab-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestLoad_DataWithEndpoints", + "classname": "github.com/cluttrdev/gitlab-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "Test_RecordPipelines", + "classname": "github.com/cluttrdev/gitlab-exporter/test/grpc", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "Test_RecordJobs", + "classname": "github.com/cluttrdev/gitlab-exporter/test/grpc", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + } + ] + } + ] +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204562891/test_report_summary.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204562891/test_report_summary.json new file mode 100644 index 0000000..7a394a4 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204562891/test_report_summary.json @@ -0,0 +1,26 @@ +{ + "total": { + "time": 0.01, + "count": 13, + "success": 13, + "failed": 0, + "skipped": 0, + "error": 0, + "suite_error": null + }, + "test_suites": [ + { + "name": "test", + "total_time": 0.01, + "total_count": 13, + "success_count": 13, + "failed_count": 0, + "skipped_count": 0, + "error_count": 0, + "build_ids": [ + 6340338089 + ], + "suite_error": null + } + ] +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204596303.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204596303.json new file mode 100644 index 0000000..eea5e82 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204596303.json @@ -0,0 +1,42 @@ +{ + "id": 1204596303, + "iid": 27, + "project_id": 50817395, + "sha": "94749c3122bbad0f94ab126f49f8b2c0e4812dbd", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2024-03-07T11:06:20.295Z", + "updated_at": "2024-03-07T11:10:11.720Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1204596303", + "before_sha": "7b5d43c650a04710ecd9a88885700ab1918e6441", + "tag": false, + "yaml_errors": null, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev" + }, + "started_at": "2024-03-07T11:06:20.972Z", + "finished_at": "2024-03-07T11:10:11.707Z", + "committed_at": null, + "duration": 229, + "queued_duration": null, + "coverage": null, + "detailed_status": { + "icon": "status_warning", + "text": "Warning", + "label": "passed with warnings", + "group": "success-with-warnings", + "tooltip": "passed", + "has_details": false, + "details_path": "/cluttrdev/gitlab-exporter/-/pipelines/1204596303", + "illustration": null, + "favicon": "/assets/ci_favicons/favicon_status_success-8451333011eee8ce9f2ab25dc487fe24a8758c694827a582f17f42b0a90446a2.png" + }, + "name": null +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204596303/bridges.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204596303/bridges.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204596303/bridges.json @@ -0,0 +1 @@ +[] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204596303/jobs.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204596303/jobs.json new file mode 100644 index 0000000..8de9e21 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204596303/jobs.json @@ -0,0 +1,403 @@ +[ + { + "id": 6340546870, + "status": "success", + "stage": "test", + "name": "test", + "ref": "main", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2024-03-07T11:06:20.346Z", + "started_at": "2024-03-07T11:09:17.305Z", + "finished_at": "2024-03-07T11:10:11.511Z", + "erased_at": null, + "duration": 54.20545, + "queued_duration": 0.116431, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "94749c3122bbad0f94ab126f49f8b2c0e4812dbd", + "short_id": "94749c31", + "created_at": "2024-03-07T11:51:48.000+01:00", + "parent_ids": [ + "7b5d43c650a04710ecd9a88885700ab1918e6441" + ], + "title": "Add custom sections to gitlab-ci.yml", + "message": "Add custom sections to gitlab-ci.yml\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2024-03-07T11:45:29.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2024-03-07T11:51:48.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/94749c3122bbad0f94ab126f49f8b2c0e4812dbd" + }, + "pipeline": { + "id": 1204596303, + "iid": 27, + "project_id": 50817395, + "sha": "94749c3122bbad0f94ab126f49f8b2c0e4812dbd", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2024-03-07T11:06:20.295Z", + "updated_at": "2024-03-07T11:10:11.720Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1204596303" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/6340546870", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 6981, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270857, + "description": "4-green.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.252", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": false, + "status": "offline" + }, + "artifacts_expire_at": "2024-04-06T11:10:09.077Z", + "archived": false, + "tag_list": [] + }, + { + "id": 6340546867, + "status": "success", + "stage": "build", + "name": "build", + "ref": "main", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2024-03-07T11:06:20.333Z", + "started_at": "2024-03-07T11:08:24.076Z", + "finished_at": "2024-03-07T11:09:16.958Z", + "erased_at": null, + "duration": 52.881392, + "queued_duration": 0.118604, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "94749c3122bbad0f94ab126f49f8b2c0e4812dbd", + "short_id": "94749c31", + "created_at": "2024-03-07T11:51:48.000+01:00", + "parent_ids": [ + "7b5d43c650a04710ecd9a88885700ab1918e6441" + ], + "title": "Add custom sections to gitlab-ci.yml", + "message": "Add custom sections to gitlab-ci.yml\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2024-03-07T11:45:29.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2024-03-07T11:51:48.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/94749c3122bbad0f94ab126f49f8b2c0e4812dbd" + }, + "pipeline": { + "id": 1204596303, + "iid": 27, + "project_id": 50817395, + "sha": "94749c3122bbad0f94ab126f49f8b2c0e4812dbd", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2024-03-07T11:06:20.295Z", + "updated_at": "2024-03-07T11:10:11.720Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1204596303" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/6340546867", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 2987, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270857, + "description": "4-green.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.252", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": false, + "status": "offline" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 6340546863, + "status": "failed", + "stage": "lint", + "name": "lint", + "ref": "main", + "tag": false, + "coverage": null, + "allow_failure": true, + "created_at": "2024-03-07T11:06:20.320Z", + "started_at": "2024-03-07T11:07:00.259Z", + "finished_at": "2024-03-07T11:08:23.778Z", + "erased_at": null, + "duration": 83.519136, + "queued_duration": 0.135098, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "94749c3122bbad0f94ab126f49f8b2c0e4812dbd", + "short_id": "94749c31", + "created_at": "2024-03-07T11:51:48.000+01:00", + "parent_ids": [ + "7b5d43c650a04710ecd9a88885700ab1918e6441" + ], + "title": "Add custom sections to gitlab-ci.yml", + "message": "Add custom sections to gitlab-ci.yml\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2024-03-07T11:45:29.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2024-03-07T11:51:48.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/94749c3122bbad0f94ab126f49f8b2c0e4812dbd" + }, + "pipeline": { + "id": 1204596303, + "iid": 27, + "project_id": 50817395, + "sha": "94749c3122bbad0f94ab126f49f8b2c0e4812dbd", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2024-03-07T11:06:20.295Z", + "updated_at": "2024-03-07T11:10:11.720Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1204596303" + }, + "failure_reason": "script_failure", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/6340546863", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 4757, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270845, + "description": "1-green.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.248", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": false, + "status": "offline" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 6340546857, + "status": "success", + "stage": ".pre", + "name": "download", + "ref": "main", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2024-03-07T11:06:20.307Z", + "started_at": "2024-03-07T11:06:20.785Z", + "finished_at": "2024-03-07T11:06:59.999Z", + "erased_at": null, + "duration": 39.213653, + "queued_duration": 0.166007, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "94749c3122bbad0f94ab126f49f8b2c0e4812dbd", + "short_id": "94749c31", + "created_at": "2024-03-07T11:51:48.000+01:00", + "parent_ids": [ + "7b5d43c650a04710ecd9a88885700ab1918e6441" + ], + "title": "Add custom sections to gitlab-ci.yml", + "message": "Add custom sections to gitlab-ci.yml\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2024-03-07T11:45:29.000+01:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2024-03-07T11:51:48.000+01:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/94749c3122bbad0f94ab126f49f8b2c0e4812dbd" + }, + "pipeline": { + "id": 1204596303, + "iid": 27, + "project_id": 50817395, + "sha": "94749c3122bbad0f94ab126f49f8b2c0e4812dbd", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2024-03-07T11:06:20.295Z", + "updated_at": "2024-03-07T11:10:11.720Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1204596303" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/6340546857", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 2936, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 32976645, + "description": "6-green.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.99", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": null, + "online": false, + "status": "offline" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + } +] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204596303/test_report.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204596303/test_report.json new file mode 100644 index 0000000..6728c4e --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204596303/test_report.json @@ -0,0 +1,9 @@ +{ + "total_time": 0, + "total_count": 0, + "success_count": 0, + "failed_count": 0, + "skipped_count": 0, + "error_count": 0, + "test_suites": [] +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204596303/test_report_summary.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204596303/test_report_summary.json new file mode 100644 index 0000000..07b165b --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1204596303/test_report_summary.json @@ -0,0 +1,26 @@ +{ + "total": { + "time": 0.0, + "count": 13, + "success": 13, + "failed": 0, + "skipped": 0, + "error": 0, + "suite_error": null + }, + "test_suites": [ + { + "name": "test", + "total_time": 0.0, + "total_count": 13, + "success_count": 13, + "failed_count": 0, + "skipped_count": 0, + "error_count": 0, + "build_ids": [ + 6340546870 + ], + "suite_error": null + } + ] +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1252248442.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1252248442.json new file mode 100644 index 0000000..dec9f04 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1252248442.json @@ -0,0 +1,42 @@ +{ + "id": 1252248442, + "iid": 28, + "project_id": 50817395, + "sha": "f718986f8e09094e455d3bd03f7893eecfb0a0bd", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2024-04-14T11:54:37.896Z", + "updated_at": "2024-04-14T11:58:49.893Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1252248442", + "before_sha": "94749c3122bbad0f94ab126f49f8b2c0e4812dbd", + "tag": false, + "yaml_errors": null, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev" + }, + "started_at": "2024-04-14T11:54:38.771Z", + "finished_at": "2024-04-14T11:58:49.887Z", + "committed_at": null, + "duration": 249, + "queued_duration": null, + "coverage": null, + "detailed_status": { + "icon": "status_warning", + "text": "Warning", + "label": "passed with warnings", + "group": "success-with-warnings", + "tooltip": "passed", + "has_details": false, + "details_path": "/cluttrdev/gitlab-exporter/-/pipelines/1252248442", + "illustration": null, + "favicon": "/assets/ci_favicons/favicon_status_success-8451333011eee8ce9f2ab25dc487fe24a8758c694827a582f17f42b0a90446a2.png" + }, + "name": null +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1252248442/bridges.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1252248442/bridges.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1252248442/bridges.json @@ -0,0 +1 @@ +[] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1252248442/jobs.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1252248442/jobs.json new file mode 100644 index 0000000..e3931d1 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1252248442/jobs.json @@ -0,0 +1,409 @@ +[ + { + "id": 6620863477, + "status": "success", + "stage": "test", + "name": "test", + "ref": "main", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2024-04-14T11:54:37.986Z", + "started_at": "2024-04-14T11:57:47.735Z", + "finished_at": "2024-04-14T11:58:49.787Z", + "erased_at": null, + "duration": 62.051565, + "queued_duration": 0.350091, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "f718986f8e09094e455d3bd03f7893eecfb0a0bd", + "short_id": "f718986f", + "created_at": "2024-04-14T13:49:14.000+02:00", + "parent_ids": [ + "94749c3122bbad0f94ab126f49f8b2c0e4812dbd" + ], + "title": "Update README.md", + "message": "Update README.md\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2024-04-14T13:49:14.000+02:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2024-04-14T13:49:14.000+02:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/f718986f8e09094e455d3bd03f7893eecfb0a0bd" + }, + "pipeline": { + "id": 1252248442, + "iid": 28, + "project_id": 50817395, + "sha": "f718986f8e09094e455d3bd03f7893eecfb0a0bd", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2024-04-14T11:54:37.896Z", + "updated_at": "2024-04-14T11:58:49.893Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1252248442" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/6620863477", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "junit", + "size": 476, + "filename": "junit.xml.gz", + "file_format": "gzip" + }, + { + "file_type": "trace", + "size": 7706, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270837, + "description": "4-blue.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.253", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": true, + "status": "online" + }, + "artifacts_expire_at": "2024-05-14T11:58:47.642Z", + "archived": false, + "tag_list": [] + }, + { + "id": 6620863476, + "status": "success", + "stage": "build", + "name": "build", + "ref": "main", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2024-04-14T11:54:37.969Z", + "started_at": "2024-04-14T11:56:32.643Z", + "finished_at": "2024-04-14T11:57:47.268Z", + "erased_at": null, + "duration": 74.6244, + "queued_duration": 0.15493, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "f718986f8e09094e455d3bd03f7893eecfb0a0bd", + "short_id": "f718986f", + "created_at": "2024-04-14T13:49:14.000+02:00", + "parent_ids": [ + "94749c3122bbad0f94ab126f49f8b2c0e4812dbd" + ], + "title": "Update README.md", + "message": "Update README.md\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2024-04-14T13:49:14.000+02:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2024-04-14T13:49:14.000+02:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/f718986f8e09094e455d3bd03f7893eecfb0a0bd" + }, + "pipeline": { + "id": 1252248442, + "iid": 28, + "project_id": 50817395, + "sha": "f718986f8e09094e455d3bd03f7893eecfb0a0bd", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2024-04-14T11:54:37.896Z", + "updated_at": "2024-04-14T11:58:49.893Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1252248442" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/6620863476", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 3004, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270837, + "description": "4-blue.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.253", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": true, + "status": "online" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 6620863475, + "status": "failed", + "stage": "lint", + "name": "lint", + "ref": "main", + "tag": false, + "coverage": null, + "allow_failure": true, + "created_at": "2024-04-14T11:54:37.946Z", + "started_at": "2024-04-14T11:55:13.326Z", + "finished_at": "2024-04-14T11:56:32.349Z", + "erased_at": null, + "duration": 79.022437, + "queued_duration": 0.356098, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "f718986f8e09094e455d3bd03f7893eecfb0a0bd", + "short_id": "f718986f", + "created_at": "2024-04-14T13:49:14.000+02:00", + "parent_ids": [ + "94749c3122bbad0f94ab126f49f8b2c0e4812dbd" + ], + "title": "Update README.md", + "message": "Update README.md\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2024-04-14T13:49:14.000+02:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2024-04-14T13:49:14.000+02:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/f718986f8e09094e455d3bd03f7893eecfb0a0bd" + }, + "pipeline": { + "id": 1252248442, + "iid": 28, + "project_id": 50817395, + "sha": "f718986f8e09094e455d3bd03f7893eecfb0a0bd", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2024-04-14T11:54:37.896Z", + "updated_at": "2024-04-14T11:58:49.893Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1252248442" + }, + "failure_reason": "script_failure", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/6620863475", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 4809, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270831, + "description": "2-blue.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.65", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": true, + "status": "online" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + }, + { + "id": 6620863474, + "status": "success", + "stage": ".pre", + "name": "download", + "ref": "main", + "tag": false, + "coverage": null, + "allow_failure": false, + "created_at": "2024-04-14T11:54:37.928Z", + "started_at": "2024-04-14T11:54:38.613Z", + "finished_at": "2024-04-14T11:55:12.862Z", + "erased_at": null, + "duration": 34.248735, + "queued_duration": 0.117173, + "user": { + "id": 10367592, + "username": "cluttrdev", + "name": "Andreas Kunze", + "state": "active", + "locked": false, + "avatar_url": "https://gitlab.com/uploads/-/system/user/avatar/10367592/avatar.png", + "web_url": "https://gitlab.com/cluttrdev", + "created_at": "2021-12-05T10:44:29.960Z", + "bio": "", + "location": "", + "public_email": "", + "skype": "", + "linkedin": "", + "twitter": "", + "discord": "", + "website_url": "", + "organization": "", + "job_title": "", + "pronouns": "", + "bot": false, + "work_information": null, + "followers": 0, + "following": 0, + "local_time": null + }, + "commit": { + "id": "f718986f8e09094e455d3bd03f7893eecfb0a0bd", + "short_id": "f718986f", + "created_at": "2024-04-14T13:49:14.000+02:00", + "parent_ids": [ + "94749c3122bbad0f94ab126f49f8b2c0e4812dbd" + ], + "title": "Update README.md", + "message": "Update README.md\n", + "author_name": "cluttrdev", + "author_email": "andreas@cluttr.tech", + "authored_date": "2024-04-14T13:49:14.000+02:00", + "committer_name": "cluttrdev", + "committer_email": "andreas@cluttr.tech", + "committed_date": "2024-04-14T13:49:14.000+02:00", + "trailers": {}, + "extended_trailers": {}, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/commit/f718986f8e09094e455d3bd03f7893eecfb0a0bd" + }, + "pipeline": { + "id": 1252248442, + "iid": 28, + "project_id": 50817395, + "sha": "f718986f8e09094e455d3bd03f7893eecfb0a0bd", + "ref": "main", + "status": "success", + "source": "push", + "created_at": "2024-04-14T11:54:37.896Z", + "updated_at": "2024-04-14T11:58:49.893Z", + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/pipelines/1252248442" + }, + "web_url": "https://gitlab.com/cluttrdev/gitlab-exporter/-/jobs/6620863474", + "project": { + "ci_job_token_scope_enabled": false + }, + "artifacts": [ + { + "file_type": "trace", + "size": 3032, + "filename": "job.log", + "file_format": null + } + ], + "runner": { + "id": 12270807, + "description": "1-blue.saas-linux-small-amd64.runners-manager.gitlab.com/default", + "ip_address": "10.1.5.250", + "active": true, + "paused": false, + "is_shared": true, + "runner_type": "instance_type", + "name": "gitlab-runner", + "online": true, + "status": "online" + }, + "artifacts_expire_at": null, + "archived": false, + "tag_list": [] + } +] diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1252248442/test_report.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1252248442/test_report.json new file mode 100644 index 0000000..69a17e5 --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1252248442/test_report.json @@ -0,0 +1,152 @@ +{ + "total_time": 0.0, + "total_count": 13, + "success_count": 13, + "failed_count": 0, + "skipped_count": 0, + "error_count": 0, + "test_suites": [ + { + "name": "test", + "total_time": 0.0, + "total_count": 13, + "success_count": 13, + "failed_count": 0, + "skipped_count": 0, + "error_count": 0, + "suite_error": null, + "test_cases": [ + { + "status": "success", + "name": "Test_NewDefault", + "classname": "github.com/cluttrdev/gitlab-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "Test_NewDefaultProjectSettings", + "classname": "github.com/cluttrdev/gitlab-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestLoad_EmptyData", + "classname": "github.com/cluttrdev/gitlab-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestLoad_PartialData", + "classname": "github.com/cluttrdev/gitlab-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestLoad_UnknownData", + "classname": "github.com/cluttrdev/gitlab-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestLoad_InvalidData", + "classname": "github.com/cluttrdev/gitlab-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestLoad_DataWithDefaults", + "classname": "github.com/cluttrdev/gitlab-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestLoad_DataWithProjects", + "classname": "github.com/cluttrdev/gitlab-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestLoad_DataWithProjectDefaults", + "classname": "github.com/cluttrdev/gitlab-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestLoad_DataWithCustomServerAddress", + "classname": "github.com/cluttrdev/gitlab-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "TestLoad_DataWithEndpoints", + "classname": "github.com/cluttrdev/gitlab-exporter/test/config", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "Test_RecordPipelines", + "classname": "github.com/cluttrdev/gitlab-exporter/test/grpc", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + }, + { + "status": "success", + "name": "Test_RecordJobs", + "classname": "github.com/cluttrdev/gitlab-exporter/test/grpc", + "file": null, + "execution_time": 0.0, + "system_output": null, + "stack_trace": null, + "recent_failures": null + } + ] + } + ] +} diff --git a/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1252248442/test_report_summary.json b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1252248442/test_report_summary.json new file mode 100644 index 0000000..e47bcea --- /dev/null +++ b/test/integration/testdata/gitlab.com/api/v4/projects/50817395/pipelines/1252248442/test_report_summary.json @@ -0,0 +1,26 @@ +{ + "total": { + "time": 0.0, + "count": 13, + "success": 13, + "failed": 0, + "skipped": 0, + "error": 0, + "suite_error": null + }, + "test_suites": [ + { + "name": "test", + "total_time": 0.0, + "total_count": 13, + "success_count": 13, + "failed_count": 0, + "skipped_count": 0, + "error_count": 0, + "build_ids": [ + 6620863477 + ], + "suite_error": null + } + ] +} diff --git a/test/integration/testdata/update.sh b/test/integration/testdata/update.sh new file mode 100755 index 0000000..805a614 --- /dev/null +++ b/test/integration/testdata/update.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) + +export API_V4_URL=gitlab.com/api/v4 +export PROJECT_ID=50817395 + +export OUTPUT_DIR=${SCRIPT_DIR}/${API_V4_URL}/projects/${PROJECT_ID} + +mkdir -p ${OUTPUT_DIR} + +echo "${API_V4_URL}/projects/${PROJECT_ID}/pipelines" +pipelines=$(glab api --paginate projects/${PROJECT_ID}/pipelines) + +echo "${pipelines}" | jq -r > ${OUTPUT_DIR}/pipelines.json +mkdir -p ${OUTPUT_DIR}/pipelines + +fetch_pipeline_hierarchy() { + local pipeline_id=$1 + + echo "${API_V4_URL}/projects/${PROJECT_ID}/pipelines/${pipeline_id}" + glab api projects/${PROJECT_ID}/pipelines/${pipeline_id} \ + | jq -r \ + > ${OUTPUT_DIR}/pipelines/${pipeline_id}.json + + mkdir -p ${OUTPUT_DIR}/pipelines/${pipeline_id} + for resource in jobs bridges test_report test_report_summary; do + echo "${API_V4_URL}/projects/${PROJECT_ID}/pipelines/${pipeline_id}/${resource}" + glab api --paginate projects/${PROJECT_ID}/pipelines/${pipeline_id}/${resource} \ + | jq -r \ + > ${OUTPUT_DIR}/pipelines/${pipeline_id}/${resource}.json + done +} +export -f fetch_pipeline_hierarchy + +echo "${pipelines}" | jq -r '.[].id' | xargs -P 12 -I {} sh -c 'fetch_pipeline_hierarchy "$@"' _ {} +