Skip to content

fix: CI test assertions for Rich line-wrapping and scope output#510

Merged
danielmeppiel merged 1 commit intomainfrom
hotfix/v0.8.8-ci-fixes
Mar 31, 2026
Merged

fix: CI test assertions for Rich line-wrapping and scope output#510
danielmeppiel merged 1 commit intomainfrom
hotfix/v0.8.8-ci-fixes

Conversation

@danielmeppiel
Copy link
Copy Markdown
Collaborator

Hotfix: CI test assertions broken by v0.8.8 changes

Two CI failures on the v0.8.8 release pipeline need urgent fixes:

Root Cause Analysis

1. Windows unit test failure (test_global_rejects_absolute_local_path)

  • Rich Console() defaults to 80-char width when no TTY is detected (CI runners)
  • Windows temp paths are much longer than Linux/macOS (~60+ chars vs ~25)
  • The validation error message [x] D:\a\...\abs-pkg -- local packages are not supported at user scope exceeds 80 chars, causing Rich to insert a word-wrap \n between "local" and "packages"
  • The assertion "local packages are not supported at user scope" in result.output fails because the substring is split across lines
  • Fix: Shorten assertion to "not supported at user scope" which won't be split by wrapping

2. macOS ARM release validation failure (test-dependency-integration.sh)

  • PR feat: add --global / -g flag for scoped package installation #452 changed apm deps list output from "No APM dependencies installed yet" to "No APM dependencies installed (Project scope)"
  • Release validation scripts (bash + PowerShell) still grep for the old "yet" suffix
  • Fix: Match "No APM dependencies installed" (common prefix) in all 4 script locations

Changes

  • tests/unit/test_install_command.py — 3 assertions shortened to tolerate Rich wrapping
  • scripts/test-dependency-integration.sh — 2 grep patterns updated
  • scripts/windows/test-dependency-integration.ps1 — 2 match patterns updated

- Windows unit test: shorten assertion substring to tolerate Rich
  Console word-wrapping on long Windows temp paths
- Release validation scripts (bash + PowerShell): match 'No APM
  dependencies installed' instead of stale 'yet' suffix removed by #452

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 31, 2026 13:14
@danielmeppiel danielmeppiel merged commit 6d8cb6f into main Mar 31, 2026
12 checks passed
@danielmeppiel danielmeppiel deleted the hotfix/v0.8.8-ci-fixes branch March 31, 2026 13:15
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes CI test failures introduced by v0.8.8 output changes by making assertions and integration scripts tolerant to Rich line-wrapping and updated apm deps list messaging.

Changes:

  • Loosened unit test assertions for user-scope local path rejection to avoid failures from Rich wrapping on narrow consoles (notably Windows CI).
  • Updated bash and PowerShell dependency integration scripts to match the new apm deps list "no dependencies" output prefix.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
tests/unit/test_install_command.py Adjusts assertions to be less sensitive to line wrapping in console output.
scripts/test-dependency-integration.sh Updates grep patterns used by release validation to match the new deps output prefix.
scripts/windows/test-dependency-integration.ps1 Updates match patterns used by Windows release validation to match the new deps output prefix.

Comment on lines 820 to +823
# Should fail with clear message about local packages
assert "local packages are not supported at user scope" in result.output
# Use shorter substring to tolerate Rich word-wrapping on
# platforms with long temp paths (Windows).
assert "not supported at user scope" in result.output
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new assertion "not supported at user scope" is so broad that it can pass even if the wrong message is printed (e.g., install.py also emits "local paths are not supported at user scope", and other user-scope warnings may include the same substring). To keep the test specific while still tolerating Rich line-wrapping, consider matching the full sentence after normalizing whitespace (e.g., collapse newlines to spaces) or using a regex that allows \s+ between words.

Copilot uses AI. Check for mistakes.
Comment on lines +67 to 71
if echo "$deps_output" | grep -q "No APM dependencies installed"; then
log_success "Correctly shows no dependencies installed"
else
log_error "Expected 'No APM dependencies installed yet' message"
log_error "Expected 'No APM dependencies installed' message"
log_error "Got: $deps_output"
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This script contains non-ASCII characters (em dash in comments, and emoji symbols in log_* output). Repository guideline requires shell scripts to stay within printable ASCII to avoid Windows cp1252 encoding errors. Please replace the emoji/status glyphs with the ASCII bracket status symbols (e.g., [i], [+], [x]) and use a plain - instead of an em dash.

Copilot generated this review using guidance from repository custom instructions.
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.

2 participants