From 58fe1e14b3574e61adba566288839c708503aa40 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 12 Sep 2025 14:33:06 +0000 Subject: [PATCH] Regenerate client from commit 25e6f51 of spec repo --- config/_default/menus/api.en.yaml | 17 + .../en/api/latest/test-optimization/_index.md | 3 + content/en/api/v2/test-optimization/_index.md | 4 + .../en/api/v2/test-optimization/examples.json | 97 ++ .../request.SearchFlakyTests_2665223746.json | 14 + .../request.SearchFlakyTests_3039631009.json | 15 + .../request.SearchFlakyTests_3833010053.json | 14 + data/api/v2/CodeExamples.json | 17 + data/api/v2/full_spec.yaml | 383 +++++ data/api/v2/full_spec_deref.json | 1469 ++++++++++++++++- data/api/v2/translate_actions.json | 6 + data/api/v2/translate_tags.json | 4 + static/resources/json/full_spec_v2.json | 1469 ++++++++++++++++- 13 files changed, 3460 insertions(+), 52 deletions(-) create mode 100644 content/en/api/latest/test-optimization/_index.md create mode 100644 content/en/api/v2/test-optimization/_index.md create mode 100644 content/en/api/v2/test-optimization/examples.json create mode 100644 content/en/api/v2/test-optimization/request.SearchFlakyTests_2665223746.json create mode 100644 content/en/api/v2/test-optimization/request.SearchFlakyTests_3039631009.json create mode 100644 content/en/api/v2/test-optimization/request.SearchFlakyTests_3833010053.json diff --git a/config/_default/menus/api.en.yaml b/config/_default/menus/api.en.yaml index 3e5889a49bcd0..104b14961b6e7 100644 --- a/config/_default/menus/api.en.yaml +++ b/config/_default/menus/api.en.yaml @@ -10188,6 +10188,23 @@ menu: - ListTeams unstable: [] order: 1 + - name: Test Optimization + url: /api/latest/test-optimization/ + identifier: test-optimization + generated: true + - name: Search flaky tests + url: '#search-flaky-tests' + identifier: test-optimization-search-flaky-tests + parent: test-optimization + generated: true + params: + versions: + - v2 + operationids: + - SearchFlakyTests + unstable: + - v2 + order: 1 - name: Workflow Automation url: /api/latest/workflow-automation/ identifier: workflow-automation diff --git a/content/en/api/latest/test-optimization/_index.md b/content/en/api/latest/test-optimization/_index.md new file mode 100644 index 0000000000000..2bf0e8f80a18e --- /dev/null +++ b/content/en/api/latest/test-optimization/_index.md @@ -0,0 +1,3 @@ +--- +title: Test Optimization +--- diff --git a/content/en/api/v2/test-optimization/_index.md b/content/en/api/v2/test-optimization/_index.md new file mode 100644 index 0000000000000..c052229317fed --- /dev/null +++ b/content/en/api/v2/test-optimization/_index.md @@ -0,0 +1,4 @@ +--- +title: Test Optimization +headless: true +--- diff --git a/content/en/api/v2/test-optimization/examples.json b/content/en/api/v2/test-optimization/examples.json new file mode 100644 index 0000000000000..b95f0a2a05e05 --- /dev/null +++ b/content/en/api/v2/test-optimization/examples.json @@ -0,0 +1,97 @@ +{ + "SearchFlakyTests": { + "responses": { + "200": { + "json": { + "data": [ + { + "attributes": { + "attempt_to_fix_id": "string", + "codeowners": [], + "envs": [], + "first_flaked_branch": "string", + "first_flaked_sha": "string", + "first_flaked_ts": "integer", + "flaky_category": "string", + "flaky_state": "string", + "last_flaked_branch": "string", + "last_flaked_sha": "string", + "last_flaked_ts": "integer", + "module": "string", + "name": "string", + "pipeline_stats": { + "failed_pipelines": "integer", + "total_lost_time_ms": "integer" + }, + "services": [], + "suite": "string", + "test_run_metadata": { + "duration_ms": "integer", + "error_message": "string", + "error_stack": "string", + "source_end": "integer", + "source_file": "string", + "source_start": "integer" + }, + "test_stats": { + "failure_rate_pct": "number" + } + }, + "id": "string", + "type": "string" + } + ], + "meta": { + "pagination": { + "next_page": "string" + } + } + }, + "html": "
\n
\n
\n
\n

data

\n
\n

[object]

\n

Array of flaky tests matching the request.

\n
\n
\n
\n
\n
\n

attributes

\n
\n

object

\n

Attributes of a flaky test.

\n
\n
\n
\n
\n
\n

attempt_to_fix_id

\n
\n

string

\n

Unique identifier for the attempt to fix this flaky test. Use this ID in the Git commit message in order to trigger the attempt to fix workflow.

\n

When the workflow is triggered the test is automatically retried by the tracer a certain number of configurable times. When all retries pass, the test is automatically marked as fixed in Flaky Test Management.\nTest runs are tagged with @test.test_management.attempt_to_fix_passed and @test.test_management.is_attempt_to_fix when the attempt to fix workflow is triggered.

\n
\n \n
\n
\n
\n
\n
\n

codeowners

\n
\n

[string]

\n

The name of the test's code owners as inferred from the repository configuration.

\n
\n \n
\n
\n
\n
\n
\n

envs

\n
\n

[string]

\n

List of environments where this test has been flaky.

\n
\n \n
\n
\n
\n
\n
\n

first_flaked_branch

\n
\n

string

\n

The branch name where the test exhibited flakiness for the first time.

\n
\n \n
\n
\n
\n
\n
\n

first_flaked_sha

\n
\n

string

\n

The commit SHA where the test exhibited flakiness for the first time.

\n
\n \n
\n
\n
\n
\n
\n

first_flaked_ts

\n
\n

int64

\n

Unix timestamp when the test exhibited flakiness for the first time.

\n
\n \n
\n
\n
\n
\n
\n

flaky_category

\n
\n

string

\n

The category of a flaky test.

\n
\n \n
\n
\n
\n
\n
\n

flaky_state

\n
\n

enum

\n

The current state of the flaky test. \nAllowed enum values: active,fixed,quarantined,disabled

\n
\n \n
\n
\n
\n
\n
\n

last_flaked_branch

\n
\n

string

\n

The branch name where the test exhibited flakiness for the last time.

\n
\n \n
\n
\n
\n
\n
\n

last_flaked_sha

\n
\n

string

\n

The commit SHA where the test exhibited flakiness for the last time.

\n
\n \n
\n
\n
\n
\n
\n

last_flaked_ts

\n
\n

int64

\n

Unix timestamp when the test exhibited flakiness for the last time.

\n
\n \n
\n
\n
\n
\n
\n

module

\n
\n

string

\n

The name of the test module. The definition of module changes slightly per language:

\n
    \n
  • In .NET, a test module groups every test that is run under the same unit test project.
  • \n
  • In Swift, a test module groups every test that is run for a given bundle.
  • \n
  • In JavaScript, the test modules map one-to-one to test sessions.
  • \n
  • In Java, a test module groups every test that is run by the same Maven Surefire/Failsafe or Gradle Test task execution.
  • \n
  • In Python, a test module groups every test that is run under the same .py file as part of a test suite, which is typically managed by a framework like unittest or pytest.
  • \n
  • In Ruby, a test module groups every test that is run within the same test file, which is typically managed by a framework like RSpec or Minitest.
  • \n
\n
\n \n
\n
\n
\n
\n
\n

name

\n
\n

string

\n

The test name. A concise name for a test case. Defined in the test itself.

\n
\n \n
\n
\n
\n
\n
\n

pipeline_stats

\n
\n

object

\n

CI pipeline related statistics for the flaky test. This information is only available if test runs are associated with CI pipeline events from CI Visibility.

\n
\n
\n
\n
\n
\n

failed_pipelines

\n
\n

int64

\n

The number of pipelines that failed due to this test for the past 7 days. This is computed as the sum of failed CI pipeline events associated with test runs where the flaky test failed.

\n
\n \n
\n
\n
\n
\n
\n

total_lost_time_ms

\n
\n

int64

\n

The total time lost by CI pipelines due to this flaky test in milliseconds This is computed as the sum of the duration of failed CI pipeline events associated with test runs where the flaky test failed.

\n
\n \n
\n
\n
\n
\n
\n
\n
\n

services

\n
\n

[string]

\n

List of test services names where this test has been flaky.

\n

A test service is a group of tests associated with a project or repository. It contains all the individual tests for your code, optionally organized into test suites, which are like folders for your tests.

\n
\n \n
\n
\n
\n
\n
\n

suite

\n
\n

string

\n

The name of the test suite. A group of tests exercising the same unit of code depending on your language and testing framework.

\n
\n \n
\n
\n
\n
\n
\n

test_run_metadata

\n
\n

object

\n

Metadata about the latest failed test run of the flaky test

\n
\n
\n
\n
\n
\n

duration_ms

\n
\n

int64

\n

The duration of the test run in milliseconds.

\n
\n \n
\n
\n
\n
\n
\n

error_message

\n
\n

string

\n

The error message from the test failure.

\n
\n \n
\n
\n
\n
\n
\n

error_stack

\n
\n

string

\n

The stack trace from the test failure.

\n
\n \n
\n
\n
\n
\n
\n

source_end

\n
\n

int64

\n

The line number where the test ends in the source file.

\n
\n \n
\n
\n
\n
\n
\n

source_file

\n
\n

string

\n

The source file where the test is defined.

\n
\n \n
\n
\n
\n
\n
\n

source_start

\n
\n

int64

\n

The line number where the test starts in the source file.

\n
\n \n
\n
\n
\n
\n
\n
\n
\n

test_stats

\n
\n

object

\n

Test statistics for the flaky test.

\n
\n
\n
\n
\n
\n

failure_rate_pct

\n
\n

double

\n

The failure rate percentage of the test for the past 7 days. This is the number of failed test runs divided by the total number of test runs (excluding skipped test runs).

\n
\n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n

id

\n
\n

string

\n

Test's ID. This ID is the hash of the test's Fully Qualified Name and Git repository ID. On Test Runs UI it is the same as the test_fingerprint_fqn tag.

\n
\n \n
\n
\n
\n
\n
\n

type

\n
\n

enum

\n

The type of the flaky test from Flaky Test Management. \nAllowed enum values: flaky_test

\n
\n \n
\n
\n
\n
\n
\n
\n
\n

meta

\n
\n

object

\n

Metadata for the flaky tests search response.

\n
\n
\n
\n
\n
\n

pagination

\n
\n

object

\n

Pagination metadata for flaky tests.

\n
\n
\n
\n
\n
\n

next_page

\n
\n

string

\n

Cursor for the next page of results.

\n
\n \n
\n
\n
\n
\n
\n
" + }, + "400": { + "json": { + "errors": [ + "Bad Request" + ] + }, + "html": "
\n
\n
\n
\n

errors [required]

\n
\n

[string]

\n

A list of errors.

\n
\n \n
\n
" + }, + "403": { + "json": { + "errors": [ + "Bad Request" + ] + }, + "html": "
\n
\n
\n
\n

errors [required]

\n
\n

[string]

\n

A list of errors.

\n
\n \n
\n
" + }, + "429": { + "json": { + "errors": [ + "Bad Request" + ] + }, + "html": "
\n
\n
\n
\n

errors [required]

\n
\n

[string]

\n

A list of errors.

\n
\n \n
\n
" + } + }, + "request": { + "json_curl": {}, + "json": { + "data": { + "attributes": { + "filter": { + "query": "string" + }, + "page": { + "cursor": "string", + "limit": "integer" + }, + "sort": "string" + }, + "type": "string" + } + }, + "html": "
\n
\n
\n
\n

data

\n
\n

object

\n

The JSON:API data for flaky tests search request.

\n
\n
\n
\n
\n
\n

attributes

\n
\n

object

\n

Attributes for the flaky tests search request.

\n
\n
\n
\n
\n
\n

filter

\n
\n

object

\n

Search filter settings.

\n
\n
\n
\n
\n
\n

query

\n
\n

string

\n

Search query following log syntax used to filter flaky tests, same as on Flaky Tests Management UI. The supported search keys are:

\n
    \n
  • flaky_test_state
  • \n
  • flaky_test_category
  • \n
  • @test.name
  • \n
  • @test.suite
  • \n
  • @test.module
  • \n
  • @test.service
  • \n
  • @git.repository.id_v2
  • \n
  • @git.branch
  • \n
  • @test.codeowners
  • \n
  • env
  • \n

default: *

\n
\n \n
\n
\n
\n
\n
\n
\n
\n

page

\n
\n

object

\n

Pagination attributes for listing flaky tests.

\n
\n
\n
\n
\n
\n

cursor

\n
\n

string

\n

List following results with a cursor provided in the previous request.

\n
\n \n
\n
\n
\n
\n
\n

limit

\n
\n

int64

\n

Maximum number of flaky tests in the response.

default: 10

\n
\n \n
\n
\n
\n
\n
\n
\n
\n

sort

\n
\n

enum

\n

Parameter for sorting flaky test results. The default sort is by ascending Fully Qualified Name (FQN). The FQN is the concatenation of the test module, suite, and name. \nAllowed enum values: fqn,-fqn,first_flaked,-first_flaked,last_flaked,-last_flaked,failure_rate,-failure_rate,pipelines_failed,-pipelines_failed,pipelines_duration_lost,-pipelines_duration_lost

\n
\n \n
\n
\n
\n
\n
\n
\n
\n

type

\n
\n

enum

\n

The definition of FlakyTestsSearchRequestDataType object. \nAllowed enum values: search_flaky_tests_request

\n
\n \n
\n
\n
\n
" + } + } +} \ No newline at end of file diff --git a/content/en/api/v2/test-optimization/request.SearchFlakyTests_2665223746.json b/content/en/api/v2/test-optimization/request.SearchFlakyTests_2665223746.json new file mode 100644 index 0000000000000..99d4a4f3ee664 --- /dev/null +++ b/content/en/api/v2/test-optimization/request.SearchFlakyTests_2665223746.json @@ -0,0 +1,14 @@ +{ + "data": { + "attributes": { + "filter": { + "query": "flaky_test_state:active @git.repository.id_v2:\"github.com/datadog/shopist\"" + }, + "page": { + "limit": 2 + }, + "sort": "-last_flaked" + }, + "type": "search_flaky_tests_request" + } +} \ No newline at end of file diff --git a/content/en/api/v2/test-optimization/request.SearchFlakyTests_3039631009.json b/content/en/api/v2/test-optimization/request.SearchFlakyTests_3039631009.json new file mode 100644 index 0000000000000..9a38a9ab56981 --- /dev/null +++ b/content/en/api/v2/test-optimization/request.SearchFlakyTests_3039631009.json @@ -0,0 +1,15 @@ +{ + "data": { + "attributes": { + "filter": { + "query": "*" + }, + "page": { + "cursor": "Q29udGludW91cyBUZXN0aW5nLltETyBOT1QgREVMRVRFXVtPTi1ERU1BTkQgRlVOQ1RJT05BTElUSUVTXVtPVkVSUklERV0gRXh0cmFWYXJpYWJsZXM=", + "limit": 2 + }, + "sort": "fqn" + }, + "type": "search_flaky_tests_request" + } +} \ No newline at end of file diff --git a/content/en/api/v2/test-optimization/request.SearchFlakyTests_3833010053.json b/content/en/api/v2/test-optimization/request.SearchFlakyTests_3833010053.json new file mode 100644 index 0000000000000..8098f39e2b61c --- /dev/null +++ b/content/en/api/v2/test-optimization/request.SearchFlakyTests_3833010053.json @@ -0,0 +1,14 @@ +{ + "data": { + "attributes": { + "filter": { + "query": "*" + }, + "page": { + "limit": 2 + }, + "sort": "fqn" + }, + "type": "search_flaky_tests_request" + } +} \ No newline at end of file diff --git a/data/api/v2/CodeExamples.json b/data/api/v2/CodeExamples.json index 7bb42c20d8996..63403421f6148 100644 --- a/data/api/v2/CodeExamples.json +++ b/data/api/v2/CodeExamples.json @@ -1708,6 +1708,23 @@ "description": "Update permission setting for team returns \"OK\" response" } ], + "SearchFlakyTests": [ + { + "group": "test_optimization", + "suffix": "_3833010053", + "description": "Search flaky tests returns \"OK\" response with cursor pagination" + }, + { + "group": "test_optimization", + "suffix": "_2665223746", + "description": "Search flaky tests returns \"OK\" response with filtered query" + }, + { + "group": "test_optimization", + "suffix": "_3039631009", + "description": "Search flaky tests returns \"OK\" response with specific cursor" + } + ], "CreateUser": [ { "group": "users", diff --git a/data/api/v2/full_spec.yaml b/data/api/v2/full_spec.yaml index f72fd6889931a..32058036c155d 100644 --- a/data/api/v2/full_spec.yaml +++ b/data/api/v2/full_spec.yaml @@ -17790,6 +17790,342 @@ components: - ATTACK_PATH - IDENTITY_RISK - API_SECURITY + FlakyTest: + description: A flaky test object. + properties: + attributes: + $ref: '#/components/schemas/FlakyTestAttributes' + id: + description: Test's ID. This ID is the hash of the test's Fully Qualified + Name and Git repository ID. On Test Runs UI it is the same as the `test_fingerprint_fqn` + tag. + type: string + type: + $ref: '#/components/schemas/FlakyTestType' + type: object + FlakyTestAttributes: + description: Attributes of a flaky test. + properties: + attempt_to_fix_id: + description: 'Unique identifier for the attempt to fix this flaky test. + Use this ID in the Git commit message in order to trigger the attempt + to fix workflow. + + + When the workflow is triggered the test is automatically retried by the + tracer a certain number of configurable times. When all retries pass, + the test is automatically marked as fixed in Flaky Test Management. + + Test runs are tagged with `@test.test_management.attempt_to_fix_passed` + and `@test.test_management.is_attempt_to_fix` when the attempt to fix + workflow is triggered.' + type: string + codeowners: + description: The name of the test's code owners as inferred from the repository + configuration. + items: + type: string + type: array + envs: + description: List of environments where this test has been flaky. + items: + type: string + type: array + first_flaked_branch: + description: The branch name where the test exhibited flakiness for the + first time. + type: string + first_flaked_sha: + description: The commit SHA where the test exhibited flakiness for the first + time. + type: string + first_flaked_ts: + description: Unix timestamp when the test exhibited flakiness for the first + time. + format: int64 + type: integer + flaky_category: + description: The category of a flaky test. + nullable: true + type: string + flaky_state: + $ref: '#/components/schemas/FlakyTestAttributesFlakyState' + last_flaked_branch: + description: The branch name where the test exhibited flakiness for the + last time. + type: string + last_flaked_sha: + description: The commit SHA where the test exhibited flakiness for the last + time. + type: string + last_flaked_ts: + description: Unix timestamp when the test exhibited flakiness for the last + time. + format: int64 + type: integer + module: + description: 'The name of the test module. The definition of module changes + slightly per language: + + - In .NET, a test module groups every test that is run under the same + unit test project. + + - In Swift, a test module groups every test that is run for a given bundle. + + - In JavaScript, the test modules map one-to-one to test sessions. + + - In Java, a test module groups every test that is run by the same Maven + Surefire/Failsafe or Gradle Test task execution. + + - In Python, a test module groups every test that is run under the same + `.py` file as part of a test suite, which is typically managed by a framework + like `unittest` or `pytest`. + + - In Ruby, a test module groups every test that is run within the same + test file, which is typically managed by a framework like `RSpec` or `Minitest`.' + nullable: true + type: string + name: + description: The test name. A concise name for a test case. Defined in the + test itself. + type: string + pipeline_stats: + $ref: '#/components/schemas/FlakyTestPipelineStats' + nullable: true + services: + description: 'List of test services names where this test has been flaky. + + + A test service is a group of tests associated with a project or repository. + It contains all the individual tests for your code, optionally organized + into test suites, which are like folders for your tests.' + items: + type: string + type: array + suite: + description: The name of the test suite. A group of tests exercising the + same unit of code depending on your language and testing framework. + type: string + test_run_metadata: + $ref: '#/components/schemas/FlakyTestRunMetadata' + test_stats: + $ref: '#/components/schemas/FlakyTestStats' + type: object + FlakyTestAttributesFlakyState: + description: The current state of the flaky test. + enum: + - active + - fixed + - quarantined + - disabled + type: string + x-enum-varnames: + - ACTIVE + - FIXED + - QUARANTINED + - DISABLED + FlakyTestPipelineStats: + description: CI pipeline related statistics for the flaky test. This information + is only available if test runs are associated with CI pipeline events from + CI Visibility. + properties: + failed_pipelines: + description: The number of pipelines that failed due to this test for the + past 7 days. This is computed as the sum of failed CI pipeline events + associated with test runs where the flaky test failed. + format: int64 + nullable: true + type: integer + total_lost_time_ms: + description: The total time lost by CI pipelines due to this flaky test + in milliseconds This is computed as the sum of the duration of failed + CI pipeline events associated with test runs where the flaky test failed. + format: int64 + nullable: true + type: integer + type: object + FlakyTestRunMetadata: + description: Metadata about the latest failed test run of the flaky test + properties: + duration_ms: + description: The duration of the test run in milliseconds. + format: int64 + nullable: true + type: integer + error_message: + description: The error message from the test failure. + nullable: true + type: string + error_stack: + description: The stack trace from the test failure. + nullable: true + type: string + source_end: + description: The line number where the test ends in the source file. + format: int64 + nullable: true + type: integer + source_file: + description: The source file where the test is defined. + nullable: true + type: string + source_start: + description: The line number where the test starts in the source file. + format: int64 + nullable: true + type: integer + type: object + FlakyTestStats: + description: Test statistics for the flaky test. + properties: + failure_rate_pct: + description: The failure rate percentage of the test for the past 7 days. + This is the number of failed test runs divided by the total number of + test runs (excluding skipped test runs). + format: double + nullable: true + type: number + type: object + FlakyTestType: + description: The type of the flaky test from Flaky Test Management. + enum: + - flaky_test + type: string + x-enum-varnames: + - FLAKY_TEST + FlakyTestsPagination: + description: Pagination metadata for flaky tests. + properties: + next_page: + description: Cursor for the next page of results. + nullable: true + type: string + type: object + FlakyTestsSearchFilter: + description: Search filter settings. + properties: + query: + default: '*' + description: 'Search query following log syntax used to filter flaky tests, + same as on Flaky Tests Management UI. The supported search keys are: + + - flaky_test_state + + - flaky_test_category + + - @test.name + + - @test.suite + + - @test.module + + - @test.service + + - @git.repository.id_v2 + + - @git.branch + + - @test.codeowners + + - env + + ' + type: string + type: object + FlakyTestsSearchPageOptions: + description: Pagination attributes for listing flaky tests. + properties: + cursor: + description: List following results with a cursor provided in the previous + request. + type: string + limit: + default: 10 + description: Maximum number of flaky tests in the response. + format: int64 + maximum: 1000 + minimum: 1 + type: integer + type: object + FlakyTestsSearchRequest: + description: The request for a flaky tests search. + properties: + data: + $ref: '#/components/schemas/FlakyTestsSearchRequestData' + type: object + FlakyTestsSearchRequestAttributes: + description: Attributes for the flaky tests search request. + properties: + filter: + $ref: '#/components/schemas/FlakyTestsSearchFilter' + page: + $ref: '#/components/schemas/FlakyTestsSearchPageOptions' + sort: + $ref: '#/components/schemas/FlakyTestsSearchSort' + type: object + FlakyTestsSearchRequestData: + description: The JSON:API data for flaky tests search request. + properties: + attributes: + $ref: '#/components/schemas/FlakyTestsSearchRequestAttributes' + type: + $ref: '#/components/schemas/FlakyTestsSearchRequestDataType' + type: object + FlakyTestsSearchRequestDataType: + description: The definition of `FlakyTestsSearchRequestDataType` object. + enum: + - search_flaky_tests_request + type: string + x-enum-varnames: + - SEARCH_FLAKY_TESTS_REQUEST + FlakyTestsSearchResponse: + description: Response object with flaky tests matching the search request. + properties: + data: + description: Array of flaky tests matching the request. + items: + $ref: '#/components/schemas/FlakyTest' + type: array + meta: + $ref: '#/components/schemas/FlakyTestsSearchResponseMeta' + type: object + FlakyTestsSearchResponseMeta: + description: Metadata for the flaky tests search response. + properties: + pagination: + $ref: '#/components/schemas/FlakyTestsPagination' + type: object + FlakyTestsSearchSort: + description: Parameter for sorting flaky test results. The default sort is by + ascending Fully Qualified Name (FQN). The FQN is the concatenation of the + test module, suite, and name. + enum: + - fqn + - -fqn + - first_flaked + - -first_flaked + - last_flaked + - -last_flaked + - failure_rate + - -failure_rate + - pipelines_failed + - -pipelines_failed + - pipelines_duration_lost + - -pipelines_duration_lost + type: string + x-enum-varnames: + - FQN_ASCENDING + - FQN_DESCENDING + - FIRST_FLAKED_ASCENDING + - FIRST_FLAKED_DESCENDING + - LAST_FLAKED_ASCENDING + - LAST_FLAKED_DESCENDING + - FAILURE_RATE_ASCENDING + - FAILURE_RATE_DESCENDING + - PIPELINES_FAILED_ASCENDING + - PIPELINES_FAILED_DESCENDING + - PIPELINES_DURATION_LOST_ASCENDING + - PIPELINES_DURATION_LOST_DESCENDING FormulaLimit: description: 'Message for specifying limits to the number of values returned by a query. @@ -75828,6 +76164,50 @@ paths: x-undo: type: idempotent x-unstable: '**Note**: This endpoint is deprecated. See the [Teams API endpoints](https://docs.datadoghq.com/api/latest/teams/).' + /api/v2/test/flaky-test-management/tests: + post: + description: List endpoint returning flaky tests from Flaky Test Management. + Results are paginated. + operationId: SearchFlakyTests + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FlakyTestsSearchRequest' + required: false + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/FlakyTestsSearchResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/NotAuthorizedResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - test_optimization_read + summary: Search flaky tests + tags: + - Test Optimization + x-codegen-request-body-name: body + x-menu-order: 1 + x-permission: + operator: OR + permissions: + - test_optimization_read + x-undo: + type: safe + x-unstable: '**Note**: This endpoint is in public beta and may be subject to + change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/usage/application_security: get: deprecated: true @@ -78040,6 +78420,9 @@ tags: - description: View and manage teams within Datadog. See the [Teams page](https://docs.datadoghq.com/account_management/teams/) for more information. name: Teams +- description: Search and manage flaky tests through Test Optimization. See the [Test + Optimization page](https://docs.datadoghq.com/tests/) for more information. + name: Test Optimization - description: 'The usage metering API allows you to get hourly, daily, and monthly usage across multiple facets of Datadog. diff --git a/data/api/v2/full_spec_deref.json b/data/api/v2/full_spec_deref.json index 7856fc7811f67..dec685fcf94ed 100644 --- a/data/api/v2/full_spec_deref.json +++ b/data/api/v2/full_spec_deref.json @@ -113615,6 +113615,989 @@ "API_SECURITY" ] }, + "FlakyTest": { + "description": "A flaky test object.", + "properties": { + "attributes": { + "description": "Attributes of a flaky test.", + "properties": { + "attempt_to_fix_id": { + "description": "Unique identifier for the attempt to fix this flaky test. Use this ID in the Git commit message in order to trigger the attempt to fix workflow.\n\nWhen the workflow is triggered the test is automatically retried by the tracer a certain number of configurable times. When all retries pass, the test is automatically marked as fixed in Flaky Test Management.\nTest runs are tagged with `@test.test_management.attempt_to_fix_passed` and `@test.test_management.is_attempt_to_fix` when the attempt to fix workflow is triggered.", + "type": "string" + }, + "codeowners": { + "description": "The name of the test's code owners as inferred from the repository configuration.", + "items": { + "type": "string" + }, + "type": "array" + }, + "envs": { + "description": "List of environments where this test has been flaky.", + "items": { + "type": "string" + }, + "type": "array" + }, + "first_flaked_branch": { + "description": "The branch name where the test exhibited flakiness for the first time.", + "type": "string" + }, + "first_flaked_sha": { + "description": "The commit SHA where the test exhibited flakiness for the first time.", + "type": "string" + }, + "first_flaked_ts": { + "description": "Unix timestamp when the test exhibited flakiness for the first time.", + "format": "int64", + "type": "integer" + }, + "flaky_category": { + "description": "The category of a flaky test.", + "nullable": true, + "type": "string" + }, + "flaky_state": { + "description": "The current state of the flaky test.", + "enum": [ + "active", + "fixed", + "quarantined", + "disabled" + ], + "type": "string", + "x-enum-varnames": [ + "ACTIVE", + "FIXED", + "QUARANTINED", + "DISABLED" + ] + }, + "last_flaked_branch": { + "description": "The branch name where the test exhibited flakiness for the last time.", + "type": "string" + }, + "last_flaked_sha": { + "description": "The commit SHA where the test exhibited flakiness for the last time.", + "type": "string" + }, + "last_flaked_ts": { + "description": "Unix timestamp when the test exhibited flakiness for the last time.", + "format": "int64", + "type": "integer" + }, + "module": { + "description": "The name of the test module. The definition of module changes slightly per language:\n- In .NET, a test module groups every test that is run under the same unit test project.\n- In Swift, a test module groups every test that is run for a given bundle.\n- In JavaScript, the test modules map one-to-one to test sessions.\n- In Java, a test module groups every test that is run by the same Maven Surefire/Failsafe or Gradle Test task execution.\n- In Python, a test module groups every test that is run under the same `.py` file as part of a test suite, which is typically managed by a framework like `unittest` or `pytest`.\n- In Ruby, a test module groups every test that is run within the same test file, which is typically managed by a framework like `RSpec` or `Minitest`.", + "nullable": true, + "type": "string" + }, + "name": { + "description": "The test name. A concise name for a test case. Defined in the test itself.", + "type": "string" + }, + "pipeline_stats": { + "nullable": true, + "description": "CI pipeline related statistics for the flaky test. This information is only available if test runs are associated with CI pipeline events from CI Visibility.", + "properties": { + "failed_pipelines": { + "description": "The number of pipelines that failed due to this test for the past 7 days. This is computed as the sum of failed CI pipeline events associated with test runs where the flaky test failed.", + "format": "int64", + "nullable": true, + "type": "integer" + }, + "total_lost_time_ms": { + "description": "The total time lost by CI pipelines due to this flaky test in milliseconds This is computed as the sum of the duration of failed CI pipeline events associated with test runs where the flaky test failed.", + "format": "int64", + "nullable": true, + "type": "integer" + } + }, + "type": "object" + }, + "services": { + "description": "List of test services names where this test has been flaky.\n\nA test service is a group of tests associated with a project or repository. It contains all the individual tests for your code, optionally organized into test suites, which are like folders for your tests.", + "items": { + "type": "string" + }, + "type": "array" + }, + "suite": { + "description": "The name of the test suite. A group of tests exercising the same unit of code depending on your language and testing framework.", + "type": "string" + }, + "test_run_metadata": { + "description": "Metadata about the latest failed test run of the flaky test", + "properties": { + "duration_ms": { + "description": "The duration of the test run in milliseconds.", + "format": "int64", + "nullable": true, + "type": "integer" + }, + "error_message": { + "description": "The error message from the test failure.", + "nullable": true, + "type": "string" + }, + "error_stack": { + "description": "The stack trace from the test failure.", + "nullable": true, + "type": "string" + }, + "source_end": { + "description": "The line number where the test ends in the source file.", + "format": "int64", + "nullable": true, + "type": "integer" + }, + "source_file": { + "description": "The source file where the test is defined.", + "nullable": true, + "type": "string" + }, + "source_start": { + "description": "The line number where the test starts in the source file.", + "format": "int64", + "nullable": true, + "type": "integer" + } + }, + "type": "object" + }, + "test_stats": { + "description": "Test statistics for the flaky test.", + "properties": { + "failure_rate_pct": { + "description": "The failure rate percentage of the test for the past 7 days. This is the number of failed test runs divided by the total number of test runs (excluding skipped test runs).", + "format": "double", + "nullable": true, + "type": "number" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "id": { + "description": "Test's ID. This ID is the hash of the test's Fully Qualified Name and Git repository ID. On Test Runs UI it is the same as the `test_fingerprint_fqn` tag.", + "type": "string" + }, + "type": { + "description": "The type of the flaky test from Flaky Test Management.", + "enum": [ + "flaky_test" + ], + "type": "string", + "x-enum-varnames": [ + "FLAKY_TEST" + ] + } + }, + "type": "object" + }, + "FlakyTestAttributes": { + "description": "Attributes of a flaky test.", + "properties": { + "attempt_to_fix_id": { + "description": "Unique identifier for the attempt to fix this flaky test. Use this ID in the Git commit message in order to trigger the attempt to fix workflow.\n\nWhen the workflow is triggered the test is automatically retried by the tracer a certain number of configurable times. When all retries pass, the test is automatically marked as fixed in Flaky Test Management.\nTest runs are tagged with `@test.test_management.attempt_to_fix_passed` and `@test.test_management.is_attempt_to_fix` when the attempt to fix workflow is triggered.", + "type": "string" + }, + "codeowners": { + "description": "The name of the test's code owners as inferred from the repository configuration.", + "items": { + "type": "string" + }, + "type": "array" + }, + "envs": { + "description": "List of environments where this test has been flaky.", + "items": { + "type": "string" + }, + "type": "array" + }, + "first_flaked_branch": { + "description": "The branch name where the test exhibited flakiness for the first time.", + "type": "string" + }, + "first_flaked_sha": { + "description": "The commit SHA where the test exhibited flakiness for the first time.", + "type": "string" + }, + "first_flaked_ts": { + "description": "Unix timestamp when the test exhibited flakiness for the first time.", + "format": "int64", + "type": "integer" + }, + "flaky_category": { + "description": "The category of a flaky test.", + "nullable": true, + "type": "string" + }, + "flaky_state": { + "description": "The current state of the flaky test.", + "enum": [ + "active", + "fixed", + "quarantined", + "disabled" + ], + "type": "string", + "x-enum-varnames": [ + "ACTIVE", + "FIXED", + "QUARANTINED", + "DISABLED" + ] + }, + "last_flaked_branch": { + "description": "The branch name where the test exhibited flakiness for the last time.", + "type": "string" + }, + "last_flaked_sha": { + "description": "The commit SHA where the test exhibited flakiness for the last time.", + "type": "string" + }, + "last_flaked_ts": { + "description": "Unix timestamp when the test exhibited flakiness for the last time.", + "format": "int64", + "type": "integer" + }, + "module": { + "description": "The name of the test module. The definition of module changes slightly per language:\n- In .NET, a test module groups every test that is run under the same unit test project.\n- In Swift, a test module groups every test that is run for a given bundle.\n- In JavaScript, the test modules map one-to-one to test sessions.\n- In Java, a test module groups every test that is run by the same Maven Surefire/Failsafe or Gradle Test task execution.\n- In Python, a test module groups every test that is run under the same `.py` file as part of a test suite, which is typically managed by a framework like `unittest` or `pytest`.\n- In Ruby, a test module groups every test that is run within the same test file, which is typically managed by a framework like `RSpec` or `Minitest`.", + "nullable": true, + "type": "string" + }, + "name": { + "description": "The test name. A concise name for a test case. Defined in the test itself.", + "type": "string" + }, + "pipeline_stats": { + "nullable": true, + "description": "CI pipeline related statistics for the flaky test. This information is only available if test runs are associated with CI pipeline events from CI Visibility.", + "properties": { + "failed_pipelines": { + "description": "The number of pipelines that failed due to this test for the past 7 days. This is computed as the sum of failed CI pipeline events associated with test runs where the flaky test failed.", + "format": "int64", + "nullable": true, + "type": "integer" + }, + "total_lost_time_ms": { + "description": "The total time lost by CI pipelines due to this flaky test in milliseconds This is computed as the sum of the duration of failed CI pipeline events associated with test runs where the flaky test failed.", + "format": "int64", + "nullable": true, + "type": "integer" + } + }, + "type": "object" + }, + "services": { + "description": "List of test services names where this test has been flaky.\n\nA test service is a group of tests associated with a project or repository. It contains all the individual tests for your code, optionally organized into test suites, which are like folders for your tests.", + "items": { + "type": "string" + }, + "type": "array" + }, + "suite": { + "description": "The name of the test suite. A group of tests exercising the same unit of code depending on your language and testing framework.", + "type": "string" + }, + "test_run_metadata": { + "description": "Metadata about the latest failed test run of the flaky test", + "properties": { + "duration_ms": { + "description": "The duration of the test run in milliseconds.", + "format": "int64", + "nullable": true, + "type": "integer" + }, + "error_message": { + "description": "The error message from the test failure.", + "nullable": true, + "type": "string" + }, + "error_stack": { + "description": "The stack trace from the test failure.", + "nullable": true, + "type": "string" + }, + "source_end": { + "description": "The line number where the test ends in the source file.", + "format": "int64", + "nullable": true, + "type": "integer" + }, + "source_file": { + "description": "The source file where the test is defined.", + "nullable": true, + "type": "string" + }, + "source_start": { + "description": "The line number where the test starts in the source file.", + "format": "int64", + "nullable": true, + "type": "integer" + } + }, + "type": "object" + }, + "test_stats": { + "description": "Test statistics for the flaky test.", + "properties": { + "failure_rate_pct": { + "description": "The failure rate percentage of the test for the past 7 days. This is the number of failed test runs divided by the total number of test runs (excluding skipped test runs).", + "format": "double", + "nullable": true, + "type": "number" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "FlakyTestAttributesFlakyState": { + "description": "The current state of the flaky test.", + "enum": [ + "active", + "fixed", + "quarantined", + "disabled" + ], + "type": "string", + "x-enum-varnames": [ + "ACTIVE", + "FIXED", + "QUARANTINED", + "DISABLED" + ] + }, + "FlakyTestPipelineStats": { + "description": "CI pipeline related statistics for the flaky test. This information is only available if test runs are associated with CI pipeline events from CI Visibility.", + "properties": { + "failed_pipelines": { + "description": "The number of pipelines that failed due to this test for the past 7 days. This is computed as the sum of failed CI pipeline events associated with test runs where the flaky test failed.", + "format": "int64", + "nullable": true, + "type": "integer" + }, + "total_lost_time_ms": { + "description": "The total time lost by CI pipelines due to this flaky test in milliseconds This is computed as the sum of the duration of failed CI pipeline events associated with test runs where the flaky test failed.", + "format": "int64", + "nullable": true, + "type": "integer" + } + }, + "type": "object" + }, + "FlakyTestRunMetadata": { + "description": "Metadata about the latest failed test run of the flaky test", + "properties": { + "duration_ms": { + "description": "The duration of the test run in milliseconds.", + "format": "int64", + "nullable": true, + "type": "integer" + }, + "error_message": { + "description": "The error message from the test failure.", + "nullable": true, + "type": "string" + }, + "error_stack": { + "description": "The stack trace from the test failure.", + "nullable": true, + "type": "string" + }, + "source_end": { + "description": "The line number where the test ends in the source file.", + "format": "int64", + "nullable": true, + "type": "integer" + }, + "source_file": { + "description": "The source file where the test is defined.", + "nullable": true, + "type": "string" + }, + "source_start": { + "description": "The line number where the test starts in the source file.", + "format": "int64", + "nullable": true, + "type": "integer" + } + }, + "type": "object" + }, + "FlakyTestStats": { + "description": "Test statistics for the flaky test.", + "properties": { + "failure_rate_pct": { + "description": "The failure rate percentage of the test for the past 7 days. This is the number of failed test runs divided by the total number of test runs (excluding skipped test runs).", + "format": "double", + "nullable": true, + "type": "number" + } + }, + "type": "object" + }, + "FlakyTestType": { + "description": "The type of the flaky test from Flaky Test Management.", + "enum": [ + "flaky_test" + ], + "type": "string", + "x-enum-varnames": [ + "FLAKY_TEST" + ] + }, + "FlakyTestsPagination": { + "description": "Pagination metadata for flaky tests.", + "properties": { + "next_page": { + "description": "Cursor for the next page of results.", + "nullable": true, + "type": "string" + } + }, + "type": "object" + }, + "FlakyTestsSearchFilter": { + "description": "Search filter settings.", + "properties": { + "query": { + "default": "*", + "description": "Search query following log syntax used to filter flaky tests, same as on Flaky Tests Management UI. The supported search keys are:\n- flaky_test_state\n- flaky_test_category\n- @test.name\n- @test.suite\n- @test.module\n- @test.service\n- @git.repository.id_v2\n- @git.branch\n- @test.codeowners\n- env\n", + "type": "string" + } + }, + "type": "object" + }, + "FlakyTestsSearchPageOptions": { + "description": "Pagination attributes for listing flaky tests.", + "properties": { + "cursor": { + "description": "List following results with a cursor provided in the previous request.", + "type": "string" + }, + "limit": { + "default": 10, + "description": "Maximum number of flaky tests in the response.", + "format": "int64", + "maximum": 1000, + "minimum": 1, + "type": "integer" + } + }, + "type": "object" + }, + "FlakyTestsSearchRequest": { + "description": "The request for a flaky tests search.", + "properties": { + "data": { + "description": "The JSON:API data for flaky tests search request.", + "properties": { + "attributes": { + "description": "Attributes for the flaky tests search request.", + "properties": { + "filter": { + "description": "Search filter settings.", + "properties": { + "query": { + "default": "*", + "description": "Search query following log syntax used to filter flaky tests, same as on Flaky Tests Management UI. The supported search keys are:\n- flaky_test_state\n- flaky_test_category\n- @test.name\n- @test.suite\n- @test.module\n- @test.service\n- @git.repository.id_v2\n- @git.branch\n- @test.codeowners\n- env\n", + "type": "string" + } + }, + "type": "object" + }, + "page": { + "description": "Pagination attributes for listing flaky tests.", + "properties": { + "cursor": { + "description": "List following results with a cursor provided in the previous request.", + "type": "string" + }, + "limit": { + "default": 10, + "description": "Maximum number of flaky tests in the response.", + "format": "int64", + "maximum": 1000, + "minimum": 1, + "type": "integer" + } + }, + "type": "object" + }, + "sort": { + "description": "Parameter for sorting flaky test results. The default sort is by ascending Fully Qualified Name (FQN). The FQN is the concatenation of the test module, suite, and name.", + "enum": [ + "fqn", + "-fqn", + "first_flaked", + "-first_flaked", + "last_flaked", + "-last_flaked", + "failure_rate", + "-failure_rate", + "pipelines_failed", + "-pipelines_failed", + "pipelines_duration_lost", + "-pipelines_duration_lost" + ], + "type": "string", + "x-enum-varnames": [ + "FQN_ASCENDING", + "FQN_DESCENDING", + "FIRST_FLAKED_ASCENDING", + "FIRST_FLAKED_DESCENDING", + "LAST_FLAKED_ASCENDING", + "LAST_FLAKED_DESCENDING", + "FAILURE_RATE_ASCENDING", + "FAILURE_RATE_DESCENDING", + "PIPELINES_FAILED_ASCENDING", + "PIPELINES_FAILED_DESCENDING", + "PIPELINES_DURATION_LOST_ASCENDING", + "PIPELINES_DURATION_LOST_DESCENDING" + ] + } + }, + "type": "object" + }, + "type": { + "description": "The definition of `FlakyTestsSearchRequestDataType` object.", + "enum": [ + "search_flaky_tests_request" + ], + "type": "string", + "x-enum-varnames": [ + "SEARCH_FLAKY_TESTS_REQUEST" + ] + } + }, + "type": "object" + } + }, + "type": "object" + }, + "FlakyTestsSearchRequestAttributes": { + "description": "Attributes for the flaky tests search request.", + "properties": { + "filter": { + "description": "Search filter settings.", + "properties": { + "query": { + "default": "*", + "description": "Search query following log syntax used to filter flaky tests, same as on Flaky Tests Management UI. The supported search keys are:\n- flaky_test_state\n- flaky_test_category\n- @test.name\n- @test.suite\n- @test.module\n- @test.service\n- @git.repository.id_v2\n- @git.branch\n- @test.codeowners\n- env\n", + "type": "string" + } + }, + "type": "object" + }, + "page": { + "description": "Pagination attributes for listing flaky tests.", + "properties": { + "cursor": { + "description": "List following results with a cursor provided in the previous request.", + "type": "string" + }, + "limit": { + "default": 10, + "description": "Maximum number of flaky tests in the response.", + "format": "int64", + "maximum": 1000, + "minimum": 1, + "type": "integer" + } + }, + "type": "object" + }, + "sort": { + "description": "Parameter for sorting flaky test results. The default sort is by ascending Fully Qualified Name (FQN). The FQN is the concatenation of the test module, suite, and name.", + "enum": [ + "fqn", + "-fqn", + "first_flaked", + "-first_flaked", + "last_flaked", + "-last_flaked", + "failure_rate", + "-failure_rate", + "pipelines_failed", + "-pipelines_failed", + "pipelines_duration_lost", + "-pipelines_duration_lost" + ], + "type": "string", + "x-enum-varnames": [ + "FQN_ASCENDING", + "FQN_DESCENDING", + "FIRST_FLAKED_ASCENDING", + "FIRST_FLAKED_DESCENDING", + "LAST_FLAKED_ASCENDING", + "LAST_FLAKED_DESCENDING", + "FAILURE_RATE_ASCENDING", + "FAILURE_RATE_DESCENDING", + "PIPELINES_FAILED_ASCENDING", + "PIPELINES_FAILED_DESCENDING", + "PIPELINES_DURATION_LOST_ASCENDING", + "PIPELINES_DURATION_LOST_DESCENDING" + ] + } + }, + "type": "object" + }, + "FlakyTestsSearchRequestData": { + "description": "The JSON:API data for flaky tests search request.", + "properties": { + "attributes": { + "description": "Attributes for the flaky tests search request.", + "properties": { + "filter": { + "description": "Search filter settings.", + "properties": { + "query": { + "default": "*", + "description": "Search query following log syntax used to filter flaky tests, same as on Flaky Tests Management UI. The supported search keys are:\n- flaky_test_state\n- flaky_test_category\n- @test.name\n- @test.suite\n- @test.module\n- @test.service\n- @git.repository.id_v2\n- @git.branch\n- @test.codeowners\n- env\n", + "type": "string" + } + }, + "type": "object" + }, + "page": { + "description": "Pagination attributes for listing flaky tests.", + "properties": { + "cursor": { + "description": "List following results with a cursor provided in the previous request.", + "type": "string" + }, + "limit": { + "default": 10, + "description": "Maximum number of flaky tests in the response.", + "format": "int64", + "maximum": 1000, + "minimum": 1, + "type": "integer" + } + }, + "type": "object" + }, + "sort": { + "description": "Parameter for sorting flaky test results. The default sort is by ascending Fully Qualified Name (FQN). The FQN is the concatenation of the test module, suite, and name.", + "enum": [ + "fqn", + "-fqn", + "first_flaked", + "-first_flaked", + "last_flaked", + "-last_flaked", + "failure_rate", + "-failure_rate", + "pipelines_failed", + "-pipelines_failed", + "pipelines_duration_lost", + "-pipelines_duration_lost" + ], + "type": "string", + "x-enum-varnames": [ + "FQN_ASCENDING", + "FQN_DESCENDING", + "FIRST_FLAKED_ASCENDING", + "FIRST_FLAKED_DESCENDING", + "LAST_FLAKED_ASCENDING", + "LAST_FLAKED_DESCENDING", + "FAILURE_RATE_ASCENDING", + "FAILURE_RATE_DESCENDING", + "PIPELINES_FAILED_ASCENDING", + "PIPELINES_FAILED_DESCENDING", + "PIPELINES_DURATION_LOST_ASCENDING", + "PIPELINES_DURATION_LOST_DESCENDING" + ] + } + }, + "type": "object" + }, + "type": { + "description": "The definition of `FlakyTestsSearchRequestDataType` object.", + "enum": [ + "search_flaky_tests_request" + ], + "type": "string", + "x-enum-varnames": [ + "SEARCH_FLAKY_TESTS_REQUEST" + ] + } + }, + "type": "object" + }, + "FlakyTestsSearchRequestDataType": { + "description": "The definition of `FlakyTestsSearchRequestDataType` object.", + "enum": [ + "search_flaky_tests_request" + ], + "type": "string", + "x-enum-varnames": [ + "SEARCH_FLAKY_TESTS_REQUEST" + ] + }, + "FlakyTestsSearchResponse": { + "description": "Response object with flaky tests matching the search request.", + "properties": { + "data": { + "description": "Array of flaky tests matching the request.", + "items": { + "description": "A flaky test object.", + "properties": { + "attributes": { + "description": "Attributes of a flaky test.", + "properties": { + "attempt_to_fix_id": { + "description": "Unique identifier for the attempt to fix this flaky test. Use this ID in the Git commit message in order to trigger the attempt to fix workflow.\n\nWhen the workflow is triggered the test is automatically retried by the tracer a certain number of configurable times. When all retries pass, the test is automatically marked as fixed in Flaky Test Management.\nTest runs are tagged with `@test.test_management.attempt_to_fix_passed` and `@test.test_management.is_attempt_to_fix` when the attempt to fix workflow is triggered.", + "type": "string" + }, + "codeowners": { + "description": "The name of the test's code owners as inferred from the repository configuration.", + "items": { + "type": "string" + }, + "type": "array" + }, + "envs": { + "description": "List of environments where this test has been flaky.", + "items": { + "type": "string" + }, + "type": "array" + }, + "first_flaked_branch": { + "description": "The branch name where the test exhibited flakiness for the first time.", + "type": "string" + }, + "first_flaked_sha": { + "description": "The commit SHA where the test exhibited flakiness for the first time.", + "type": "string" + }, + "first_flaked_ts": { + "description": "Unix timestamp when the test exhibited flakiness for the first time.", + "format": "int64", + "type": "integer" + }, + "flaky_category": { + "description": "The category of a flaky test.", + "nullable": true, + "type": "string" + }, + "flaky_state": { + "description": "The current state of the flaky test.", + "enum": [ + "active", + "fixed", + "quarantined", + "disabled" + ], + "type": "string", + "x-enum-varnames": [ + "ACTIVE", + "FIXED", + "QUARANTINED", + "DISABLED" + ] + }, + "last_flaked_branch": { + "description": "The branch name where the test exhibited flakiness for the last time.", + "type": "string" + }, + "last_flaked_sha": { + "description": "The commit SHA where the test exhibited flakiness for the last time.", + "type": "string" + }, + "last_flaked_ts": { + "description": "Unix timestamp when the test exhibited flakiness for the last time.", + "format": "int64", + "type": "integer" + }, + "module": { + "description": "The name of the test module. The definition of module changes slightly per language:\n- In .NET, a test module groups every test that is run under the same unit test project.\n- In Swift, a test module groups every test that is run for a given bundle.\n- In JavaScript, the test modules map one-to-one to test sessions.\n- In Java, a test module groups every test that is run by the same Maven Surefire/Failsafe or Gradle Test task execution.\n- In Python, a test module groups every test that is run under the same `.py` file as part of a test suite, which is typically managed by a framework like `unittest` or `pytest`.\n- In Ruby, a test module groups every test that is run within the same test file, which is typically managed by a framework like `RSpec` or `Minitest`.", + "nullable": true, + "type": "string" + }, + "name": { + "description": "The test name. A concise name for a test case. Defined in the test itself.", + "type": "string" + }, + "pipeline_stats": { + "nullable": true, + "description": "CI pipeline related statistics for the flaky test. This information is only available if test runs are associated with CI pipeline events from CI Visibility.", + "properties": { + "failed_pipelines": { + "description": "The number of pipelines that failed due to this test for the past 7 days. This is computed as the sum of failed CI pipeline events associated with test runs where the flaky test failed.", + "format": "int64", + "nullable": true, + "type": "integer" + }, + "total_lost_time_ms": { + "description": "The total time lost by CI pipelines due to this flaky test in milliseconds This is computed as the sum of the duration of failed CI pipeline events associated with test runs where the flaky test failed.", + "format": "int64", + "nullable": true, + "type": "integer" + } + }, + "type": "object" + }, + "services": { + "description": "List of test services names where this test has been flaky.\n\nA test service is a group of tests associated with a project or repository. It contains all the individual tests for your code, optionally organized into test suites, which are like folders for your tests.", + "items": { + "type": "string" + }, + "type": "array" + }, + "suite": { + "description": "The name of the test suite. A group of tests exercising the same unit of code depending on your language and testing framework.", + "type": "string" + }, + "test_run_metadata": { + "description": "Metadata about the latest failed test run of the flaky test", + "properties": { + "duration_ms": { + "description": "The duration of the test run in milliseconds.", + "format": "int64", + "nullable": true, + "type": "integer" + }, + "error_message": { + "description": "The error message from the test failure.", + "nullable": true, + "type": "string" + }, + "error_stack": { + "description": "The stack trace from the test failure.", + "nullable": true, + "type": "string" + }, + "source_end": { + "description": "The line number where the test ends in the source file.", + "format": "int64", + "nullable": true, + "type": "integer" + }, + "source_file": { + "description": "The source file where the test is defined.", + "nullable": true, + "type": "string" + }, + "source_start": { + "description": "The line number where the test starts in the source file.", + "format": "int64", + "nullable": true, + "type": "integer" + } + }, + "type": "object" + }, + "test_stats": { + "description": "Test statistics for the flaky test.", + "properties": { + "failure_rate_pct": { + "description": "The failure rate percentage of the test for the past 7 days. This is the number of failed test runs divided by the total number of test runs (excluding skipped test runs).", + "format": "double", + "nullable": true, + "type": "number" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "id": { + "description": "Test's ID. This ID is the hash of the test's Fully Qualified Name and Git repository ID. On Test Runs UI it is the same as the `test_fingerprint_fqn` tag.", + "type": "string" + }, + "type": { + "description": "The type of the flaky test from Flaky Test Management.", + "enum": [ + "flaky_test" + ], + "type": "string", + "x-enum-varnames": [ + "FLAKY_TEST" + ] + } + }, + "type": "object" + }, + "type": "array" + }, + "meta": { + "description": "Metadata for the flaky tests search response.", + "properties": { + "pagination": { + "description": "Pagination metadata for flaky tests.", + "properties": { + "next_page": { + "description": "Cursor for the next page of results.", + "nullable": true, + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "FlakyTestsSearchResponseMeta": { + "description": "Metadata for the flaky tests search response.", + "properties": { + "pagination": { + "description": "Pagination metadata for flaky tests.", + "properties": { + "next_page": { + "description": "Cursor for the next page of results.", + "nullable": true, + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "FlakyTestsSearchSort": { + "description": "Parameter for sorting flaky test results. The default sort is by ascending Fully Qualified Name (FQN). The FQN is the concatenation of the test module, suite, and name.", + "enum": [ + "fqn", + "-fqn", + "first_flaked", + "-first_flaked", + "last_flaked", + "-last_flaked", + "failure_rate", + "-failure_rate", + "pipelines_failed", + "-pipelines_failed", + "pipelines_duration_lost", + "-pipelines_duration_lost" + ], + "type": "string", + "x-enum-varnames": [ + "FQN_ASCENDING", + "FQN_DESCENDING", + "FIRST_FLAKED_ASCENDING", + "FIRST_FLAKED_DESCENDING", + "LAST_FLAKED_ASCENDING", + "LAST_FLAKED_DESCENDING", + "FAILURE_RATE_ASCENDING", + "FAILURE_RATE_DESCENDING", + "PIPELINES_FAILED_ASCENDING", + "PIPELINES_FAILED_DESCENDING", + "PIPELINES_DURATION_LOST_ASCENDING", + "PIPELINES_DURATION_LOST_DESCENDING" + ] + }, "FormulaLimit": { "description": "Message for specifying limits to the number of values returned by a query.\nThis limit is only for scalar queries and has no effect on timeseries queries.", "properties": { @@ -669801,37 +670784,467 @@ } } }, - "description": "Bad Request" + "description": "Bad Request" + }, + "401": { + "content": { + "application/json": { + "schema": { + "description": "API error response.", + "properties": { + "errors": { + "description": "A list of errors.", + "example": [ + "Bad Request" + ], + "items": { + "description": "A list of items.", + "example": "Bad Request", + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "errors" + ], + "type": "object" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "description": "API error response.", + "properties": { + "errors": { + "description": "A list of errors.", + "example": [ + "Bad Request" + ], + "items": { + "description": "A list of items.", + "example": "Bad Request", + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "errors" + ], + "type": "object" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "description": "API error response.", + "properties": { + "errors": { + "description": "A list of errors.", + "example": [ + "Bad Request" + ], + "items": { + "description": "A list of items.", + "example": "Bad Request", + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "errors" + ], + "type": "object" + } + } + }, + "description": "Not Found" + }, + "429": { + "content": { + "application/json": { + "schema": { + "description": "API error response.", + "properties": { + "errors": { + "description": "A list of errors.", + "example": [ + "Bad Request" + ], + "items": { + "description": "A list of items.", + "example": "Bad Request", + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "errors" + ], + "type": "object" + } + } + }, + "description": "Too many requests" + } + }, + "security": [ + { + "apiKeyAuth": [], + "appKeyAuth": [] }, - "401": { + { + "AuthZ": [ + "incident_settings_write" + ] + } + ], + "summary": "Update an existing incident team", + "tags": [ + "Incident Teams" + ], + "x-codegen-request-body-name": "body", + "x-menu-order": 3, + "x-permission": { + "operator": "OR", + "permissions": [ + "incident_settings_write" + ] + }, + "x-undo": { + "type": "idempotent" + }, + "x-unstable": "**Note**: This endpoint is deprecated. See the [Teams API endpoints](https://docs.datadoghq.com/api/latest/teams/)." + } + }, + "/api/v2/test/flaky-test-management/tests": { + "post": { + "description": "List endpoint returning flaky tests from Flaky Test Management. Results are paginated.", + "operationId": "SearchFlakyTests", + "requestBody": { + "content": { + "application/json": { + "schema": { + "description": "The request for a flaky tests search.", + "properties": { + "data": { + "description": "The JSON:API data for flaky tests search request.", + "properties": { + "attributes": { + "description": "Attributes for the flaky tests search request.", + "properties": { + "filter": { + "description": "Search filter settings.", + "properties": { + "query": { + "default": "*", + "description": "Search query following log syntax used to filter flaky tests, same as on Flaky Tests Management UI. The supported search keys are:\n- flaky_test_state\n- flaky_test_category\n- @test.name\n- @test.suite\n- @test.module\n- @test.service\n- @git.repository.id_v2\n- @git.branch\n- @test.codeowners\n- env\n", + "type": "string" + } + }, + "type": "object" + }, + "page": { + "description": "Pagination attributes for listing flaky tests.", + "properties": { + "cursor": { + "description": "List following results with a cursor provided in the previous request.", + "type": "string" + }, + "limit": { + "default": 10, + "description": "Maximum number of flaky tests in the response.", + "format": "int64", + "maximum": 1000, + "minimum": 1, + "type": "integer" + } + }, + "type": "object" + }, + "sort": { + "description": "Parameter for sorting flaky test results. The default sort is by ascending Fully Qualified Name (FQN). The FQN is the concatenation of the test module, suite, and name.", + "enum": [ + "fqn", + "-fqn", + "first_flaked", + "-first_flaked", + "last_flaked", + "-last_flaked", + "failure_rate", + "-failure_rate", + "pipelines_failed", + "-pipelines_failed", + "pipelines_duration_lost", + "-pipelines_duration_lost" + ], + "type": "string", + "x-enum-varnames": [ + "FQN_ASCENDING", + "FQN_DESCENDING", + "FIRST_FLAKED_ASCENDING", + "FIRST_FLAKED_DESCENDING", + "LAST_FLAKED_ASCENDING", + "LAST_FLAKED_DESCENDING", + "FAILURE_RATE_ASCENDING", + "FAILURE_RATE_DESCENDING", + "PIPELINES_FAILED_ASCENDING", + "PIPELINES_FAILED_DESCENDING", + "PIPELINES_DURATION_LOST_ASCENDING", + "PIPELINES_DURATION_LOST_DESCENDING" + ] + } + }, + "type": "object" + }, + "type": { + "description": "The definition of `FlakyTestsSearchRequestDataType` object.", + "enum": [ + "search_flaky_tests_request" + ], + "type": "string", + "x-enum-varnames": [ + "SEARCH_FLAKY_TESTS_REQUEST" + ] + } + }, + "type": "object" + } + }, + "type": "object" + } + } + }, + "required": false + }, + "responses": { + "200": { "content": { "application/json": { "schema": { - "description": "API error response.", + "description": "Response object with flaky tests matching the search request.", "properties": { - "errors": { - "description": "A list of errors.", - "example": [ - "Bad Request" - ], + "data": { + "description": "Array of flaky tests matching the request.", "items": { - "description": "A list of items.", - "example": "Bad Request", - "type": "string" + "description": "A flaky test object.", + "properties": { + "attributes": { + "description": "Attributes of a flaky test.", + "properties": { + "attempt_to_fix_id": { + "description": "Unique identifier for the attempt to fix this flaky test. Use this ID in the Git commit message in order to trigger the attempt to fix workflow.\n\nWhen the workflow is triggered the test is automatically retried by the tracer a certain number of configurable times. When all retries pass, the test is automatically marked as fixed in Flaky Test Management.\nTest runs are tagged with `@test.test_management.attempt_to_fix_passed` and `@test.test_management.is_attempt_to_fix` when the attempt to fix workflow is triggered.", + "type": "string" + }, + "codeowners": { + "description": "The name of the test's code owners as inferred from the repository configuration.", + "items": { + "type": "string" + }, + "type": "array" + }, + "envs": { + "description": "List of environments where this test has been flaky.", + "items": { + "type": "string" + }, + "type": "array" + }, + "first_flaked_branch": { + "description": "The branch name where the test exhibited flakiness for the first time.", + "type": "string" + }, + "first_flaked_sha": { + "description": "The commit SHA where the test exhibited flakiness for the first time.", + "type": "string" + }, + "first_flaked_ts": { + "description": "Unix timestamp when the test exhibited flakiness for the first time.", + "format": "int64", + "type": "integer" + }, + "flaky_category": { + "description": "The category of a flaky test.", + "nullable": true, + "type": "string" + }, + "flaky_state": { + "description": "The current state of the flaky test.", + "enum": [ + "active", + "fixed", + "quarantined", + "disabled" + ], + "type": "string", + "x-enum-varnames": [ + "ACTIVE", + "FIXED", + "QUARANTINED", + "DISABLED" + ] + }, + "last_flaked_branch": { + "description": "The branch name where the test exhibited flakiness for the last time.", + "type": "string" + }, + "last_flaked_sha": { + "description": "The commit SHA where the test exhibited flakiness for the last time.", + "type": "string" + }, + "last_flaked_ts": { + "description": "Unix timestamp when the test exhibited flakiness for the last time.", + "format": "int64", + "type": "integer" + }, + "module": { + "description": "The name of the test module. The definition of module changes slightly per language:\n- In .NET, a test module groups every test that is run under the same unit test project.\n- In Swift, a test module groups every test that is run for a given bundle.\n- In JavaScript, the test modules map one-to-one to test sessions.\n- In Java, a test module groups every test that is run by the same Maven Surefire/Failsafe or Gradle Test task execution.\n- In Python, a test module groups every test that is run under the same `.py` file as part of a test suite, which is typically managed by a framework like `unittest` or `pytest`.\n- In Ruby, a test module groups every test that is run within the same test file, which is typically managed by a framework like `RSpec` or `Minitest`.", + "nullable": true, + "type": "string" + }, + "name": { + "description": "The test name. A concise name for a test case. Defined in the test itself.", + "type": "string" + }, + "pipeline_stats": { + "nullable": true, + "description": "CI pipeline related statistics for the flaky test. This information is only available if test runs are associated with CI pipeline events from CI Visibility.", + "properties": { + "failed_pipelines": { + "description": "The number of pipelines that failed due to this test for the past 7 days. This is computed as the sum of failed CI pipeline events associated with test runs where the flaky test failed.", + "format": "int64", + "nullable": true, + "type": "integer" + }, + "total_lost_time_ms": { + "description": "The total time lost by CI pipelines due to this flaky test in milliseconds This is computed as the sum of the duration of failed CI pipeline events associated with test runs where the flaky test failed.", + "format": "int64", + "nullable": true, + "type": "integer" + } + }, + "type": "object" + }, + "services": { + "description": "List of test services names where this test has been flaky.\n\nA test service is a group of tests associated with a project or repository. It contains all the individual tests for your code, optionally organized into test suites, which are like folders for your tests.", + "items": { + "type": "string" + }, + "type": "array" + }, + "suite": { + "description": "The name of the test suite. A group of tests exercising the same unit of code depending on your language and testing framework.", + "type": "string" + }, + "test_run_metadata": { + "description": "Metadata about the latest failed test run of the flaky test", + "properties": { + "duration_ms": { + "description": "The duration of the test run in milliseconds.", + "format": "int64", + "nullable": true, + "type": "integer" + }, + "error_message": { + "description": "The error message from the test failure.", + "nullable": true, + "type": "string" + }, + "error_stack": { + "description": "The stack trace from the test failure.", + "nullable": true, + "type": "string" + }, + "source_end": { + "description": "The line number where the test ends in the source file.", + "format": "int64", + "nullable": true, + "type": "integer" + }, + "source_file": { + "description": "The source file where the test is defined.", + "nullable": true, + "type": "string" + }, + "source_start": { + "description": "The line number where the test starts in the source file.", + "format": "int64", + "nullable": true, + "type": "integer" + } + }, + "type": "object" + }, + "test_stats": { + "description": "Test statistics for the flaky test.", + "properties": { + "failure_rate_pct": { + "description": "The failure rate percentage of the test for the past 7 days. This is the number of failed test runs divided by the total number of test runs (excluding skipped test runs).", + "format": "double", + "nullable": true, + "type": "number" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "id": { + "description": "Test's ID. This ID is the hash of the test's Fully Qualified Name and Git repository ID. On Test Runs UI it is the same as the `test_fingerprint_fqn` tag.", + "type": "string" + }, + "type": { + "description": "The type of the flaky test from Flaky Test Management.", + "enum": [ + "flaky_test" + ], + "type": "string", + "x-enum-varnames": [ + "FLAKY_TEST" + ] + } + }, + "type": "object" }, "type": "array" + }, + "meta": { + "description": "Metadata for the flaky tests search response.", + "properties": { + "pagination": { + "description": "Pagination metadata for flaky tests.", + "properties": { + "next_page": { + "description": "Cursor for the next page of results.", + "nullable": true, + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" } }, - "required": [ - "errors" - ], "type": "object" } } }, - "description": "Unauthorized" + "description": "OK" }, - "403": { + "400": { "content": { "application/json": { "schema": { @@ -669857,9 +671270,9 @@ } } }, - "description": "Forbidden" + "description": "Bad Request" }, - "404": { + "403": { "content": { "application/json": { "schema": { @@ -669885,7 +671298,7 @@ } } }, - "description": "Not Found" + "description": "Not Authorized" }, "429": { "content": { @@ -669923,26 +671336,26 @@ }, { "AuthZ": [ - "incident_settings_write" + "test_optimization_read" ] } ], - "summary": "Update an existing incident team", + "summary": "Search flaky tests", "tags": [ - "Incident Teams" + "Test Optimization" ], "x-codegen-request-body-name": "body", - "x-menu-order": 3, + "x-menu-order": 1, "x-permission": { "operator": "OR", "permissions": [ - "incident_settings_write" + "test_optimization_read" ] }, "x-undo": { - "type": "idempotent" + "type": "safe" }, - "x-unstable": "**Note**: This endpoint is deprecated. See the [Teams API endpoints](https://docs.datadoghq.com/api/latest/teams/)." + "x-unstable": "**Note**: This endpoint is in public beta and may be subject to change.\nIf you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/)." } }, "/api/v2/usage/application_security": { @@ -686020,6 +687433,10 @@ "description": "View and manage teams within Datadog. See the [Teams page](https://docs.datadoghq.com/account_management/teams/) for more information.", "name": "Teams" }, + { + "description": "Search and manage flaky tests through Test Optimization. See the [Test Optimization page](https://docs.datadoghq.com/tests/) for more information.", + "name": "Test Optimization" + }, { "description": "The usage metering API allows you to get hourly, daily, and\nmonthly usage across multiple facets of Datadog.\nThis API is available to all Pro and Enterprise customers.\n\n**Note**: Usage data is delayed by up to 72 hours from when it was incurred.\nIt is retained for 15 months.\n\nYou can retrieve up to 24 hours of hourly usage data for multiple organizations,\nand up to two months of hourly usage data for a single organization in one request.\nLearn more on the [usage details documentation](https://docs.datadoghq.com/account_management/billing/usage_details/).", "externalDocs": { diff --git a/data/api/v2/translate_actions.json b/data/api/v2/translate_actions.json index 6e33040b4f827..faca50039dd06 100644 --- a/data/api/v2/translate_actions.json +++ b/data/api/v2/translate_actions.json @@ -2759,6 +2759,12 @@ "request_description": "Incident Team Payload.", "request_schema_description": "Update request with an incident team payload." }, + "SearchFlakyTests": { + "description": "List endpoint returning flaky tests from Flaky Test Management. Results are paginated.", + "summary": "Search flaky tests", + "request_description": "", + "request_schema_description": "The request for a flaky tests search." + }, "GetUsageApplicationSecurityMonitoring": { "description": "Get hourly usage for application security .\n**Note:** This endpoint has been deprecated. Hourly usage data for all products is now available in the [Get hourly usage by product family API](https://docs.datadoghq.com/api/latest/usage-metering/#get-hourly-usage-by-product-family)", "summary": "Get hourly usage for application security" diff --git a/data/api/v2/translate_tags.json b/data/api/v2/translate_tags.json index fa7ce4ac028a4..55e12ef9fc511 100644 --- a/data/api/v2/translate_tags.json +++ b/data/api/v2/translate_tags.json @@ -291,6 +291,10 @@ "name": "Teams", "description": "View and manage teams within Datadog. See the [Teams page](https://docs.datadoghq.com/account_management/teams/) for more information." }, + "test-optimization": { + "name": "Test Optimization", + "description": "Search and manage flaky tests through Test Optimization. See the [Test Optimization page](https://docs.datadoghq.com/tests/) for more information." + }, "usage-metering": { "name": "Usage Metering", "description": "The usage metering API allows you to get hourly, daily, and\nmonthly usage across multiple facets of Datadog.\nThis API is available to all Pro and Enterprise customers.\n\n**Note**: Usage data is delayed by up to 72 hours from when it was incurred.\nIt is retained for 15 months.\n\nYou can retrieve up to 24 hours of hourly usage data for multiple organizations,\nand up to two months of hourly usage data for a single organization in one request.\nLearn more on the [usage details documentation](https://docs.datadoghq.com/account_management/billing/usage_details/)." diff --git a/static/resources/json/full_spec_v2.json b/static/resources/json/full_spec_v2.json index 7856fc7811f67..dec685fcf94ed 100644 --- a/static/resources/json/full_spec_v2.json +++ b/static/resources/json/full_spec_v2.json @@ -113615,6 +113615,989 @@ "API_SECURITY" ] }, + "FlakyTest": { + "description": "A flaky test object.", + "properties": { + "attributes": { + "description": "Attributes of a flaky test.", + "properties": { + "attempt_to_fix_id": { + "description": "Unique identifier for the attempt to fix this flaky test. Use this ID in the Git commit message in order to trigger the attempt to fix workflow.\n\nWhen the workflow is triggered the test is automatically retried by the tracer a certain number of configurable times. When all retries pass, the test is automatically marked as fixed in Flaky Test Management.\nTest runs are tagged with `@test.test_management.attempt_to_fix_passed` and `@test.test_management.is_attempt_to_fix` when the attempt to fix workflow is triggered.", + "type": "string" + }, + "codeowners": { + "description": "The name of the test's code owners as inferred from the repository configuration.", + "items": { + "type": "string" + }, + "type": "array" + }, + "envs": { + "description": "List of environments where this test has been flaky.", + "items": { + "type": "string" + }, + "type": "array" + }, + "first_flaked_branch": { + "description": "The branch name where the test exhibited flakiness for the first time.", + "type": "string" + }, + "first_flaked_sha": { + "description": "The commit SHA where the test exhibited flakiness for the first time.", + "type": "string" + }, + "first_flaked_ts": { + "description": "Unix timestamp when the test exhibited flakiness for the first time.", + "format": "int64", + "type": "integer" + }, + "flaky_category": { + "description": "The category of a flaky test.", + "nullable": true, + "type": "string" + }, + "flaky_state": { + "description": "The current state of the flaky test.", + "enum": [ + "active", + "fixed", + "quarantined", + "disabled" + ], + "type": "string", + "x-enum-varnames": [ + "ACTIVE", + "FIXED", + "QUARANTINED", + "DISABLED" + ] + }, + "last_flaked_branch": { + "description": "The branch name where the test exhibited flakiness for the last time.", + "type": "string" + }, + "last_flaked_sha": { + "description": "The commit SHA where the test exhibited flakiness for the last time.", + "type": "string" + }, + "last_flaked_ts": { + "description": "Unix timestamp when the test exhibited flakiness for the last time.", + "format": "int64", + "type": "integer" + }, + "module": { + "description": "The name of the test module. The definition of module changes slightly per language:\n- In .NET, a test module groups every test that is run under the same unit test project.\n- In Swift, a test module groups every test that is run for a given bundle.\n- In JavaScript, the test modules map one-to-one to test sessions.\n- In Java, a test module groups every test that is run by the same Maven Surefire/Failsafe or Gradle Test task execution.\n- In Python, a test module groups every test that is run under the same `.py` file as part of a test suite, which is typically managed by a framework like `unittest` or `pytest`.\n- In Ruby, a test module groups every test that is run within the same test file, which is typically managed by a framework like `RSpec` or `Minitest`.", + "nullable": true, + "type": "string" + }, + "name": { + "description": "The test name. A concise name for a test case. Defined in the test itself.", + "type": "string" + }, + "pipeline_stats": { + "nullable": true, + "description": "CI pipeline related statistics for the flaky test. This information is only available if test runs are associated with CI pipeline events from CI Visibility.", + "properties": { + "failed_pipelines": { + "description": "The number of pipelines that failed due to this test for the past 7 days. This is computed as the sum of failed CI pipeline events associated with test runs where the flaky test failed.", + "format": "int64", + "nullable": true, + "type": "integer" + }, + "total_lost_time_ms": { + "description": "The total time lost by CI pipelines due to this flaky test in milliseconds This is computed as the sum of the duration of failed CI pipeline events associated with test runs where the flaky test failed.", + "format": "int64", + "nullable": true, + "type": "integer" + } + }, + "type": "object" + }, + "services": { + "description": "List of test services names where this test has been flaky.\n\nA test service is a group of tests associated with a project or repository. It contains all the individual tests for your code, optionally organized into test suites, which are like folders for your tests.", + "items": { + "type": "string" + }, + "type": "array" + }, + "suite": { + "description": "The name of the test suite. A group of tests exercising the same unit of code depending on your language and testing framework.", + "type": "string" + }, + "test_run_metadata": { + "description": "Metadata about the latest failed test run of the flaky test", + "properties": { + "duration_ms": { + "description": "The duration of the test run in milliseconds.", + "format": "int64", + "nullable": true, + "type": "integer" + }, + "error_message": { + "description": "The error message from the test failure.", + "nullable": true, + "type": "string" + }, + "error_stack": { + "description": "The stack trace from the test failure.", + "nullable": true, + "type": "string" + }, + "source_end": { + "description": "The line number where the test ends in the source file.", + "format": "int64", + "nullable": true, + "type": "integer" + }, + "source_file": { + "description": "The source file where the test is defined.", + "nullable": true, + "type": "string" + }, + "source_start": { + "description": "The line number where the test starts in the source file.", + "format": "int64", + "nullable": true, + "type": "integer" + } + }, + "type": "object" + }, + "test_stats": { + "description": "Test statistics for the flaky test.", + "properties": { + "failure_rate_pct": { + "description": "The failure rate percentage of the test for the past 7 days. This is the number of failed test runs divided by the total number of test runs (excluding skipped test runs).", + "format": "double", + "nullable": true, + "type": "number" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "id": { + "description": "Test's ID. This ID is the hash of the test's Fully Qualified Name and Git repository ID. On Test Runs UI it is the same as the `test_fingerprint_fqn` tag.", + "type": "string" + }, + "type": { + "description": "The type of the flaky test from Flaky Test Management.", + "enum": [ + "flaky_test" + ], + "type": "string", + "x-enum-varnames": [ + "FLAKY_TEST" + ] + } + }, + "type": "object" + }, + "FlakyTestAttributes": { + "description": "Attributes of a flaky test.", + "properties": { + "attempt_to_fix_id": { + "description": "Unique identifier for the attempt to fix this flaky test. Use this ID in the Git commit message in order to trigger the attempt to fix workflow.\n\nWhen the workflow is triggered the test is automatically retried by the tracer a certain number of configurable times. When all retries pass, the test is automatically marked as fixed in Flaky Test Management.\nTest runs are tagged with `@test.test_management.attempt_to_fix_passed` and `@test.test_management.is_attempt_to_fix` when the attempt to fix workflow is triggered.", + "type": "string" + }, + "codeowners": { + "description": "The name of the test's code owners as inferred from the repository configuration.", + "items": { + "type": "string" + }, + "type": "array" + }, + "envs": { + "description": "List of environments where this test has been flaky.", + "items": { + "type": "string" + }, + "type": "array" + }, + "first_flaked_branch": { + "description": "The branch name where the test exhibited flakiness for the first time.", + "type": "string" + }, + "first_flaked_sha": { + "description": "The commit SHA where the test exhibited flakiness for the first time.", + "type": "string" + }, + "first_flaked_ts": { + "description": "Unix timestamp when the test exhibited flakiness for the first time.", + "format": "int64", + "type": "integer" + }, + "flaky_category": { + "description": "The category of a flaky test.", + "nullable": true, + "type": "string" + }, + "flaky_state": { + "description": "The current state of the flaky test.", + "enum": [ + "active", + "fixed", + "quarantined", + "disabled" + ], + "type": "string", + "x-enum-varnames": [ + "ACTIVE", + "FIXED", + "QUARANTINED", + "DISABLED" + ] + }, + "last_flaked_branch": { + "description": "The branch name where the test exhibited flakiness for the last time.", + "type": "string" + }, + "last_flaked_sha": { + "description": "The commit SHA where the test exhibited flakiness for the last time.", + "type": "string" + }, + "last_flaked_ts": { + "description": "Unix timestamp when the test exhibited flakiness for the last time.", + "format": "int64", + "type": "integer" + }, + "module": { + "description": "The name of the test module. The definition of module changes slightly per language:\n- In .NET, a test module groups every test that is run under the same unit test project.\n- In Swift, a test module groups every test that is run for a given bundle.\n- In JavaScript, the test modules map one-to-one to test sessions.\n- In Java, a test module groups every test that is run by the same Maven Surefire/Failsafe or Gradle Test task execution.\n- In Python, a test module groups every test that is run under the same `.py` file as part of a test suite, which is typically managed by a framework like `unittest` or `pytest`.\n- In Ruby, a test module groups every test that is run within the same test file, which is typically managed by a framework like `RSpec` or `Minitest`.", + "nullable": true, + "type": "string" + }, + "name": { + "description": "The test name. A concise name for a test case. Defined in the test itself.", + "type": "string" + }, + "pipeline_stats": { + "nullable": true, + "description": "CI pipeline related statistics for the flaky test. This information is only available if test runs are associated with CI pipeline events from CI Visibility.", + "properties": { + "failed_pipelines": { + "description": "The number of pipelines that failed due to this test for the past 7 days. This is computed as the sum of failed CI pipeline events associated with test runs where the flaky test failed.", + "format": "int64", + "nullable": true, + "type": "integer" + }, + "total_lost_time_ms": { + "description": "The total time lost by CI pipelines due to this flaky test in milliseconds This is computed as the sum of the duration of failed CI pipeline events associated with test runs where the flaky test failed.", + "format": "int64", + "nullable": true, + "type": "integer" + } + }, + "type": "object" + }, + "services": { + "description": "List of test services names where this test has been flaky.\n\nA test service is a group of tests associated with a project or repository. It contains all the individual tests for your code, optionally organized into test suites, which are like folders for your tests.", + "items": { + "type": "string" + }, + "type": "array" + }, + "suite": { + "description": "The name of the test suite. A group of tests exercising the same unit of code depending on your language and testing framework.", + "type": "string" + }, + "test_run_metadata": { + "description": "Metadata about the latest failed test run of the flaky test", + "properties": { + "duration_ms": { + "description": "The duration of the test run in milliseconds.", + "format": "int64", + "nullable": true, + "type": "integer" + }, + "error_message": { + "description": "The error message from the test failure.", + "nullable": true, + "type": "string" + }, + "error_stack": { + "description": "The stack trace from the test failure.", + "nullable": true, + "type": "string" + }, + "source_end": { + "description": "The line number where the test ends in the source file.", + "format": "int64", + "nullable": true, + "type": "integer" + }, + "source_file": { + "description": "The source file where the test is defined.", + "nullable": true, + "type": "string" + }, + "source_start": { + "description": "The line number where the test starts in the source file.", + "format": "int64", + "nullable": true, + "type": "integer" + } + }, + "type": "object" + }, + "test_stats": { + "description": "Test statistics for the flaky test.", + "properties": { + "failure_rate_pct": { + "description": "The failure rate percentage of the test for the past 7 days. This is the number of failed test runs divided by the total number of test runs (excluding skipped test runs).", + "format": "double", + "nullable": true, + "type": "number" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "FlakyTestAttributesFlakyState": { + "description": "The current state of the flaky test.", + "enum": [ + "active", + "fixed", + "quarantined", + "disabled" + ], + "type": "string", + "x-enum-varnames": [ + "ACTIVE", + "FIXED", + "QUARANTINED", + "DISABLED" + ] + }, + "FlakyTestPipelineStats": { + "description": "CI pipeline related statistics for the flaky test. This information is only available if test runs are associated with CI pipeline events from CI Visibility.", + "properties": { + "failed_pipelines": { + "description": "The number of pipelines that failed due to this test for the past 7 days. This is computed as the sum of failed CI pipeline events associated with test runs where the flaky test failed.", + "format": "int64", + "nullable": true, + "type": "integer" + }, + "total_lost_time_ms": { + "description": "The total time lost by CI pipelines due to this flaky test in milliseconds This is computed as the sum of the duration of failed CI pipeline events associated with test runs where the flaky test failed.", + "format": "int64", + "nullable": true, + "type": "integer" + } + }, + "type": "object" + }, + "FlakyTestRunMetadata": { + "description": "Metadata about the latest failed test run of the flaky test", + "properties": { + "duration_ms": { + "description": "The duration of the test run in milliseconds.", + "format": "int64", + "nullable": true, + "type": "integer" + }, + "error_message": { + "description": "The error message from the test failure.", + "nullable": true, + "type": "string" + }, + "error_stack": { + "description": "The stack trace from the test failure.", + "nullable": true, + "type": "string" + }, + "source_end": { + "description": "The line number where the test ends in the source file.", + "format": "int64", + "nullable": true, + "type": "integer" + }, + "source_file": { + "description": "The source file where the test is defined.", + "nullable": true, + "type": "string" + }, + "source_start": { + "description": "The line number where the test starts in the source file.", + "format": "int64", + "nullable": true, + "type": "integer" + } + }, + "type": "object" + }, + "FlakyTestStats": { + "description": "Test statistics for the flaky test.", + "properties": { + "failure_rate_pct": { + "description": "The failure rate percentage of the test for the past 7 days. This is the number of failed test runs divided by the total number of test runs (excluding skipped test runs).", + "format": "double", + "nullable": true, + "type": "number" + } + }, + "type": "object" + }, + "FlakyTestType": { + "description": "The type of the flaky test from Flaky Test Management.", + "enum": [ + "flaky_test" + ], + "type": "string", + "x-enum-varnames": [ + "FLAKY_TEST" + ] + }, + "FlakyTestsPagination": { + "description": "Pagination metadata for flaky tests.", + "properties": { + "next_page": { + "description": "Cursor for the next page of results.", + "nullable": true, + "type": "string" + } + }, + "type": "object" + }, + "FlakyTestsSearchFilter": { + "description": "Search filter settings.", + "properties": { + "query": { + "default": "*", + "description": "Search query following log syntax used to filter flaky tests, same as on Flaky Tests Management UI. The supported search keys are:\n- flaky_test_state\n- flaky_test_category\n- @test.name\n- @test.suite\n- @test.module\n- @test.service\n- @git.repository.id_v2\n- @git.branch\n- @test.codeowners\n- env\n", + "type": "string" + } + }, + "type": "object" + }, + "FlakyTestsSearchPageOptions": { + "description": "Pagination attributes for listing flaky tests.", + "properties": { + "cursor": { + "description": "List following results with a cursor provided in the previous request.", + "type": "string" + }, + "limit": { + "default": 10, + "description": "Maximum number of flaky tests in the response.", + "format": "int64", + "maximum": 1000, + "minimum": 1, + "type": "integer" + } + }, + "type": "object" + }, + "FlakyTestsSearchRequest": { + "description": "The request for a flaky tests search.", + "properties": { + "data": { + "description": "The JSON:API data for flaky tests search request.", + "properties": { + "attributes": { + "description": "Attributes for the flaky tests search request.", + "properties": { + "filter": { + "description": "Search filter settings.", + "properties": { + "query": { + "default": "*", + "description": "Search query following log syntax used to filter flaky tests, same as on Flaky Tests Management UI. The supported search keys are:\n- flaky_test_state\n- flaky_test_category\n- @test.name\n- @test.suite\n- @test.module\n- @test.service\n- @git.repository.id_v2\n- @git.branch\n- @test.codeowners\n- env\n", + "type": "string" + } + }, + "type": "object" + }, + "page": { + "description": "Pagination attributes for listing flaky tests.", + "properties": { + "cursor": { + "description": "List following results with a cursor provided in the previous request.", + "type": "string" + }, + "limit": { + "default": 10, + "description": "Maximum number of flaky tests in the response.", + "format": "int64", + "maximum": 1000, + "minimum": 1, + "type": "integer" + } + }, + "type": "object" + }, + "sort": { + "description": "Parameter for sorting flaky test results. The default sort is by ascending Fully Qualified Name (FQN). The FQN is the concatenation of the test module, suite, and name.", + "enum": [ + "fqn", + "-fqn", + "first_flaked", + "-first_flaked", + "last_flaked", + "-last_flaked", + "failure_rate", + "-failure_rate", + "pipelines_failed", + "-pipelines_failed", + "pipelines_duration_lost", + "-pipelines_duration_lost" + ], + "type": "string", + "x-enum-varnames": [ + "FQN_ASCENDING", + "FQN_DESCENDING", + "FIRST_FLAKED_ASCENDING", + "FIRST_FLAKED_DESCENDING", + "LAST_FLAKED_ASCENDING", + "LAST_FLAKED_DESCENDING", + "FAILURE_RATE_ASCENDING", + "FAILURE_RATE_DESCENDING", + "PIPELINES_FAILED_ASCENDING", + "PIPELINES_FAILED_DESCENDING", + "PIPELINES_DURATION_LOST_ASCENDING", + "PIPELINES_DURATION_LOST_DESCENDING" + ] + } + }, + "type": "object" + }, + "type": { + "description": "The definition of `FlakyTestsSearchRequestDataType` object.", + "enum": [ + "search_flaky_tests_request" + ], + "type": "string", + "x-enum-varnames": [ + "SEARCH_FLAKY_TESTS_REQUEST" + ] + } + }, + "type": "object" + } + }, + "type": "object" + }, + "FlakyTestsSearchRequestAttributes": { + "description": "Attributes for the flaky tests search request.", + "properties": { + "filter": { + "description": "Search filter settings.", + "properties": { + "query": { + "default": "*", + "description": "Search query following log syntax used to filter flaky tests, same as on Flaky Tests Management UI. The supported search keys are:\n- flaky_test_state\n- flaky_test_category\n- @test.name\n- @test.suite\n- @test.module\n- @test.service\n- @git.repository.id_v2\n- @git.branch\n- @test.codeowners\n- env\n", + "type": "string" + } + }, + "type": "object" + }, + "page": { + "description": "Pagination attributes for listing flaky tests.", + "properties": { + "cursor": { + "description": "List following results with a cursor provided in the previous request.", + "type": "string" + }, + "limit": { + "default": 10, + "description": "Maximum number of flaky tests in the response.", + "format": "int64", + "maximum": 1000, + "minimum": 1, + "type": "integer" + } + }, + "type": "object" + }, + "sort": { + "description": "Parameter for sorting flaky test results. The default sort is by ascending Fully Qualified Name (FQN). The FQN is the concatenation of the test module, suite, and name.", + "enum": [ + "fqn", + "-fqn", + "first_flaked", + "-first_flaked", + "last_flaked", + "-last_flaked", + "failure_rate", + "-failure_rate", + "pipelines_failed", + "-pipelines_failed", + "pipelines_duration_lost", + "-pipelines_duration_lost" + ], + "type": "string", + "x-enum-varnames": [ + "FQN_ASCENDING", + "FQN_DESCENDING", + "FIRST_FLAKED_ASCENDING", + "FIRST_FLAKED_DESCENDING", + "LAST_FLAKED_ASCENDING", + "LAST_FLAKED_DESCENDING", + "FAILURE_RATE_ASCENDING", + "FAILURE_RATE_DESCENDING", + "PIPELINES_FAILED_ASCENDING", + "PIPELINES_FAILED_DESCENDING", + "PIPELINES_DURATION_LOST_ASCENDING", + "PIPELINES_DURATION_LOST_DESCENDING" + ] + } + }, + "type": "object" + }, + "FlakyTestsSearchRequestData": { + "description": "The JSON:API data for flaky tests search request.", + "properties": { + "attributes": { + "description": "Attributes for the flaky tests search request.", + "properties": { + "filter": { + "description": "Search filter settings.", + "properties": { + "query": { + "default": "*", + "description": "Search query following log syntax used to filter flaky tests, same as on Flaky Tests Management UI. The supported search keys are:\n- flaky_test_state\n- flaky_test_category\n- @test.name\n- @test.suite\n- @test.module\n- @test.service\n- @git.repository.id_v2\n- @git.branch\n- @test.codeowners\n- env\n", + "type": "string" + } + }, + "type": "object" + }, + "page": { + "description": "Pagination attributes for listing flaky tests.", + "properties": { + "cursor": { + "description": "List following results with a cursor provided in the previous request.", + "type": "string" + }, + "limit": { + "default": 10, + "description": "Maximum number of flaky tests in the response.", + "format": "int64", + "maximum": 1000, + "minimum": 1, + "type": "integer" + } + }, + "type": "object" + }, + "sort": { + "description": "Parameter for sorting flaky test results. The default sort is by ascending Fully Qualified Name (FQN). The FQN is the concatenation of the test module, suite, and name.", + "enum": [ + "fqn", + "-fqn", + "first_flaked", + "-first_flaked", + "last_flaked", + "-last_flaked", + "failure_rate", + "-failure_rate", + "pipelines_failed", + "-pipelines_failed", + "pipelines_duration_lost", + "-pipelines_duration_lost" + ], + "type": "string", + "x-enum-varnames": [ + "FQN_ASCENDING", + "FQN_DESCENDING", + "FIRST_FLAKED_ASCENDING", + "FIRST_FLAKED_DESCENDING", + "LAST_FLAKED_ASCENDING", + "LAST_FLAKED_DESCENDING", + "FAILURE_RATE_ASCENDING", + "FAILURE_RATE_DESCENDING", + "PIPELINES_FAILED_ASCENDING", + "PIPELINES_FAILED_DESCENDING", + "PIPELINES_DURATION_LOST_ASCENDING", + "PIPELINES_DURATION_LOST_DESCENDING" + ] + } + }, + "type": "object" + }, + "type": { + "description": "The definition of `FlakyTestsSearchRequestDataType` object.", + "enum": [ + "search_flaky_tests_request" + ], + "type": "string", + "x-enum-varnames": [ + "SEARCH_FLAKY_TESTS_REQUEST" + ] + } + }, + "type": "object" + }, + "FlakyTestsSearchRequestDataType": { + "description": "The definition of `FlakyTestsSearchRequestDataType` object.", + "enum": [ + "search_flaky_tests_request" + ], + "type": "string", + "x-enum-varnames": [ + "SEARCH_FLAKY_TESTS_REQUEST" + ] + }, + "FlakyTestsSearchResponse": { + "description": "Response object with flaky tests matching the search request.", + "properties": { + "data": { + "description": "Array of flaky tests matching the request.", + "items": { + "description": "A flaky test object.", + "properties": { + "attributes": { + "description": "Attributes of a flaky test.", + "properties": { + "attempt_to_fix_id": { + "description": "Unique identifier for the attempt to fix this flaky test. Use this ID in the Git commit message in order to trigger the attempt to fix workflow.\n\nWhen the workflow is triggered the test is automatically retried by the tracer a certain number of configurable times. When all retries pass, the test is automatically marked as fixed in Flaky Test Management.\nTest runs are tagged with `@test.test_management.attempt_to_fix_passed` and `@test.test_management.is_attempt_to_fix` when the attempt to fix workflow is triggered.", + "type": "string" + }, + "codeowners": { + "description": "The name of the test's code owners as inferred from the repository configuration.", + "items": { + "type": "string" + }, + "type": "array" + }, + "envs": { + "description": "List of environments where this test has been flaky.", + "items": { + "type": "string" + }, + "type": "array" + }, + "first_flaked_branch": { + "description": "The branch name where the test exhibited flakiness for the first time.", + "type": "string" + }, + "first_flaked_sha": { + "description": "The commit SHA where the test exhibited flakiness for the first time.", + "type": "string" + }, + "first_flaked_ts": { + "description": "Unix timestamp when the test exhibited flakiness for the first time.", + "format": "int64", + "type": "integer" + }, + "flaky_category": { + "description": "The category of a flaky test.", + "nullable": true, + "type": "string" + }, + "flaky_state": { + "description": "The current state of the flaky test.", + "enum": [ + "active", + "fixed", + "quarantined", + "disabled" + ], + "type": "string", + "x-enum-varnames": [ + "ACTIVE", + "FIXED", + "QUARANTINED", + "DISABLED" + ] + }, + "last_flaked_branch": { + "description": "The branch name where the test exhibited flakiness for the last time.", + "type": "string" + }, + "last_flaked_sha": { + "description": "The commit SHA where the test exhibited flakiness for the last time.", + "type": "string" + }, + "last_flaked_ts": { + "description": "Unix timestamp when the test exhibited flakiness for the last time.", + "format": "int64", + "type": "integer" + }, + "module": { + "description": "The name of the test module. The definition of module changes slightly per language:\n- In .NET, a test module groups every test that is run under the same unit test project.\n- In Swift, a test module groups every test that is run for a given bundle.\n- In JavaScript, the test modules map one-to-one to test sessions.\n- In Java, a test module groups every test that is run by the same Maven Surefire/Failsafe or Gradle Test task execution.\n- In Python, a test module groups every test that is run under the same `.py` file as part of a test suite, which is typically managed by a framework like `unittest` or `pytest`.\n- In Ruby, a test module groups every test that is run within the same test file, which is typically managed by a framework like `RSpec` or `Minitest`.", + "nullable": true, + "type": "string" + }, + "name": { + "description": "The test name. A concise name for a test case. Defined in the test itself.", + "type": "string" + }, + "pipeline_stats": { + "nullable": true, + "description": "CI pipeline related statistics for the flaky test. This information is only available if test runs are associated with CI pipeline events from CI Visibility.", + "properties": { + "failed_pipelines": { + "description": "The number of pipelines that failed due to this test for the past 7 days. This is computed as the sum of failed CI pipeline events associated with test runs where the flaky test failed.", + "format": "int64", + "nullable": true, + "type": "integer" + }, + "total_lost_time_ms": { + "description": "The total time lost by CI pipelines due to this flaky test in milliseconds This is computed as the sum of the duration of failed CI pipeline events associated with test runs where the flaky test failed.", + "format": "int64", + "nullable": true, + "type": "integer" + } + }, + "type": "object" + }, + "services": { + "description": "List of test services names where this test has been flaky.\n\nA test service is a group of tests associated with a project or repository. It contains all the individual tests for your code, optionally organized into test suites, which are like folders for your tests.", + "items": { + "type": "string" + }, + "type": "array" + }, + "suite": { + "description": "The name of the test suite. A group of tests exercising the same unit of code depending on your language and testing framework.", + "type": "string" + }, + "test_run_metadata": { + "description": "Metadata about the latest failed test run of the flaky test", + "properties": { + "duration_ms": { + "description": "The duration of the test run in milliseconds.", + "format": "int64", + "nullable": true, + "type": "integer" + }, + "error_message": { + "description": "The error message from the test failure.", + "nullable": true, + "type": "string" + }, + "error_stack": { + "description": "The stack trace from the test failure.", + "nullable": true, + "type": "string" + }, + "source_end": { + "description": "The line number where the test ends in the source file.", + "format": "int64", + "nullable": true, + "type": "integer" + }, + "source_file": { + "description": "The source file where the test is defined.", + "nullable": true, + "type": "string" + }, + "source_start": { + "description": "The line number where the test starts in the source file.", + "format": "int64", + "nullable": true, + "type": "integer" + } + }, + "type": "object" + }, + "test_stats": { + "description": "Test statistics for the flaky test.", + "properties": { + "failure_rate_pct": { + "description": "The failure rate percentage of the test for the past 7 days. This is the number of failed test runs divided by the total number of test runs (excluding skipped test runs).", + "format": "double", + "nullable": true, + "type": "number" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "id": { + "description": "Test's ID. This ID is the hash of the test's Fully Qualified Name and Git repository ID. On Test Runs UI it is the same as the `test_fingerprint_fqn` tag.", + "type": "string" + }, + "type": { + "description": "The type of the flaky test from Flaky Test Management.", + "enum": [ + "flaky_test" + ], + "type": "string", + "x-enum-varnames": [ + "FLAKY_TEST" + ] + } + }, + "type": "object" + }, + "type": "array" + }, + "meta": { + "description": "Metadata for the flaky tests search response.", + "properties": { + "pagination": { + "description": "Pagination metadata for flaky tests.", + "properties": { + "next_page": { + "description": "Cursor for the next page of results.", + "nullable": true, + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "FlakyTestsSearchResponseMeta": { + "description": "Metadata for the flaky tests search response.", + "properties": { + "pagination": { + "description": "Pagination metadata for flaky tests.", + "properties": { + "next_page": { + "description": "Cursor for the next page of results.", + "nullable": true, + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "FlakyTestsSearchSort": { + "description": "Parameter for sorting flaky test results. The default sort is by ascending Fully Qualified Name (FQN). The FQN is the concatenation of the test module, suite, and name.", + "enum": [ + "fqn", + "-fqn", + "first_flaked", + "-first_flaked", + "last_flaked", + "-last_flaked", + "failure_rate", + "-failure_rate", + "pipelines_failed", + "-pipelines_failed", + "pipelines_duration_lost", + "-pipelines_duration_lost" + ], + "type": "string", + "x-enum-varnames": [ + "FQN_ASCENDING", + "FQN_DESCENDING", + "FIRST_FLAKED_ASCENDING", + "FIRST_FLAKED_DESCENDING", + "LAST_FLAKED_ASCENDING", + "LAST_FLAKED_DESCENDING", + "FAILURE_RATE_ASCENDING", + "FAILURE_RATE_DESCENDING", + "PIPELINES_FAILED_ASCENDING", + "PIPELINES_FAILED_DESCENDING", + "PIPELINES_DURATION_LOST_ASCENDING", + "PIPELINES_DURATION_LOST_DESCENDING" + ] + }, "FormulaLimit": { "description": "Message for specifying limits to the number of values returned by a query.\nThis limit is only for scalar queries and has no effect on timeseries queries.", "properties": { @@ -669801,37 +670784,467 @@ } } }, - "description": "Bad Request" + "description": "Bad Request" + }, + "401": { + "content": { + "application/json": { + "schema": { + "description": "API error response.", + "properties": { + "errors": { + "description": "A list of errors.", + "example": [ + "Bad Request" + ], + "items": { + "description": "A list of items.", + "example": "Bad Request", + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "errors" + ], + "type": "object" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "description": "API error response.", + "properties": { + "errors": { + "description": "A list of errors.", + "example": [ + "Bad Request" + ], + "items": { + "description": "A list of items.", + "example": "Bad Request", + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "errors" + ], + "type": "object" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "description": "API error response.", + "properties": { + "errors": { + "description": "A list of errors.", + "example": [ + "Bad Request" + ], + "items": { + "description": "A list of items.", + "example": "Bad Request", + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "errors" + ], + "type": "object" + } + } + }, + "description": "Not Found" + }, + "429": { + "content": { + "application/json": { + "schema": { + "description": "API error response.", + "properties": { + "errors": { + "description": "A list of errors.", + "example": [ + "Bad Request" + ], + "items": { + "description": "A list of items.", + "example": "Bad Request", + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "errors" + ], + "type": "object" + } + } + }, + "description": "Too many requests" + } + }, + "security": [ + { + "apiKeyAuth": [], + "appKeyAuth": [] }, - "401": { + { + "AuthZ": [ + "incident_settings_write" + ] + } + ], + "summary": "Update an existing incident team", + "tags": [ + "Incident Teams" + ], + "x-codegen-request-body-name": "body", + "x-menu-order": 3, + "x-permission": { + "operator": "OR", + "permissions": [ + "incident_settings_write" + ] + }, + "x-undo": { + "type": "idempotent" + }, + "x-unstable": "**Note**: This endpoint is deprecated. See the [Teams API endpoints](https://docs.datadoghq.com/api/latest/teams/)." + } + }, + "/api/v2/test/flaky-test-management/tests": { + "post": { + "description": "List endpoint returning flaky tests from Flaky Test Management. Results are paginated.", + "operationId": "SearchFlakyTests", + "requestBody": { + "content": { + "application/json": { + "schema": { + "description": "The request for a flaky tests search.", + "properties": { + "data": { + "description": "The JSON:API data for flaky tests search request.", + "properties": { + "attributes": { + "description": "Attributes for the flaky tests search request.", + "properties": { + "filter": { + "description": "Search filter settings.", + "properties": { + "query": { + "default": "*", + "description": "Search query following log syntax used to filter flaky tests, same as on Flaky Tests Management UI. The supported search keys are:\n- flaky_test_state\n- flaky_test_category\n- @test.name\n- @test.suite\n- @test.module\n- @test.service\n- @git.repository.id_v2\n- @git.branch\n- @test.codeowners\n- env\n", + "type": "string" + } + }, + "type": "object" + }, + "page": { + "description": "Pagination attributes for listing flaky tests.", + "properties": { + "cursor": { + "description": "List following results with a cursor provided in the previous request.", + "type": "string" + }, + "limit": { + "default": 10, + "description": "Maximum number of flaky tests in the response.", + "format": "int64", + "maximum": 1000, + "minimum": 1, + "type": "integer" + } + }, + "type": "object" + }, + "sort": { + "description": "Parameter for sorting flaky test results. The default sort is by ascending Fully Qualified Name (FQN). The FQN is the concatenation of the test module, suite, and name.", + "enum": [ + "fqn", + "-fqn", + "first_flaked", + "-first_flaked", + "last_flaked", + "-last_flaked", + "failure_rate", + "-failure_rate", + "pipelines_failed", + "-pipelines_failed", + "pipelines_duration_lost", + "-pipelines_duration_lost" + ], + "type": "string", + "x-enum-varnames": [ + "FQN_ASCENDING", + "FQN_DESCENDING", + "FIRST_FLAKED_ASCENDING", + "FIRST_FLAKED_DESCENDING", + "LAST_FLAKED_ASCENDING", + "LAST_FLAKED_DESCENDING", + "FAILURE_RATE_ASCENDING", + "FAILURE_RATE_DESCENDING", + "PIPELINES_FAILED_ASCENDING", + "PIPELINES_FAILED_DESCENDING", + "PIPELINES_DURATION_LOST_ASCENDING", + "PIPELINES_DURATION_LOST_DESCENDING" + ] + } + }, + "type": "object" + }, + "type": { + "description": "The definition of `FlakyTestsSearchRequestDataType` object.", + "enum": [ + "search_flaky_tests_request" + ], + "type": "string", + "x-enum-varnames": [ + "SEARCH_FLAKY_TESTS_REQUEST" + ] + } + }, + "type": "object" + } + }, + "type": "object" + } + } + }, + "required": false + }, + "responses": { + "200": { "content": { "application/json": { "schema": { - "description": "API error response.", + "description": "Response object with flaky tests matching the search request.", "properties": { - "errors": { - "description": "A list of errors.", - "example": [ - "Bad Request" - ], + "data": { + "description": "Array of flaky tests matching the request.", "items": { - "description": "A list of items.", - "example": "Bad Request", - "type": "string" + "description": "A flaky test object.", + "properties": { + "attributes": { + "description": "Attributes of a flaky test.", + "properties": { + "attempt_to_fix_id": { + "description": "Unique identifier for the attempt to fix this flaky test. Use this ID in the Git commit message in order to trigger the attempt to fix workflow.\n\nWhen the workflow is triggered the test is automatically retried by the tracer a certain number of configurable times. When all retries pass, the test is automatically marked as fixed in Flaky Test Management.\nTest runs are tagged with `@test.test_management.attempt_to_fix_passed` and `@test.test_management.is_attempt_to_fix` when the attempt to fix workflow is triggered.", + "type": "string" + }, + "codeowners": { + "description": "The name of the test's code owners as inferred from the repository configuration.", + "items": { + "type": "string" + }, + "type": "array" + }, + "envs": { + "description": "List of environments where this test has been flaky.", + "items": { + "type": "string" + }, + "type": "array" + }, + "first_flaked_branch": { + "description": "The branch name where the test exhibited flakiness for the first time.", + "type": "string" + }, + "first_flaked_sha": { + "description": "The commit SHA where the test exhibited flakiness for the first time.", + "type": "string" + }, + "first_flaked_ts": { + "description": "Unix timestamp when the test exhibited flakiness for the first time.", + "format": "int64", + "type": "integer" + }, + "flaky_category": { + "description": "The category of a flaky test.", + "nullable": true, + "type": "string" + }, + "flaky_state": { + "description": "The current state of the flaky test.", + "enum": [ + "active", + "fixed", + "quarantined", + "disabled" + ], + "type": "string", + "x-enum-varnames": [ + "ACTIVE", + "FIXED", + "QUARANTINED", + "DISABLED" + ] + }, + "last_flaked_branch": { + "description": "The branch name where the test exhibited flakiness for the last time.", + "type": "string" + }, + "last_flaked_sha": { + "description": "The commit SHA where the test exhibited flakiness for the last time.", + "type": "string" + }, + "last_flaked_ts": { + "description": "Unix timestamp when the test exhibited flakiness for the last time.", + "format": "int64", + "type": "integer" + }, + "module": { + "description": "The name of the test module. The definition of module changes slightly per language:\n- In .NET, a test module groups every test that is run under the same unit test project.\n- In Swift, a test module groups every test that is run for a given bundle.\n- In JavaScript, the test modules map one-to-one to test sessions.\n- In Java, a test module groups every test that is run by the same Maven Surefire/Failsafe or Gradle Test task execution.\n- In Python, a test module groups every test that is run under the same `.py` file as part of a test suite, which is typically managed by a framework like `unittest` or `pytest`.\n- In Ruby, a test module groups every test that is run within the same test file, which is typically managed by a framework like `RSpec` or `Minitest`.", + "nullable": true, + "type": "string" + }, + "name": { + "description": "The test name. A concise name for a test case. Defined in the test itself.", + "type": "string" + }, + "pipeline_stats": { + "nullable": true, + "description": "CI pipeline related statistics for the flaky test. This information is only available if test runs are associated with CI pipeline events from CI Visibility.", + "properties": { + "failed_pipelines": { + "description": "The number of pipelines that failed due to this test for the past 7 days. This is computed as the sum of failed CI pipeline events associated with test runs where the flaky test failed.", + "format": "int64", + "nullable": true, + "type": "integer" + }, + "total_lost_time_ms": { + "description": "The total time lost by CI pipelines due to this flaky test in milliseconds This is computed as the sum of the duration of failed CI pipeline events associated with test runs where the flaky test failed.", + "format": "int64", + "nullable": true, + "type": "integer" + } + }, + "type": "object" + }, + "services": { + "description": "List of test services names where this test has been flaky.\n\nA test service is a group of tests associated with a project or repository. It contains all the individual tests for your code, optionally organized into test suites, which are like folders for your tests.", + "items": { + "type": "string" + }, + "type": "array" + }, + "suite": { + "description": "The name of the test suite. A group of tests exercising the same unit of code depending on your language and testing framework.", + "type": "string" + }, + "test_run_metadata": { + "description": "Metadata about the latest failed test run of the flaky test", + "properties": { + "duration_ms": { + "description": "The duration of the test run in milliseconds.", + "format": "int64", + "nullable": true, + "type": "integer" + }, + "error_message": { + "description": "The error message from the test failure.", + "nullable": true, + "type": "string" + }, + "error_stack": { + "description": "The stack trace from the test failure.", + "nullable": true, + "type": "string" + }, + "source_end": { + "description": "The line number where the test ends in the source file.", + "format": "int64", + "nullable": true, + "type": "integer" + }, + "source_file": { + "description": "The source file where the test is defined.", + "nullable": true, + "type": "string" + }, + "source_start": { + "description": "The line number where the test starts in the source file.", + "format": "int64", + "nullable": true, + "type": "integer" + } + }, + "type": "object" + }, + "test_stats": { + "description": "Test statistics for the flaky test.", + "properties": { + "failure_rate_pct": { + "description": "The failure rate percentage of the test for the past 7 days. This is the number of failed test runs divided by the total number of test runs (excluding skipped test runs).", + "format": "double", + "nullable": true, + "type": "number" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "id": { + "description": "Test's ID. This ID is the hash of the test's Fully Qualified Name and Git repository ID. On Test Runs UI it is the same as the `test_fingerprint_fqn` tag.", + "type": "string" + }, + "type": { + "description": "The type of the flaky test from Flaky Test Management.", + "enum": [ + "flaky_test" + ], + "type": "string", + "x-enum-varnames": [ + "FLAKY_TEST" + ] + } + }, + "type": "object" }, "type": "array" + }, + "meta": { + "description": "Metadata for the flaky tests search response.", + "properties": { + "pagination": { + "description": "Pagination metadata for flaky tests.", + "properties": { + "next_page": { + "description": "Cursor for the next page of results.", + "nullable": true, + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" } }, - "required": [ - "errors" - ], "type": "object" } } }, - "description": "Unauthorized" + "description": "OK" }, - "403": { + "400": { "content": { "application/json": { "schema": { @@ -669857,9 +671270,9 @@ } } }, - "description": "Forbidden" + "description": "Bad Request" }, - "404": { + "403": { "content": { "application/json": { "schema": { @@ -669885,7 +671298,7 @@ } } }, - "description": "Not Found" + "description": "Not Authorized" }, "429": { "content": { @@ -669923,26 +671336,26 @@ }, { "AuthZ": [ - "incident_settings_write" + "test_optimization_read" ] } ], - "summary": "Update an existing incident team", + "summary": "Search flaky tests", "tags": [ - "Incident Teams" + "Test Optimization" ], "x-codegen-request-body-name": "body", - "x-menu-order": 3, + "x-menu-order": 1, "x-permission": { "operator": "OR", "permissions": [ - "incident_settings_write" + "test_optimization_read" ] }, "x-undo": { - "type": "idempotent" + "type": "safe" }, - "x-unstable": "**Note**: This endpoint is deprecated. See the [Teams API endpoints](https://docs.datadoghq.com/api/latest/teams/)." + "x-unstable": "**Note**: This endpoint is in public beta and may be subject to change.\nIf you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/)." } }, "/api/v2/usage/application_security": { @@ -686020,6 +687433,10 @@ "description": "View and manage teams within Datadog. See the [Teams page](https://docs.datadoghq.com/account_management/teams/) for more information.", "name": "Teams" }, + { + "description": "Search and manage flaky tests through Test Optimization. See the [Test Optimization page](https://docs.datadoghq.com/tests/) for more information.", + "name": "Test Optimization" + }, { "description": "The usage metering API allows you to get hourly, daily, and\nmonthly usage across multiple facets of Datadog.\nThis API is available to all Pro and Enterprise customers.\n\n**Note**: Usage data is delayed by up to 72 hours from when it was incurred.\nIt is retained for 15 months.\n\nYou can retrieve up to 24 hours of hourly usage data for multiple organizations,\nand up to two months of hourly usage data for a single organization in one request.\nLearn more on the [usage details documentation](https://docs.datadoghq.com/account_management/billing/usage_details/).", "externalDocs": {