tests.test_ci_status moduleΒΆ

Tests for CI job triage.

tests.test_ci_status.job(name, conclusion='success', status='completed')[source]ΒΆ

Shorthand for a settled job.

tests.test_ci_status.run(*jobs, conclusion='success', status='completed')[source]ΒΆ

Shorthand for a run carrying jobs.

tests.test_ci_status.UNEXPANDED_MATRIX_JOB = "${{ matrix.state == 'stable' && 'βœ…' || '⁉️' }} ${{ matrix.os }} / py${{ matrix.python-label || matrix.python-version }}"ΒΆ

The name of a matrix job GitHub never expanded: its name: expression.

tests.test_ci_status.test_job_requirement_reads_the_glyph(name, required)[source]ΒΆ

Classification keys off the glyph, never a positional field.

tests.test_ci_status.test_a_job_name_template_reads_as_required()[source]ΒΆ

Every job name that picks its glyph from the matrix is required unexpanded.

GitHub shows the name: expression as written for a matrix it never expanded. Each of those templates holds both glyphs. One that held the unstable glyph alone would read as a probe, and hide the required cells that never ran.

tests.test_ci_status.test_a_matrix_never_expanded_is_required()[source]ΒΆ

A run stopped before its matrix got its cells left required cells undone.

One cancelled job stands for the whole matrix, and every other job passed. Reading that job as a probe makes the run green.

tests.test_ci_status.test_a_failed_matrix_never_expanded_blocks()[source]ΒΆ

A matrix that failed before it expanded is a required failure.

tests.test_ci_status.test_probe_failure_does_not_block()[source]ΒΆ

An allowed-failure cell is reported and never gates.

tests.test_ci_status.test_required_failure_blocks()[source]ΒΆ

A red required cell holds up the merge.

tests.test_ci_status.test_a_probe_failure_inside_a_green_run_is_still_surfaced()[source]ΒΆ

continue-on-error folds a crash into a green run conclusion.

This is why the run’s own conclusion never answers β€œis anything broken”.

tests.test_ci_status.test_queued_run_status_does_not_hide_finished_jobs()[source]ΒΆ

A run reads queued while its jobs are already settling.

tests.test_ci_status.test_workflow_level_failure_has_no_failed_job()[source]ΒΆ

A run failing around its jobs is a workflow error, not a benign one.

tests.test_ci_status.test_a_normal_failure_is_not_read_as_workflow_level()[source]ΒΆ

With a failed job to point at, the run failed inside a job.

tests.test_ci_status.test_skipped_and_cancelled_jobs_are_not_failures()[source]ΒΆ

Only failure blocks: a skipped job is a gate that did not apply.

tests.test_ci_status.test_a_run_without_a_result_never_reads_green(jobs, conclusion, verdict, inconclusive)[source]ΒΆ

A run that was cancelled, or that ran no job, says nothing about its commit.

It is not a failure, so it never blocks. It is not a pass either: a green verdict there hides that the matrix never ran on the newest commits.

tests.test_ci_status.test_a_failure_outranks_a_cancellation()[source]ΒΆ

A cancelled run that already holds a red required job is a red run.

tests.test_ci_status.test_a_run_still_going_is_not_inconclusive_yet()[source]ΒΆ

Cancelled jobs beside running ones belong to a run that has not settled.

tests.test_ci_status.test_monitored_workflows_selects_push_triggered_files(tmp_path)[source]ΒΆ

Derived from the tree, so a new workflow is watched automatically.

tests.test_ci_status.test_monitored_workflows_reads_the_yaml_boolean_on_key(tmp_path)[source]ΒΆ

A bare on: parses as the boolean True under YAML 1.1.

tests.test_ci_status.test_monitored_workflows_missing_directory(tmp_path)[source]ΒΆ

A repo with no workflows reports none rather than raising.

tests.test_ci_status.test_monitored_workflows_skips_unparsable_file(tmp_path)[source]ΒΆ

One malformed file never aborts the sweep.

tests.test_ci_status.test_latest_run_reads_jobs()[source]ΒΆ

The run and its jobs come back as one object.

tests.test_ci_status.test_latest_run_with_no_run()[source]ΒΆ

An empty listing is not an error: GitHub may not have materialized one.

tests.test_ci_status.test_an_unreadable_run_fails_rather_than_reading_green()[source]ΒΆ

A payload that is not a run raises instead of producing a jobless run.

tests.test_ci_status.test_read_ci_status_skips_workflows_without_a_run()[source]ΒΆ

A workflow with no run drops out rather than reporting a fake green.

tests.test_ci_status.test_read_ci_status_anchors_on_the_tip()[source]ΒΆ

Every workflow that ran on the tip is read there, and the walk stops.

tests.test_ci_status.test_read_ci_status_walks_back_to_a_path_filtered_workflow()[source]ΒΆ

A workflow the tip skipped is read on the commit that last started it.

tests.test_ci_status.test_read_ci_status_walks_back_from_a_run_that_ran_no_job()[source]ΒΆ

A workflow that skipped every job on the tip is read where it last ran.

The tip is a version-bump commit: tests.yaml skips it, and its push cancelled the run of the commit under it. The skipped run reads as a finished one with no failure, which hides that the matrix never ran on the change.

tests.test_ci_status.test_read_ci_status_stops_at_a_cancelled_run()[source]ΒΆ

A cancelled run is the newest word on its workflow, whatever ran before.

The green run of the parent is older than the commit left without a result: reporting it would read as a pass on a tree it never saw.

tests.test_ci_status.test_read_ci_status_reports_a_workflow_that_only_skipped()[source]ΒΆ

With nothing but skipped runs in the window, the newest one is reported.

Its own verdict says the tip has no result, so the tip note leaves it out.

tests.test_ci_status.test_read_ci_status_prefers_a_run_with_a_result_on_the_same_commit(with_result, skipped)[source]ΒΆ

Of two runs on one commit, the one that ran a job is read, newer or not.

The usual case is a run dispatched on a commit whose push run skipped every job. The other order is a later event that no job of the workflow answers.

tests.test_ci_status.test_read_ci_status_ignores_a_stale_branch_listing()[source]ΒΆ

A months-old snapshot from the branch listing never reaches the report.

The listing below claims the latest tests.yaml run failed on an old commit, while the tip’s own run is green. A reader trusting the listing reports the old red.

tests.test_ci_status.test_read_ci_status_falls_back_past_the_window()[source]ΒΆ

A workflow with no run on the newest commits asks its dated run listing.

tests.test_ci_status.test_runs_on_tip_is_empty_before_the_tip_runs()[source]ΒΆ

Right after a push, every run read belongs to an earlier commit.

tests.test_ci_status.test_ci_status_command_reports_a_run_without_a_result()[source]ΒΆ

The command says which commit has no result, and still exits clean.

Nothing failed, so nothing is fatal: the report is what tells a cancelled or skipped run from a green one.

tests.test_ci_status.test_workflow_files_keeps_everything_with_runs_of_its_own(tmp_path)[source]ΒΆ

Every trigger counts except workflow_call, which creates no run.

monitored_workflows answers β€œwhat does a push start”, which is a narrower question than β€œwhat may I name”: a schedule-only workflow has runs worth reading, and a reusable one never does.

tests.test_ci_status.test_workflow_files_missing_directory(tmp_path)[source]ΒΆ

A repository with no workflow directory offers no workflow.