Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix failing bdd tests. #507

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
@@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2025-02-04 14:10:06.221297",
"spec_repo_commit": "4fb9047a"
"regenerated": "2025-02-06 14:59:35.924732",
"spec_repo_commit": "35bc11b5"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-02-04 14:10:06.239068",
"spec_repo_commit": "4fb9047a"
"regenerated": "2025-02-06 14:59:35.940064",
"spec_repo_commit": "35bc11b5"
}
}
}
8 changes: 4 additions & 4 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
@@ -8695,7 +8695,7 @@ components:
description: Unix timestamp when the deployment finished. It must be in
nanoseconds, milliseconds, or seconds, and it should not be older than
1 hour.
example: 1693491984000000000
example: 1693491984000
format: int64
type: integer
git:
@@ -8710,7 +8710,7 @@ components:
started_at:
description: Unix timestamp when the deployment started. It must be in nanoseconds,
milliseconds, or seconds.
example: 1693491974000000000
example: 1693491974000
format: int64
type: integer
team:
@@ -8794,7 +8794,7 @@ components:
finished_at:
description: Unix timestamp when the incident finished. It must be in nanoseconds,
milliseconds, or seconds, and it should not be older than 1 hour.
example: 1693491984000000000
example: 1693491984000
format: int64
type: integer
git:
@@ -8822,7 +8822,7 @@ components:
started_at:
description: Unix timestamp when the incident started. It must be in nanoseconds,
milliseconds, or seconds.
example: 1693491974000000000
example: 1693491974000
format: int64
type: integer
team:
16 changes: 6 additions & 10 deletions examples/v2_dora-metrics_CreateDORADeployment.rs
Original file line number Diff line number Diff line change
@@ -9,16 +9,12 @@ use datadog_api_client::datadogV2::model::DORAGitInfo;
#[tokio::main]
async fn main() {
let body = DORADeploymentRequest::new(DORADeploymentRequestData::new(
DORADeploymentRequestAttributes::new(
1693491984000000000,
"shopist".to_string(),
1693491974000000000,
)
.git(DORAGitInfo::new(
"66adc9350f2cc9b250b69abddab733dd55e1a588".to_string(),
"https://github.com/organization/example-repository".to_string(),
))
.version("v1.12.07".to_string()),
DORADeploymentRequestAttributes::new(1693491984000, "shopist".to_string(), 1693491974000)
.git(DORAGitInfo::new(
"66adc9350f2cc9b250b69abddab733dd55e1a588".to_string(),
"https://github.com/organization/example-repository".to_string(),
))
.version("v1.12.07".to_string()),
));
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.CreateDORADeployment", true);
4 changes: 2 additions & 2 deletions examples/v2_dora-metrics_CreateDORAIncident.rs
Original file line number Diff line number Diff line change
@@ -9,8 +9,8 @@ use datadog_api_client::datadogV2::model::DORAIncidentRequestData;
#[tokio::main]
async fn main() {
let body = DORAIncidentRequest::new(DORAIncidentRequestData::new(
DORAIncidentRequestAttributes::new(1707842944500000000)
.finished_at(1707842944600000000)
DORAIncidentRequestAttributes::new(17078429445000)
.finished_at(17078429446000)
.git(DORAGitInfo::new(
"66adc9350f2cc9b250b69abddab733dd55e1a588".to_string(),
"https://github.com/organization/example-repository".to_string(),
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@
},
"response": {
"body": {
"string": "{\"status\":\"ok\",\"event\":{\"id\":6327818702635911000,\"id_str\":\"6327818702635911562\",\"title\":\"Test-Post_an_event_returns_OK_response-1641430251\",\"text\":\"A text message.\",\"date_happened\":1641430251,\"handle\":null,\"priority\":null,\"related_event_id\":null,\"tags\":[\"test:TestPostaneventreturnsOKresponse1641430251\"],\"url\":\"https://app.datadoghq.com/event/event?id=6327818702635911562\"}}",
"string": "{\"status\":\"ok\",\"event\":{\"id\":63278187026359,\"id_str\":\"6327818702635911562\",\"title\":\"Test-Post_an_event_returns_OK_response-1641430251\",\"text\":\"A text message.\",\"date_happened\":1641430251,\"handle\":null,\"priority\":null,\"related_event_id\":null,\"tags\":[\"test:TestPostaneventreturnsOKresponse1641430251\"],\"url\":\"https://app.datadoghq.com/event/event?id=6327818702635911562\"}}",
"encoding": null
},
"headers": {
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@
},
"response": {
"body": {
"string": "{\"status\":\"ok\",\"event\":{\"id\":6327818704671040000,\"id_str\":\"6327818704671039975\",\"title\":\"Test-Post_an_event_with_a_long_title_returns_OK_response-1641430251 very very very looooooooong looooooooooooong loooooooooooooooooooooong looooooooooooooooooooooooooong title with 100+ characters\",\"text\":\"A text message.\",\"date_happened\":1641430252,\"handle\":null,\"priority\":null,\"related_event_id\":null,\"tags\":[\"test:TestPostaneventwithalongtitlereturnsOKresponse1641430251\"],\"url\":\"https://app.datadoghq.com/event/event?id=6327818704671039975\"}}",
"string": "{\"status\":\"ok\",\"event\":{\"id\":63278187046710,\"id_str\":\"6327818704671039975\",\"title\":\"Test-Post_an_event_with_a_long_title_returns_OK_response-1641430251 very very very looooooooong looooooooooooong loooooooooooooooooooooong looooooooooooooooooooooooooong title with 100+ characters\",\"text\":\"A text message.\",\"date_happened\":1641430252,\"handle\":null,\"priority\":null,\"related_event_id\":null,\"tags\":[\"test:TestPostaneventwithalongtitlereturnsOKresponse1641430251\"],\"url\":\"https://app.datadoghq.com/event/event?id=6327818704671039975\"}}",
"encoding": null
},
"headers": {
Original file line number Diff line number Diff line change
@@ -47,7 +47,7 @@
},
"response": {
"body": {
"string": "{\"data\":{\"id\":\"25442f2c-fb75-4abe-b875-ed3497d2fc2c\",\"type\":\"appDefinitions\",\"attributes\":{\"components\":[{\"events\":[],\"name\":\"grid0\",\"properties\":{\"children\":[{\"events\":[],\"name\":\"gridCell0\",\"properties\":{\"children\":[{\"events\":[],\"name\":\"calloutValue0\",\"properties\":{\"isDisabled\":false,\"isLoading\":false,\"isVisible\":true,\"label\":\"CPU Usage\",\"size\":\"sm\",\"style\":\"vivid_yellow\",\"unit\":\"kB\",\"value\":\"42\"},\"type\":\"calloutValue\"}],\"isVisible\":\"true\",\"layout\":{\"default\":{\"height\":8,\"width\":2,\"x\":0,\"y\":0}}},\"type\":\"gridCell\"}]},\"type\":\"grid\"}],\"description\":\"This is a simple example app\",\"favorite\":false,\"name\":\"Example App\",\"queries\":[],\"rootInstanceName\":\"grid0\",\"selfService\":false,\"tags\":[]},\"meta\":{\"org_id\":1107852,\"user_id\":15479137,\"user_uuid\":\"b3f98453-b289-11ef-a4e9-d6d283f92d91\",\"user_name\":\"[email protected]\",\"version\":1,\"updated_since_deployment\":false,\"created_at\":\"2025-01-30T22:30:43.296595Z\",\"updated_at\":\"2025-01-30T22:30:43.296595Z\",\"deleted_at\":\"0001-01-01T00:00:00Z\"}}}",
"string": "{\"data\":{\"id\":\"25442f2c-fb75-4abe-b875-ed3497d2fc2c\",\"type\":\"appDefinitions\",\"attributes\":{\"components\":[{\"events\":[],\"name\":\"grid0\",\"properties\":{\"children\":[{\"events\":[],\"name\":\"gridCell0\",\"properties\":{\"children\":[{\"events\":[],\"name\":\"calloutValue0\",\"properties\":{\"isDisabled\":false,\"isLoading\":false,\"isVisible\":true,\"label\":\"CPU Usage\",\"size\":\"sm\",\"style\":\"vivid_yellow\",\"unit\":\"kB\",\"value\":\"42\"},\"type\":\"calloutValue\"}],\"isVisible\":\"true\",\"layout\":{\"default\":{\"height\":8,\"width\":2,\"x\":0,\"y\":0}}},\"type\":\"gridCell\"}]},\"type\":\"grid\"}],\"description\":\"This is a simple example app\",\"favorite\":false,\"name\":\"Example App\",\"queries\":[],\"rootInstanceName\":\"grid0\",\"tags\":[]}}}",
"encoding": null
},
"headers": {
Original file line number Diff line number Diff line change
@@ -53,7 +53,7 @@
},
"response": {
"body": {
"string": "{\"data\":{\"id\":\"892d9225-fd31-4237-b218-e964ac33fc71\",\"type\":\"appDefinitions\",\"attributes\":{\"components\":[{\"events\":[],\"name\":\"grid0\",\"properties\":{\"children\":[{\"events\":[],\"name\":\"gridCell0\",\"properties\":{\"children\":[{\"events\":[],\"name\":\"calloutValue0\",\"properties\":{\"isDisabled\":false,\"isLoading\":false,\"isVisible\":true,\"label\":\"CPU Usage\",\"size\":\"sm\",\"style\":\"vivid_yellow\",\"unit\":\"kB\",\"value\":\"42\"},\"type\":\"calloutValue\"}],\"isVisible\":\"true\",\"layout\":{\"default\":{\"height\":8,\"width\":2,\"x\":0,\"y\":0}}},\"type\":\"gridCell\"}]},\"type\":\"grid\"}],\"description\":\"This is a simple example app\",\"favorite\":false,\"name\":\"Updated Name\",\"queries\":[],\"rootInstanceName\":\"grid0\",\"selfService\":false,\"tags\":[]},\"meta\":{\"org_id\":1107852,\"user_id\":15479137,\"user_uuid\":\"b3f98453-b289-11ef-a4e9-d6d283f92d91\",\"user_name\":\"[email protected]\",\"version\":2,\"updated_since_deployment\":false,\"created_at\":\"2025-01-30T22:30:45.584607Z\",\"updated_at\":\"2025-01-30T22:30:45.785438Z\",\"deleted_at\":\"0001-01-01T00:00:00Z\"}}}",
"string": "{\"data\":{\"id\":\"892d9225-fd31-4237-b218-e964ac33fc71\",\"type\":\"appDefinitions\",\"attributes\":{\"components\":[{\"events\":[],\"name\":\"grid0\",\"properties\":{\"children\":[{\"events\":[],\"name\":\"gridCell0\",\"properties\":{\"children\":[{\"events\":[],\"name\":\"calloutValue0\",\"properties\":{\"isDisabled\":false,\"isLoading\":false,\"isVisible\":true,\"label\":\"CPU Usage\",\"size\":\"sm\",\"style\":\"vivid_yellow\",\"unit\":\"kB\",\"value\":\"42\"},\"type\":\"calloutValue\"}],\"isVisible\":\"true\",\"layout\":{\"default\":{\"height\":8,\"width\":2,\"x\":0,\"y\":0}}},\"type\":\"gridCell\"}]},\"type\":\"grid\"}],\"description\":\"This is a simple example app\",\"favorite\":false,\"name\":\"Updated Name\",\"queries\":[],\"rootInstanceName\":\"grid0\",\"tags\":[]}}}",
"encoding": null
},
"headers": {
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
{
"request": {
"body": {
"string": "{\"data\":{\"attributes\":{\"finished_at\":1693491984000000000,\"git\":{\"commit_sha\":\"66adc9350f2cc9b250b69abddab733dd55e1a588\",\"repository_url\":\"https://github.com/organization/example-repository\"},\"service\":\"shopist\",\"started_at\":1693491974000000000,\"version\":\"v1.12.07\"}}}",
"string": "{\"data\":{\"attributes\":{\"finished_at\":1693491984000,\"git\":{\"commit_sha\":\"66adc9350f2cc9b250b69abddab733dd55e1a588\",\"repository_url\":\"https://github.com/organization/example-repository\"},\"service\":\"shopist\",\"started_at\":16934919740000,\"version\":\"v1.12.07\"}}}",
"encoding": null
},
"headers": {
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
{
"request": {
"body": {
"string": "{\"data\":{\"attributes\":{\"finished_at\":1707842944600000000,\"git\":{\"commit_sha\":\"66adc9350f2cc9b250b69abddab733dd55e1a588\",\"repository_url\":\"https://github.com/organization/example-repository\"},\"name\":\"Webserver is down failing all requests\",\"services\":[\"shopist\"],\"severity\":\"High\",\"started_at\":1707842944500000000,\"team\":\"backend\",\"version\":\"v1.12.07\"}}}",
"string": "{\"data\":{\"attributes\":{\"finished_at\":17078429446000,\"git\":{\"commit_sha\":\"66adc9350f2cc9b250b69abddab733dd55e1a588\",\"repository_url\":\"https://github.com/organization/example-repository\"},\"name\":\"Webserver is down failing all requests\",\"services\":[\"shopist\"],\"severity\":\"High\",\"started_at\":17078429445000,\"team\":\"backend\",\"version\":\"v1.12.07\"}}}",
"encoding": null
},
"headers": {
8 changes: 4 additions & 4 deletions tests/scenarios/features/v2/dora_metrics.feature
Original file line number Diff line number Diff line change
@@ -20,15 +20,15 @@ Feature: DORA Metrics
Scenario: Send a deployment event for DORA Metrics returns "OK - but delayed due to incident" response
Given operation "CreateDORADeployment" enabled
And new "CreateDORADeployment" request
And body with value {"data": {"attributes": {"finished_at": 1693491984000000000, "git": {"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_url": "https://github.com/organization/example-repository"}, "service": "shopist", "started_at": 1693491974000000000, "version": "v1.12.07"}}}
And body with value {"data": {"attributes": {"finished_at": 1693491984000, "git": {"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_url": "https://github.com/organization/example-repository"}, "service": "shopist", "started_at": 1693491974000, "version": "v1.12.07"}}}
When the request is sent
Then the response status is 202 OK - but delayed due to incident

@replay-only @team:Datadog/ci-app-backend
Scenario: Send a deployment event for DORA Metrics returns "OK" response
Given operation "CreateDORADeployment" enabled
And new "CreateDORADeployment" request
And body with value {"data": {"attributes": {"finished_at": 1693491984000000000, "git": {"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_url": "https://github.com/organization/example-repository"}, "service": "shopist", "started_at": 1693491974000000000, "version": "v1.12.07"}}}
And body with value {"data": {"attributes": {"finished_at": 1693491984000, "git": {"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_url": "https://github.com/organization/example-repository"}, "service": "shopist", "started_at": 1693491974000, "version": "v1.12.07"}}}
When the request is sent
Then the response status is 200 OK

@@ -44,14 +44,14 @@ Feature: DORA Metrics
Scenario: Send an incident event for DORA Metrics returns "OK - but delayed due to incident" response
Given operation "CreateDORAIncident" enabled
And new "CreateDORAIncident" request
And body with value {"data": {"attributes": {"env": "staging", "finished_at": 1693491984000000000, "git": {"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_url": "https://github.com/organization/example-repository"}, "name": "Webserver is down failing all requests.", "services": ["shopist"], "severity": "High", "started_at": 1693491974000000000, "team": "backend", "version": "v1.12.07"}}}
And body with value {"data": {"attributes": {"env": "staging", "finished_at": 1693491984000, "git": {"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_url": "https://github.com/organization/example-repository"}, "name": "Webserver is down failing all requests.", "services": ["shopist"], "severity": "High", "started_at": 1693491974000, "team": "backend", "version": "v1.12.07"}}}
When the request is sent
Then the response status is 202 OK - but delayed due to incident

@replay-only @team:Datadog/ci-app-backend
Scenario: Send an incident event for DORA Metrics returns "OK" response
Given operation "CreateDORAIncident" enabled
And new "CreateDORAIncident" request
And body with value {"data": {"attributes": {"finished_at": 1707842944600000000, "git": {"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_url": "https://github.com/organization/example-repository"}, "name": "Webserver is down failing all requests", "services": ["shopist"], "severity": "High", "started_at": 1707842944500000000, "team": "backend", "version": "v1.12.07"}}}
And body with value {"data": {"attributes": {"finished_at": 17078429446000, "git": {"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_url": "https://github.com/organization/example-repository"}, "name": "Webserver is down failing all requests", "services": ["shopist"], "severity": "High", "started_at": 17078429445000, "team": "backend", "version": "v1.12.07"}}}
When the request is sent
Then the response status is 200 OK