Skip to content

Commit 75856d9

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
CI Visibility Pipelines test case and example update (#1254)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent b760ed2 commit 75856d9

8 files changed

+15
-38
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.4",
7-
"regenerated": "2022-11-22 13:48:52.624197",
8-
"spec_repo_commit": "dad9f2c8"
7+
"regenerated": "2022-11-28 14:42:36.521894",
8+
"spec_repo_commit": "4b671e2f"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.4",
12-
"regenerated": "2022-11-22 13:48:52.635220",
13-
"spec_repo_commit": "dad9f2c8"
12+
"regenerated": "2022-11-28 14:42:36.534057",
13+
"spec_repo_commit": "4b671e2f"
1414
}
1515
}
1616
}

examples/v2/ci-visibility-pipelines/AggregateCIAppPipelineEvents.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
],
2424
filter=CIAppPipelinesQueryFilter(
2525
_from="now-15m",
26-
query="@ci.provider.name:github AND @ci.provider.instance:github-actions",
26+
query="@ci.provider.name:(gitlab OR github)",
2727
to="now",
2828
),
2929
group_by=[

examples/v2/ci-visibility-pipelines/ListCIAppPipelineEvents.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
with ApiClient(configuration) as api_client:
1212
api_instance = CIVisibilityPipelinesApi(api_client)
1313
response = api_instance.list_ci_app_pipeline_events(
14-
filter_query="@ci.provider.instance:circleci",
14+
filter_query="@ci.provider.name:circleci",
1515
filter_from=(datetime.now() + relativedelta(minutes=-30)),
1616
filter_to=datetime.now(),
1717
page_limit=5,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2022-10-21T09:04:03.789Z
1+
2022-11-28T11:57:44.730Z

tests/v2/cassettes/test_scenarios/test_aggregate_pipelines_events_returns_ok_response.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
interactions:
22
- request:
3-
body: '{"compute":[{"aggregation":"pc90","metric":"@duration","type":"total"}],"filter":{"from":"now-15m","query":"@ci.provider.name:github
4-
AND @ci.provider.instance:github-actions","to":"now"},"group_by":[{"facet":"@ci.status","limit":10,"total":false}],"options":{"timezone":"GMT"},"page":{"limit":25}}'
3+
body: '{"compute":[{"aggregation":"pc90","metric":"@duration","type":"total"}],"filter":{"from":"now-15m","query":"@ci.provider.name:(gitlab
4+
OR github)","to":"now"},"group_by":[{"facet":"@ci.status","limit":10,"total":false}],"options":{"timezone":"GMT"},"page":{"limit":25}}'
55
headers:
66
accept:
77
- application/json
@@ -11,7 +11,7 @@ interactions:
1111
uri: https://api.datadoghq.com/api/v2/ci/pipelines/analytics/aggregate
1212
response:
1313
body:
14-
string: '{"meta":{"elapsed":113,"request_id":"pddv1ChYwUEN0YnZ5dFNrdVZEbHhuSTliVEpnIiwKHGMtY3c8ixDp3d4CWjg8UkGmZ1-bi7LFmSWOebUSDClmkByOFEin86vlJg","status":"done"},"data":{"buckets":[{"by":{"@ci.status":"canceled"},"computes":{"c0":149536704640.0603}},{"by":{"@ci.status":"error"},"computes":{"c0":423086456660.7128}},{"by":{"@ci.status":"skipped"},"computes":{"c0":0.0}},{"by":{"@ci.status":"success"},"computes":{"c0":190099929600.14703}}]}}
14+
string: '{"meta":{"elapsed":11,"request_id":"pddv1ChZqQzVJUE9vVlNBLVFpRk84Vko5MmFRIi0KHbc5utz89Y10MZzALoXnFE9Iv7tPhZgvKgIWyiodEgzXWdD8rQBC2y027fc","status":"done"},"data":{"buckets":[]}}
1515
1616
'
1717
headers:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2022-10-21T09:03:14.191Z
1+
2022-11-28T11:57:44.947Z

tests/v2/cassettes/test_scenarios/test_get_a_list_of_pipelines_events_returns_ok_response.yaml

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,10 @@ interactions:
55
accept:
66
- application/json
77
method: GET
8-
uri: https://api.datadoghq.com/api/v2/ci/pipelines/events?filter%5Bquery%5D=%40ci.provider.instance%3Acircleci&filter%5Bfrom%5D=2022-10-21T08%3A33%3A14.191Z&filter%5Bto%5D=2022-10-21T09%3A03%3A14.191Z&page%5Blimit%5D=5
8+
uri: https://api.datadoghq.com/api/v2/ci/pipelines/events?filter%5Bquery%5D=%40ci.provider.name%3Acircleci&filter%5Bfrom%5D=2022-11-28T11%3A27%3A44.947Z&filter%5Bto%5D=2022-11-28T11%3A57%3A44.947Z&page%5Blimit%5D=5
99
response:
1010
body:
11-
string: '{"data":[{"id":"AgAAAYP5xykf8-SC-QAAAAAAAAAYAAAAAEFZUDV4eWtmQUFCUks3bmxVT3JlZDMyLQAAACQAAAAAMDE4M2Y5YzctMzZiMC00MTA3LWFlNWUtMjY5YmIyNWNjMjU1","type":"cipipeline","attributes":{"attributes":{"duration":168245000000,"git":{"commit":{"committer":{"date":"2022-10-21T08:53:37Z","name":"GitHub","email":"[email protected]","date_timestamp":1666342417000},"author":{"date":"2022-10-21T08:53:37Z","name":"dependabot[bot]","email":"49699333+dependabot[bot]@users.noreply.github.com","date_timestamp":1666342417000},"message":"Bump
12-
sigs.k8s.io/custom-metrics-apiserver from 1.23.0 to 1.24.0\nBumps [sigs.k8s.io/custom-metrics-apiserver](https://github.com/kubernetes-sigs/custom-metrics-apiserver)
13-
from 1.23.0 to 1.24.0.\n- [Release notes](https://github.com/kubernetes-sigs/custom-metrics-apiserver/releases)\n-
14-
[Changelog](https://github.com/kubernetes-sigs/custom-metrics-apiserver/blob/master/RELEASE.md)\n-
15-
[Commits](https://github.com/kubernetes-sigs/custom-metrics-apiserver/compare/v1.23.0...v1.24.0)\n\n---\nupdated-dependencies:\n-
16-
dependency-name: sigs.k8s.io/custom-metrics-apiserver\n dependency-type:
17-
direct:production\n update-type: version-update:semver-minor\n...\n\nSigned-off-by:
18-
dependabot[bot] <[email protected]>","sha":"ae8f4633aeeffe565f65b51d835c1d16194bae84"},"repository_url":"https://github.com/DataDog/repo","repository":{"path":"/DataDog/repo","scheme":"https","name":"DataDog/repo","host":"github.com","id":"github.com/DataDog/repo"},"branch":"dependabot/go_modules/sigs.k8s.io/custom-metrics-apiserver-1.24.0"},"ci":{"pipeline":{"name":"test_and_build","id":"49e7fd76-3f02-4713-920a-9fe5815acb69","url":"https://app.circleci.com/pipelines/workflows/49e7fd76-3f02-4713-920a-9fe5815acb69"},"provider":{"instance":"circleci","name":"circleci"},"job":{"name":"integration_tests","id":"63fe0e47-c104-4084-a885-90a5efe48fc0","url":"https://app.circleci.com/jobs/gh/DataDog/repo/747606"},"status":"error"},"circleci":{"result":"failed"},"start":1666342754282000000},"ci_level":"job","tags":["source:apm","source:apm"]}},{"id":"AgAAAYP5xqkdMVh9SQAAAAAAAAAYAAAAAEFZUDV4cWtkQUFCTVgxb2RLVG05X1gyLQAAACQAAAAAMDE4M2Y5YzYtY2QzOC00YmU5LTllMjctYTZkYWY0ODU1NTM2","type":"cipipeline","attributes":{"attributes":{"duration":135912000000,"git":{"commit":{"committer":{"date":"2022-10-21T08:53:37Z","name":"GitHub","email":"[email protected]","date_timestamp":1666342417000},"author":{"date":"2022-10-21T08:53:37Z","name":"dependabot[bot]","email":"49699333+dependabot[bot]@users.noreply.github.com","date_timestamp":1666342417000},"message":"Bump
19-
sigs.k8s.io/custom-metrics-apiserver from 1.23.0 to 1.24.0\nBumps [sigs.k8s.io/custom-metrics-apiserver](https://github.com/kubernetes-sigs/custom-metrics-apiserver)
20-
from 1.23.0 to 1.24.0.\n- [Release notes](https://github.com/kubernetes-sigs/custom-metrics-apiserver/releases)\n-
21-
[Changelog](https://github.com/kubernetes-sigs/custom-metrics-apiserver/blob/master/RELEASE.md)\n-
22-
[Commits](https://github.com/kubernetes-sigs/custom-metrics-apiserver/compare/v1.23.0...v1.24.0)\n\n---\nupdated-dependencies:\n-
23-
dependency-name: sigs.k8s.io/custom-metrics-apiserver\n dependency-type:
24-
direct:production\n update-type: version-update:semver-minor\n...\n\nSigned-off-by:
25-
dependabot[bot] <[email protected]>","sha":"ae8f4633aeeffe565f65b51d835c1d16194bae84"},"repository_url":"https://github.com/DataDog/repo","repository":{"path":"/DataDog/repo","scheme":"https","name":"DataDog/repo","host":"github.com","id":"github.com/DataDog/repo"},"branch":"dependabot/go_modules/sigs.k8s.io/custom-metrics-apiserver-1.24.0"},"ci":{"pipeline":{"name":"test_and_build","id":"49e7fd76-3f02-4713-920a-9fe5815acb69","url":"https://app.circleci.com/pipelines/workflows/49e7fd76-3f02-4713-920a-9fe5815acb69"},"provider":{"instance":"circleci","name":"circleci"},"job":{"name":"docker_tests","id":"fe1c7d1e-fa06-4f78-a770-2124d9df6450","url":"https://app.circleci.com/jobs/gh/DataDog/repo/747605"},"status":"success"},"circleci":{"result":"success"},"start":1666342753845000000},"ci_level":"job","tags":["source:apm","source:apm"]}},{"id":"AgAAAYP5xpmz5QcY9gAAAAAAAAAYAAAAAEFZUDV4cG16QUFDUzJrMkpfUWdXS0l4SQAAACQAAAAAMDE4M2Y5YzYtOWE3MC00NjRkLTk0ZGEtMzJhMTU3NWM4N2Y1","type":"cipipeline","attributes":{"attributes":{"duration":127003000000,"git":{"commit":{"committer":{"date":"2022-10-21T08:29:12Z","name":"Joe","email":"[email protected]","date_timestamp":1666340952000},"author":{"date":"2022-10-21T08:29:12Z","name":"Joe","email":"[email protected]","date_timestamp":1666340952000},"message":"[CWS]
26-
pre-alloc in `bitmaskCombinations`","sha":"77413ba45e45cf69704bcb98cd90363453545c0b"},"repository_url":"https://github.com/DataDog/repo","repository":{"path":"/DataDog/repo","scheme":"https","name":"DataDog/repo","host":"github.com","id":"github.com/DataDog/repo"},"branch":"paulcacheux/pre-alloc-v2"},"ci":{"pipeline":{"name":"test_and_build","id":"6600c0f6-5457-4a1a-92a5-7930156ec18f","url":"https://app.circleci.com/pipelines/workflows/6600c0f6-5457-4a1a-92a5-7930156ec18f"},"provider":{"instance":"circleci","name":"circleci"},"job":{"name":"docker_tests","id":"cf9b9254-ece7-4e94-aefe-d6365cbc0c33","url":"https://app.circleci.com/jobs/gh/DataDog/repo/747597"},"status":"success"},"circleci":{"result":"success"},"start":1666342758808000000},"ci_level":"job","tags":["source:apm","source:apm"]}},{"id":"AgAAAYP5xfKQbBhYyAAAAAAAAAAYAAAAAEFZUDV4ZktRQUFDUklKUjJKZDlQdTMyLQAAACQAAAAAMDE4M2Y5YzYtMjE1OC00NTlkLThlNDMtNGE4ZjVmNGM2ZTM4","type":"cipipeline","attributes":{"attributes":{"duration":91076000000,"git":{"commit":{"committer":{"date":"2022-10-21T08:53:37Z","name":"GitHub","email":"[email protected]","date_timestamp":1666342417000},"author":{"date":"2022-10-21T08:53:37Z","name":"dependabot[bot]","email":"49699333+dependabot[bot]@users.noreply.github.com","date_timestamp":1666342417000},"message":"Bump
27-
sigs.k8s.io/custom-metrics-apiserver from 1.23.0 to 1.24.0\nBumps [sigs.k8s.io/custom-metrics-apiserver](https://github.com/kubernetes-sigs/custom-metrics-apiserver)
28-
from 1.23.0 to 1.24.0.\n- [Release notes](https://github.com/kubernetes-sigs/custom-metrics-apiserver/releases)\n-
29-
[Changelog](https://github.com/kubernetes-sigs/custom-metrics-apiserver/blob/master/RELEASE.md)\n-
30-
[Commits](https://github.com/kubernetes-sigs/custom-metrics-apiserver/compare/v1.23.0...v1.24.0)\n\n---\nupdated-dependencies:\n-
31-
dependency-name: sigs.k8s.io/custom-metrics-apiserver\n dependency-type:
32-
direct:production\n update-type: version-update:semver-minor\n...\n\nSigned-off-by:
33-
dependabot[bot] <[email protected]>","sha":"ae8f4633aeeffe565f65b51d835c1d16194bae84"},"repository_url":"https://github.com/DataDog/repo","repository":{"path":"/DataDog/repo","scheme":"https","name":"DataDog/repo","host":"github.com","id":"github.com/DataDog/repo"},"branch":"dependabot/go_modules/sigs.k8s.io/custom-metrics-apiserver-1.24.0"},"ci":{"pipeline":{"name":"test_and_build","id":"49e7fd76-3f02-4713-920a-9fe5815acb69","url":"https://app.circleci.com/pipelines/workflows/49e7fd76-3f02-4713-920a-9fe5815acb69"},"provider":{"instance":"circleci","name":"circleci"},"job":{"name":"licenses_linting","id":"f72c6c96-c726-4af6-bc76-6177b23465a4","url":"https://app.circleci.com/jobs/gh/DataDog/repo/747593"},"status":"error"},"circleci":{"result":"failed"},"start":1666342751948000000},"ci_level":"job","tags":["source:apm","source:apm"]}},{"id":"AgAAAYP5xcd7ZGdYyAAAAAAAAAAYAAAAAEFZUDV4Y2Q3QUFCSXFuNnhnMTZwMTR4SQAAACQAAAAAMDE4M2Y5YzUtZGIwOC00YTBhLWFmZWEtM2VjZDA3ZTU4N2My","type":"cipipeline","attributes":{"attributes":{"duration":78632000000,"git":{"commit":{"committer":{"date":"2022-10-21T08:29:12Z","name":"Joe","email":"[email protected]","date_timestamp":1666340952000},"author":{"date":"2022-10-21T08:29:12Z","name":"Joe","email":"[email protected]","date_timestamp":1666340952000},"message":"[CWS]
34-
pre-alloc in `bitmaskCombinations`","sha":"77413ba45e45cf69704bcb98cd90363453545c0b"},"repository_url":"https://github.com/DataDog/repo","repository":{"path":"/DataDog/repo","scheme":"https","name":"DataDog/repo","host":"github.com","id":"github.com/DataDog/repo"},"branch":"paulcacheux/pre-alloc-v2"},"ci":{"pipeline":{"name":"test_and_build","id":"6600c0f6-5457-4a1a-92a5-7930156ec18f","url":"https://app.circleci.com/pipelines/workflows/6600c0f6-5457-4a1a-92a5-7930156ec18f"},"provider":{"instance":"circleci","name":"circleci"},"job":{"name":"licenses_linting","id":"dd9dadb2-d371-41de-9ccb-5c3eda84d7b6","url":"https://app.circleci.com/jobs/gh/DataDog/repo/747601"},"status":"success"},"circleci":{"result":"success"},"start":1666342753363000000},"ci_level":"job","tags":["source:apm","source:apm"]}}],"meta":{"page":{"after":"eyJhZnRlciI6IkFnQUFBWVA1eGNkN1pHZFl5QUFBQUFBQUFBQVlBQUFBQUVGWlVEVjRZMlEzUVVGQ1NYRnVObmhuTVRad01UUjRTUUFBQUNRQUFBQUFNREU0TTJZNVl6VXRaR0l3T0MwMFlUQmhMV0ZtWldFdE0yVmpaREEzWlRVNE4yTXkifQ"}},"links":{"next":"https://api.datadoghq.com/api/v2/ci/pipelines/events?filter%5Bfrom%5D=2022-10-21T08%3A33%3A14.191Z&filter%5Bquery%5D=%40ci.provider.instance%3Acircleci&filter%5Bto%5D=2022-10-21T09%3A03%3A14.191Z&page%5Bcursor%5D=eyJhZnRlciI6IkFnQUFBWVA1eGNkN1pHZFl5QUFBQUFBQUFBQVlBQUFBQUVGWlVEVjRZMlEzUVVGQ1NYRnVObmhuTVRad01UUjRTUUFBQUNRQUFBQUFNREU0TTJZNVl6VXRaR0l3T0MwMFlUQmhMV0ZtWldFdE0yVmpaREEzWlRVNE4yTXkifQ&page%5Blimit%5D=5"}}
11+
string: '{"data":[]}
3512
3613
'
3714
headers:

tests/v2/features/ci_visibility_pipelines.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Feature: CI Visibility Pipelines
1717
@team:Datadog/ci-app-backend @team:Datadog/integrations-tools-and-libraries
1818
Scenario: Aggregate pipelines events returns "OK" response
1919
Given new "AggregateCIAppPipelineEvents" request
20-
And body with value {"compute": [{"aggregation": "pc90", "metric": "@duration", "type": "total"}], "filter": {"from": "now-15m", "query": "@ci.provider.name:github AND @ci.provider.instance:github-actions", "to": "now"}, "group_by": [{ "facet": "@ci.status", "limit": 10, "total": false}], "options": {"timezone": "GMT"}, "page": {"limit": 25}}
20+
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"}, "page": {"limit": 25}}
2121
When the request is sent
2222
Then the response status is 200 OK
2323

@@ -30,7 +30,7 @@ Feature: CI Visibility Pipelines
3030
@team:Datadog/ci-app-backend @team:Datadog/integrations-tools-and-libraries
3131
Scenario: Get a list of pipelines events returns "OK" response
3232
Given new "ListCIAppPipelineEvents" request
33-
And request contains "filter[query]" parameter with value "@ci.provider.instance:circleci"
33+
And request contains "filter[query]" parameter with value "@ci.provider.name:circleci"
3434
And request contains "filter[from]" parameter with value "{{ timeISO('now - 30m') }}"
3535
And request contains "filter[to]" parameter with value "{{ timeISO('now') }}"
3636
And request contains "page[limit]" parameter with value 5

0 commit comments

Comments
 (0)