Skip to content

fix(ci): the tests of each Feature take more than 6 minutes #44

Done

Description

@dan-petty

Problem

A pull request that runs the tests of each Feature takes more than 6 minutes on average. The target of a CI check is 5 minutes, with a tolerance of 1 minute. The job test-scenarios of .github/workflows/test-pr.yaml runs all scenarios of a Feature in one step, one after the other. Its longest leg sets the time of the run.

Evidence

Runs of test-pr.yaml that tested the two Features. The run time is from the first job start to the last job end.

Run Date Run time Longest job (a test-scenarios leg)
45090000034 2026-11-23 460 s 419 s
45091013216 2026-11-23 452 s 445 s
45091808946 2026-11-23 500 s 430 s
46477632652 2026-11-30 355 s 339 s
  • The mean run time is 442 s.
  • In these runs, a test-scenarios leg takes 207 to 445 s. A test or podman-host leg takes 34 to 97 s.
  • With fix(ci): test each Feature when the test tooling changes #43, a change to the test tooling also runs the tests of each Feature. This includes a Renovate update of the Dev Containers CLI.

Expected

  • The mean run time of a run that tests each Feature is 6 minutes or less.
  • Each scenario still runs on each base image.

Existing tool

devcontainer features test of the Dev Containers CLI has the option --filter, which the job podman-host uses. A matrix of GitHub Actions can use it to divide the scenarios between jobs.

Source

Source: #43

Proposed design

Problem statement

A pull request that tests each Feature takes more than 6 minutes on average. The job test-scenarios runs all scenarios of a Feature in one step, and its longest leg sets the run time. The change divides the scenarios of each Feature between matrix legs with --filter of devcontainer features test. Each scenario still runs on each base image, and the mean run time falls to 6 minutes or less.

Acceptance criteria

Requirement: One leg for each scenario and base image

The test-scenarios job SHALL run each scenario of each selected Feature in its own matrix leg, once for each base image.

Scenario: A Feature with scenarios on three base images

  • WHEN a run of test-pr.yaml tests a Feature with test/<feature>/scenarios.json
  • THEN the run shows one test-scenarios (<feature>, <scenario>, <image>) leg for each scenario key and each base image, and each leg log shows a --filter <scenario> command.

Requirement: Scenario names from the manifest

The workflow SHALL get the scenario names from test/<feature>/scenarios.json, so a new scenario needs no edit to the workflow.

Scenario: A new scenario key

  • WHEN a pull request adds a scenario key to test/<feature>/scenarios.json
  • THEN the run shows a test-scenarios leg for the new scenario on debian:sid, debian:trixie and ubuntu:noble.

Requirement: No leg for a Feature without scenarios

The test-scenarios job MUST NOT fail when a selected Feature has no test/<feature>/scenarios.json.

Scenario: A Feature without a scenarios file

  • WHEN a run of test-pr.yaml selects a Feature with no test/<feature>/scenarios.json
  • THEN the run shows no test-scenarios leg for that Feature and the Feature tests check passes.

Requirement: The dockerCompat skip line in its leg

The leg that runs the with_docker_in_docker scenario SHALL fail when its log lacks the line (!) <feature>: dockerCompat is skipped.

Scenario: The skip line is absent

  • WHEN the leg for with_docker_in_docker of a Podman Feature ends and its log has no dockerCompat is skipped. line
  • THEN the leg log shows the grep of dockerCompat is skipped. and the leg fails.

Requirement: Run time under the target

Three runs of test-pr.yaml that test each Feature MUST have a mean run time of 360 s or less, and each test-scenarios leg MUST end within 300 s.

Scenario: A change to the test tooling

  • WHEN a pull request changes package.json, which selects every Feature, and three runs complete
  • THEN the mean of the three run times is 360 s or less and no test-scenarios leg is longer than 300 s.

Requirement: The workflow passes the lint check

The changed workflow SHALL pass the lint check of the repository.

