-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy pathci_visibility_pipelines.feature
More file actions
137 lines (120 loc) · 10.6 KB
/
ci_visibility_pipelines.feature
File metadata and controls
137 lines (120 loc) · 10.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
@endpoint(ci-visibility-pipelines) @endpoint(ci-visibility-pipelines-v2)
Feature: CI Visibility Pipelines
Search or aggregate your CI Visibility pipeline events and send them to
your Datadog site over HTTP. See the [CI Pipeline Visibility in Datadog
page](https://docs.datadoghq.com/continuous_integration/pipelines/) for
more information.
Background:
Given a valid "apiKeyAuth" key in the system
And an instance of "CIVisibilityPipelines" API
@generated @skip @team:DataDog/ci-app-backend
Scenario: Aggregate pipelines events returns "Bad Request" response
Given a valid "appKeyAuth" key in the system
And new "AggregateCIAppPipelineEvents" request
And body with value {"compute": [{"aggregation": "pc90", "interval": "5m", "metric": "@duration", "type": "total"}], "filter": {"from": "now-15m", "query": "@ci.provider.name:github AND @ci.status:error", "to": "now"}, "group_by": [{"facet": "@ci.status", "histogram": {"interval": 10, "max": 100, "min": 50}, "limit": 10, "sort": {"aggregation": "count", "order": "asc"}, "total": false}], "options": {"timezone": "GMT"}}
When the request is sent
Then the response status is 400 Bad Request
@skip-java @skip-python @skip-typescript @team:DataDog/ci-app-backend
Scenario: Aggregate pipelines events returns "OK" response
Given a valid "appKeyAuth" key in the system
And new "AggregateCIAppPipelineEvents" request
And body with value {"compute": [{"aggregation": "pc90", "metric": "@duration", "type": "total"}], "filter": {"from": "now-15m", "query": "@ci.provider.name:(gitlab OR github)", "to": "now"}, "group_by": [{ "facet": "@ci.status", "limit": 10, "total": false}], "options": {"timezone": "GMT"}}
When the request is sent
Then the response status is 200 OK
And the response "meta.status" is equal to "done"
@generated @skip @team:DataDog/ci-app-backend
Scenario: Get a list of pipelines events returns "Bad Request" response
Given a valid "appKeyAuth" key in the system
And new "ListCIAppPipelineEvents" request
When the request is sent
Then the response status is 400 Bad Request
@skip-java @skip-python @skip-typescript @team:DataDog/ci-app-backend
Scenario: Get a list of pipelines events returns "OK" response
Given a valid "appKeyAuth" key in the system
And new "ListCIAppPipelineEvents" request
And request contains "filter[query]" parameter with value "@ci.provider.name:circleci"
And request contains "filter[from]" parameter with value "{{ timeISO('now - 30m') }}"
And request contains "filter[to]" parameter with value "{{ timeISO('now') }}"
And request contains "page[limit]" parameter with value 5
When the request is sent
Then the response status is 200 OK
@replay-only @skip-java @skip-python @skip-typescript @skip-validation @team:DataDog/ci-app-backend @with-pagination
Scenario: Get a list of pipelines events returns "OK" response with pagination
Given a valid "appKeyAuth" key in the system
And new "ListCIAppPipelineEvents" request
And request contains "filter[from]" parameter with value "{{ timeISO('now - 30s') }}"
And request contains "filter[to]" parameter with value "{{ timeISO('now') }}"
And request contains "page[limit]" parameter with value 2
When the request with pagination is sent
Then the response status is 200 OK
And the response has 2 items
@generated @skip @team:DataDog/ci-app-backend
Scenario: Search pipelines events returns "Bad Request" response
Given a valid "appKeyAuth" key in the system
And new "SearchCIAppPipelineEvents" request
And body with value {"filter": {"from": "now-15m", "query": "@ci.provider.name:github AND @ci.status:error", "to": "now"}, "options": {"timezone": "GMT"}, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}, "sort": "timestamp"}
When the request is sent
Then the response status is 400 Bad Request
@skip-java @skip-python @skip-typescript @team:DataDog/ci-app-backend
Scenario: Search pipelines events returns "OK" response
Given a valid "appKeyAuth" key in the system
And new "SearchCIAppPipelineEvents" request
And body with value {"filter": {"from": "now-15m", "query": "@ci.provider.name:github AND @ci.status:error", "to": "now"}, "options": {"timezone": "GMT"}, "page": {"limit": 5}, "sort": "timestamp"}
When the request is sent
Then the response status is 200 OK
@replay-only @skip-java @skip-python @skip-typescript @skip-validation @team:DataDog/ci-app-backend @with-pagination
Scenario: Search pipelines events returns "OK" response with pagination
Given a valid "appKeyAuth" key in the system
And new "SearchCIAppPipelineEvents" request
And body with value {"filter": {"from": "now-30s", "to": "now"}, "options": {"timezone": "GMT"}, "page": {"limit": 2}, "sort": "timestamp"}
When the request with pagination is sent
Then the response status is 200 OK
And the response has 2 items
@generated @skip @team:DataDog/ci-app-backend
Scenario: Send pipeline event returns "Bad Request" response
Given new "CreateCIAppPipelineEvent" request
And body with value {"data": {"attributes": {"resource": "Details TBD"}, "type": "cipipeline_resource_request"}}
When the request is sent
Then the response status is 400 Bad Request
@generated @skip @team:DataDog/ci-app-backend
Scenario: Send pipeline event returns "Payload Too Large" response
Given new "CreateCIAppPipelineEvent" request
And body with value {"data": {"attributes": {"resource": "Details TBD"}, "type": "cipipeline_resource_request"}}
When the request is sent
Then the response status is 413 Payload Too Large
@generated @skip @team:DataDog/ci-app-backend
Scenario: Send pipeline event returns "Request Timeout" response
Given new "CreateCIAppPipelineEvent" request
And body with value {"data": {"attributes": {"resource": "Details TBD"}, "type": "cipipeline_resource_request"}}
When the request is sent
Then the response status is 408 Request Timeout
@skip-java @skip-python @skip-typescript @team:DataDog/ci-app-backend
Scenario: Send pipeline event returns "Request accepted for processing" response
Given new "CreateCIAppPipelineEvent" request
And body with value {"data": {"attributes": {"resource": {"level": "pipeline","unique_id": "3eacb6f3-ff04-4e10-8a9c-46e6d054024a","name": "Deploy to AWS","url": "https://my-ci-provider.example/pipelines/my-pipeline/run/1","start": "{{ timeISO('now - 120s') }}","end": "{{ timeISO('now - 30s') }}","status": "success","partial_retry": false,"git": {"repository_url": "https://github.com/DataDog/datadog-agent","sha": "7f263865994b76066c4612fd1965215e7dcb4cd2","author_email": "john.doe@email.com"}}},"type": "cipipeline_resource_request"}}
When the request is sent
Then the response status is 202 Request accepted for processing
@skip-java @skip-python @skip-typescript @team:DataDog/ci-app-backend
Scenario: Send pipeline event with custom provider returns "Request accepted for processing" response
Given new "CreateCIAppPipelineEvent" request
And body with value {"data": {"attributes": {"provider_name": "example-provider", "resource": {"level": "pipeline","unique_id": "3eacb6f3-ff04-4e10-8a9c-46e6d054024a","name": "Deploy to AWS","url": "https://my-ci-provider.example/pipelines/my-pipeline/run/1","start": "{{ timeISO('now - 120s') }}","end": "{{ timeISO('now - 30s') }}","status": "success","partial_retry": false,"git": {"repository_url": "https://github.com/DataDog/datadog-agent","sha": "7f263865994b76066c4612fd1965215e7dcb4cd2","author_email": "john.doe@email.com"}}},"type": "cipipeline_resource_request"}}
When the request is sent
Then the response status is 202 Request accepted for processing
@skip @skip-java @skip-python @skip-typescript @team:DataDog/ci-app-backend
Scenario: Send pipeline job event returns "Request accepted for processing" response
Given new "CreateCIAppPipelineEvent" request
And body with value {"data": {"attributes": {"resource": {"level": "job", "id": "cf9456de-8b9e-4c27-aa79-27b1e78c1a33", "name": "Build image", "pipeline_unique_id": "3eacb6f3-ff04-4e10-8a9c-46e6d054024a", "pipeline_name": "Deploy to AWS", "start": "{{ timeISO('now - 120s') }}", "end": "{{ timeISO('now - 30s') }}", "status": "error", "url": "https://my-ci-provider.example/jobs/my-jobs/run/1"}}, "type": "cipipeline_resource_request"}}
When the request is sent
Then the response status is 202 Request accepted for processing
@skip-java @skip-python @skip-typescript @team:DataDog/ci-app-backend
Scenario: Send running pipeline event returns "Request accepted for processing" response
Given new "CreateCIAppPipelineEvent" request
And body with value {"data": {"attributes": {"resource": {"level": "pipeline","unique_id": "3eacb6f3-ff04-4e10-8a9c-46e6d054024a","name": "Deploy to AWS","url": "https://my-ci-provider.example/pipelines/my-pipeline/run/1","start": "{{ timeISO('now - 120s') }}","status": "running","partial_retry": false,"git": {"repository_url": "https://github.com/DataDog/datadog-agent","sha": "7f263865994b76066c4612fd1965215e7dcb4cd2","author_email": "john.doe@email.com"}}},"type": "cipipeline_resource_request"}}
When the request is sent
Then the response status is 202 Request accepted for processing
@skip-java @skip-python @skip-typescript @team:DataDog/ci-app-backend
Scenario: Send several pipeline events returns "Request accepted for processing" response
Given new "CreateCIAppPipelineEvent" request
And body with value {"data": [{"attributes": {"provider_name": "example-provider", "resource": {"level": "pipeline","unique_id": "3eacb6f3-ff04-4e10-8a9c-46e6d054024a","name": "Deploy to AWS","url": "https://my-ci-provider.example/pipelines/my-pipeline/run/1","start": "{{ timeISO('now - 120s') }}","end": "{{ timeISO('now - 30s') }}","status": "success","partial_retry": false,"git": {"repository_url": "https://github.com/DataDog/datadog-agent","sha": "7f263865994b76066c4612fd1965215e7dcb4cd2","author_email": "john.doe@email.com"}}},"type": "cipipeline_resource_request"},{"attributes": {"provider_name": "example-provider", "resource": {"level": "pipeline","unique_id": "7b2c8f9e-aa15-4d22-9c7d-83f4e065138b","name": "Deploy to Production","url": "https://my-ci-provider.example/pipelines/prod-pipeline/run/2","start": "{{ timeISO('now - 180s') }}","end": "{{ timeISO('now - 45s') }}","status": "success","partial_retry": false,"git": {"repository_url": "https://github.com/DataDog/datadog-agent","sha": "9a4f7c28b3e5d12f8e6c9b2a5d8f3e1c7b4a6d9e","author_email": "jane.smith@email.com"}}},"type": "cipipeline_resource_request"}]}
When the request is sent
Then the response status is 202 Request accepted for processing