fix(test): patch sys.platform in cowork tests for Windows CI#989
Merged
sergio-sisternes-epam merged 1 commit intomainfrom Apr 27, 2026
Merged
fix(test): patch sys.platform in cowork tests for Windows CI#989sergio-sisternes-epam merged 1 commit intomainfrom
sergio-sisternes-epam merged 1 commit intomainfrom
Conversation
macOS auto-detection tests did not mock sys.platform, so on Windows CI
the code entered the win32 branch first and returned None without ever
reaching the CloudStorage glob logic. 5 tests failed; 2 more passed
for the wrong reason (win32 short-circuit returning None matched the
expected result).
Fix: every platform-specific test now patches
apm_cli.integration.copilot_cowork_paths.sys.platform to the intended
OS ("darwin" for macOS tests, "linux" for the Linux test).
Also normalise the path in set_copilot_cowork_skills_dir with
os.path.normpath to avoid mixed separators on Windows (forward slash
from tilde expansion vs backslash from os.path.join).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes Windows CI test failures introduced by the cowork target work by making platform-specific unit tests explicitly control sys.platform, and by normalizing a config path to avoid mixed path separators on Windows.
Changes:
- Patch
apm_cli.integration.copilot_cowork_paths.sys.platformin macOS/Linux cowork path resolution tests so the intended code paths run consistently on all CI runners. - Normalize
set_copilot_cowork_skills_dir()stored paths viaos.path.normpath(os.path.expanduser(...))to avoid mixed separators on Windows.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/unit/integration/test_copilot_cowork_paths.py | Ensures platform-dependent resolution tests force the intended OS branch (darwin/linux) rather than inheriting the CI runner’s platform. |
| src/apm_cli/config.py | Normalizes expanded cowork skills dir paths to keep Windows path separators consistent and stabilize related assertions. |
danielmeppiel
approved these changes
Apr 27, 2026
danielmeppiel
pushed a commit
that referenced
this pull request
Apr 27, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
danielmeppiel
pushed a commit
that referenced
this pull request
Apr 27, 2026
Promotes [Unreleased] to [0.10.0] - 2026-04-27. Each PR since v0.9.4 gets one 'so what' line: - #926 Microsoft 365 Cowork target ships impl - #790 marketplace authoring CLI (init, package add/set, build, check, outdated, doctor, publish) -- collapsed from 20+ bullets to one - #722 marketplace plugin -> package rename + --help sectioning -- collapsed - #980 README 'Coming from npx skills add' conversion block - #981 docs auto-deploy on tag push (real fix for the #953 attempt) - #985 pr-description-skill evals suite - #984 pr-description-skill mermaid hardening - #989 cowork sys.platform mock for Windows CI Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the 6 test failures introduced by #926 on Windows CI (run).
Root cause
5 tests in
test_copilot_cowork_paths.py-- macOS auto-detection tests did not mocksys.platform. On Windows CI the code enters thewin32branch first and returnsNonewithout ever reaching the~/Library/CloudStorageglob logic. Two additional tests (zero_tenant,no_cloud_storage) passed for the wrong reason (the Windows short-circuit happened to returnNone, matching the expected result).1 test in
test_config_command.py--os.path.expanduser("~/myskills")on Windows produces a path with mixed separators, whileos.path.join(home, "myskills")uses native backslashes. The assertion failed because the strings differed.Fix
apm_cli.integration.copilot_cowork_paths.sys.platformto the intended OS ("darwin"for macOS,"linux"for Linux).set_copilot_cowork_skills_dirnow normalises the expanded path withos.path.normpathto avoid mixed separators on Windows.Validation
5752 tests pass locally (macOS). The platform patches ensure the same code paths are exercised on all CI runners.