Scenario: The lint check runs

  • WHEN uv run devops ci --check --only actionlint runs on the pull request
  • THEN the check reports no error for .github/workflows/test-pr.yaml.

Existing Tool Considered

No alternatives check has run. The Dev Containers CLI (devcontainer features test) has the option --filter, and the job podman-host uses it (.github/workflows/test-pr.yaml). The tool covers the selection of one scenario in a leg. It lacks a shard option, so the workflow must list the scenario keys and give each leg one scenario. The change adds no code of its own.

Key questions

  • How does the workflow divide the scenarios of a Feature between the matrix legs?: The job detect-changes lists the keys of test/<feature>/scenarios.json for each selected Feature. It writes one matrix entry for each key and base image. Each test-scenarios leg runs npx devcontainer features test --skip-autogenerated --skip-duplicated --filter <scenario>. (best practice) [sources: .github/workflows/test-pr.yaml, AGENTS.md]
    • Chosen: One leg for each scenario and base image. The longest leg runs one scenario. A new scenario key needs no edit to the workflow.
    • Rejected: A fixed number of shards for each Feature. A Feature with one scenario gets an empty leg. A shard with many scenarios stays long.
    • Rejected: Raise the timeout and the run time target. The owner set a target of 5 minutes with a tolerance of 1 minute. A raise needs the owner.
  • How does the workflow keep the dockerCompat skip-line check?: The leg that runs the with_docker_in_docker scenario keeps the grep step. The step reads only the log of that leg. (best practice) [sources: .github/workflows/test-pr.yaml]
    • Chosen: Keep the grep in the leg that runs the scenario. That leg writes the log that holds the line.
    • Rejected: Move the grep to a job after the matrix. The later job has no log of the leg.
  • What happens when a selected Feature has no test/<feature>/scenarios.json?: The matrix holds no leg for that Feature. The job test-scenarios is skipped, and feature-tests accepts the skip through allowed-skips. (best practice) [sources: .github/workflows/test-pr.yaml]
    • Chosen: Skip the job when no scenario exists. allowed-skips in feature-tests already accepts a skipped test-scenarios job.
    • Rejected: Add a fallback leg that runs the CLI with no filter. The fallback runs no scenario and adds a job that reports nothing.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    type/bug
    source/agent
    scope/ci
    status/new
    value/high
    effort/medium
    on Nov 30, 2026
  2. dan-petty commented on Nov 30, 2026

    @dan-petty
    OwnerAuthor
    • Priority: CI runs exceed the 5-minute target by 47% on average, making CI very slow.
    • Related: fix(ci): test each Feature when the test tooling changes #41, which asks for a different change. Both work on the Feature test pipeline in test-pr.yaml; #41 ensures tests trigger on tooling changes, the candidate makes those tests run faster.
  3. added
    priority/p0-critical
    on Nov 30, 2026
  4. devops-cli-service commented on Nov 30, 2026

    @devops-cli-service
    Contributor

    The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.

    Searches (8)

    Tools considered:

    Searches run:

    • devcontainers CLI features test command options, results: 5
    • devcontainer features test --filter option split scenarios GitHub Actions matrix, results: 5
    • devcontainers/cli features test filter sub-set scenario documentation, results: 5
    • GitHub Actions split test suite across parallel jobs matrix faster CI tool, results: 5
    • "devcontainer features test" CLI github, results: 5
    • devcontainers cli github repository, results: 5
    • devcontainer features test filter option parallel matrix example workflow, results: 5
    • devcontainers cli features test documentation filter, results: 5

    Sources:

  5. devops-cli-service commented on Nov 30, 2026

    @devops-cli-service
    Contributor

    Next step: the alternatives check records a verdict. See the section Proposed design of the body.

  6. added
    status/in-progress
    status/in-review
    and removed
    status/new
    status/in-progress
    on Nov 30, 2026
  7. removed
    status/in-review
    on Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mediumpriority/p0-criticalscope/cisource/agenttype/bugvalue/high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions