engineering_analytics
engineering_analytics

The active test-health queue: pytest and Jest tests worth acting on now, from the per-test CI spans, over a window (default -7d, maximum 30 days). Evidence is counted per CI run, never per span or run attempt. A test is a 'confirmed_flake' when one commit both failed and passed it (a 'Re-run failed jobs' attempt went green, or an in-job retry recovered it); 'quarantined' when a tolerated failure is recorded while it is masked; otherwise 'suspected_regression'. It qualifies on any same-commit recovery, any master/main failure, a quarantined failure, or failures on at least min_failed_prs distinct PRs. Counts are absolute, never rates: CI emits every failure but omits ordinary passing spans, so there is no execution denominator. 'suspected_regression' means no recovery was recorded in this data, not that the test never flakes.

get/api/projects/{project_id}/engineering_analytics/flaky_tests/

Request

  • Base URL: https://us.posthog.com
  • URL: https://us.posthog.com/api/projects/{project_id}/engineering_analytics/flaky_tests/
  • Auth: HTTP bearer

Path parameters

project_idstring required

Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.

Query parameters

date_fromstring

Window start: relative ('-7d', '-30d') or ISO8601. Defaults to -7d; the window may span at most 30 days.

date_tostring

Window end: relative or ISO8601. Defaults to now.

limitinteger

Maximum number of tests to return (1-200). Defaults to 50.

min_failed_prsinteger

A test with no recorded recovery qualifies once it failed on at least this many distinct pull requests in the window. Minimum 1. Defaults to 3.

repostring

'owner/name' repository to scope to when the selected source syncs several repositories (from the sources list). Defaults to the source's first repository.

runner'jest' | 'pytest'

Optional test runner to return: 'pytest' or 'jest'.

source_idstring uuid

Connected GitHub data warehouse source to read from. Defaults to the oldest connected GitHub source when the team has more than one.

Response

truncatedboolean required

True when more tests qualified than the cap; items is the highest-ranked limit rows.

limitinteger required

Maximum number of tests returned in items.

Changes

No recorded changes to this operation across all 1 revision of this API.