fix: CI test assertions for Rich line-wrapping and scope output#510
fix: CI test assertions for Rich line-wrapping and scope output#510danielmeppiel merged 1 commit intomainfrom
Conversation
- 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>
There was a problem hiding this comment.
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. |
| # 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 |
There was a problem hiding this comment.
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.
| 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" |
There was a problem hiding this comment.
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.
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)Console()defaults to 80-char width when no TTY is detected (CI runners)[x] D:\a\...\abs-pkg -- local packages are not supported at user scopeexceeds 80 chars, causing Rich to insert a word-wrap\nbetween "local" and "packages""local packages are not supported at user scope" in result.outputfails because the substring is split across lines"not supported at user scope"which won't be split by wrapping2. macOS ARM release validation failure (
test-dependency-integration.sh)apm deps listoutput from"No APM dependencies installed yet"to"No APM dependencies installed (Project scope)""yet"suffix"No APM dependencies installed"(common prefix) in all 4 script locationsChanges
tests/unit/test_install_command.py— 3 assertions shortened to tolerate Rich wrappingscripts/test-dependency-integration.sh— 2 grep patterns updatedscripts/windows/test-dependency-integration.ps1— 2 match patterns updated