Skip to content

fix(just): remove test-devcontainer leftovers in clean-test-containers - #1818

Merged
c-vigo merged 2 commits into
devfrom
bugfix/1817-clean-test-containers
Oct 5, 2026
Merged

c-vigo merged 2 commits into
devfrom
bugfix/1817-clean-test-containers

Conversation

@c-vigo

@c-vigo c-vigo commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Description

just clean-test-containers only matched workspace-devcontainer* (the devcontainer fixtures). The image-test fixture test_container (tests/conftest.py) names its containers test-devcontainer-<epoch>, so a killed test_image.py run left containers the recipe never removed.

Type of Change

  • feat -- New feature
  • fix -- Bug fix
  • docs -- Documentation only
  • chore -- Maintenance task (deps, config, etc.)
  • refactor -- Code restructuring (no behavior change)
  • test -- Adding or updating tests
  • ci -- CI/CD pipeline changes
  • build -- Build system or dependency changes
  • revert -- Reverts a previous commit
  • style -- Code style (formatting, whitespace)

Modifiers

  • Breaking change (!) -- This change breaks backward compatibility

Changes Made

  • justfile (clean-test-containers): also collects podman ps -a --filter "name=^test-devcontainer-" and removes those containers, with its own progress line. The "[OK] / none found" summary covers both kinds.
  • tests/bats/just.bats: two behavioral tests run the real recipe against a podman stub that applies --filter name= as a regex:
    • test-devcontainer-* leftovers are removed, and unrelated containers are left alone.
    • workspace-devcontainer-* removal still works.

Changelog Entry

No changelog needed: devkit's own dev-tooling recipe (root justfile, not shipped to consumers).

Testing

  • Tests pass locally (just test)
  • Manual testing performed (describe below)

Manual Testing Details

  • TDD: the bats tests were committed RED first. The test-devcontainer case failed because no rm was issued, while the existing-behaviour case passed. They are GREEN after the fix, and the whole of just.bats passes.
  • Live: podman create --name test-devcontainer-0 … followed by just clean-test-containers removed the container, leaving 0 test-devcontainer-* containers.
  • just precommit (full suite): green.

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly (edit docs/templates/, then run just docs)
  • I have updated CHANGELOG.md in the [Unreleased] section (and pasted the entry above)
  • My changes generate no new warnings or errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Additional Notes

Out of scope, not changed: the pytest session-start check for leftover containers in tests/conftest.py (the pytest_sessionstart lingering-container check and its PYTEST_AUTO_CLEANUP path) also only checks workspace-devcontainer, so it never flags test-devcontainer-* leftovers either.

Refs: #1817

@c-vigo
c-vigo merged commit 6ee5d27 into dev Oct 5, 2026
16 checks passed
@c-vigo
c-vigo deleted the bugfix/1817-clean-test-containers branch October 5, 2026 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant