Skip to content

Cover installed and failure paths for the linux-lab Multipass profile #2051

Description

@codeforester

Goal

Cover the installed, real-install, and diagnostic failure paths for the linux-lab Multipass prerequisite profile.

Background

A fresh branch-aware coverage run on current main (685d538) reports cli/python/base_dev/linux_lab.py at 55.17% statement coverage, 35.71% branch coverage, and 51.39% combined coverage, making it one of the least-exercised production modules.

The existing four tests prove missing-Multipass reporting, macOS dry-run output, non-macOS setup rejection, and the Doctor finding ID. They do not execute the already-installed path, the real Homebrew installation path, or any result from multipass version. As a result, the normal success path and timeout/non-zero diagnostic branches can regress while the repository aggregate remains green.

Scope

  • Add direct tests for an already-installed Multipass executable and successful version parsing.
  • Cover multipass version timeout, non-zero exit with stderr/stdout detail, and success when version output is on stdout or stderr.
  • Cover non-dry-run macOS setup when Homebrew is missing, when the Homebrew install succeeds, and when the delegated install raises ArtifactError.
  • Assert stable exit codes, finding ID BASE-D108, fix guidance, and user-facing messages.
  • Mock executable lookup, subprocesses, and Homebrew delegation; do not install Multipass or create VMs.

Acceptance Criteria

  • check_multipass() has direct missing, timeout, non-zero, and success coverage.
  • setup_linux_lab() has direct already-installed, dry-run, unsupported-host, missing-Homebrew, successful-install, and failed-install coverage.
  • Tests verify stdout/stderr behavior, exit codes, BASE-D108, and actionable fix text.
  • linux_lab.py reaches at least 85% statement and 75% branch coverage.
  • The full Python coverage gate and supported Base test suite pass.

Validation

BASE_CLI_SOURCE_DIR=../base-cli/lib/python \
PYTHONPATH=../base-cli/lib/python:lib/python:cli/python \
python -m pytest cli/python/base_dev/tests/test_linux_lab.py -q

BASE_CLI_SOURCE_DIR=../base-cli/lib/python \
PYTHONPATH=../base-cli/lib/python:lib/python:cli/python \
python -m pytest --cov=cli/python --cov-report=term-missing --cov-report=json:coverage.json
python -m tests.coverage_gate coverage.json

BASE_BASH_LIBS_DIR=../base-bash-libs/lib/bash \
BASE_CLI_SOURCE_DIR=../base-cli/lib/python \
env -u BASE_HOME ./bin/base-test

Non-Goals

  • Creating, starting, or deleting Multipass VM instances.
  • Running a real Homebrew installation in tests.
  • Changing the macOS-only setup policy or public linux-lab behavior.

Project Fields

  • Status: Ready
  • Priority: P3
  • Area: Setup
  • Initiative: Adoption Polish
  • Size: S

Agent Assignment

Copilot candidate after triage. The missing cases are isolated and mockable, with no architecture or product-policy decision required.

Metadata

Metadata

Assignees

Labels

ciContinuous integration, tests, automation, or release workflowsgood first issueGood for newcomers

Type

No type

Projects

  • Status
    Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions