Skip to content
This repository was archived by the owner on Nov 4, 2026. It is now read-only.

Add GitHub actions to run tests on Windows/MacOS & handle failures on Windows - #18

Merged
zastrowm merged 6 commits into
strands-agents:mainfrom
zastrowm:windows_support
May 19, 2025
Merged

zastrowm merged 6 commits into
strands-agents:mainfrom
zastrowm:windows_support

Conversation

@zastrowm

@zastrowm zastrowm commented May 19, 2025 •

Copy link
Copy Markdown
Member

Description

Per #17 - Windows compatibility is currently unknown and all changes are currently only tested on Linux. For parity with the SDK, start running tests on MacOS & Windows.

On MacOS all tests were already passing. On Windows I:

  • added tzdata as a dependency to make the current_time work
  • lazy loaded session: PromptSession in get_user_input to avoid import errors as part of the tests
  • updated test_file_write.py to not use a permissions check, as the GitHub action runners seemingly run as super-admin and can write to the provided folders
  • disabled tests that were not trivial to fix - test_shell, test_python_repl
  • disabled some environment tests to better mock get_user_input - the two tests are failing on windows because of the lack of an interactive console. I'd like to fix these two tests to properly mock get_user_input but I'm going to break that out into a separate PR to keep this one more focused.

To get linting to pass, I formatted the mem0 tool.

Related Issues

#17

Documentation PR

N/A

Type of Change

Other: Action to run tests on Windows

Testing

All of below; workflows in my fork are passing.

  • hatch fmt --linter
  • hatch fmt --formatter
  • hatch test --all

Checklist

  • I have read the CONTRIBUTING document

  • I have added tests that prove my fix is effective or my feature works

  • [-] I have updated the documentation accordingly

  • [-] I have added an appropriate example to the documentation to outline the feature

  • My changes generate no new warnings

  • Any dependent changes have been merged and published

  • By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

zastrowm added 6 commits May 19, 2025 09:19
The tzdata for Python isn't natively supported on Windows, so we add an OS-specific dependency to include it
GitHub Actions seems to be running actions as a low-level user, allowing writing to anywhere.  Instead of using permissions, default to the path-too-long path to fail the test
@zastrowm
zastrowm requested a review from a team as a code owner May 19, 2025 18:56
@zastrowm zastrowm changed the title Add GitHub actions to run tests on Windows/MacOS & handle filaures on Windows Add GitHub actions to run tests on Windows/MacOS & handle failures on Windows May 19, 2025
@zastrowm
zastrowm merged commit 2eabbcf into strands-agents:main May 19, 2025
@zastrowm
zastrowm deleted the windows_support branch May 19, 2025 22:39
Unshure pushed a commit to Unshure/tools that referenced this pull request May 21, 2025
… Windows (strands-agents#18)

Per strands-agents#17 - Windows compatibility is currently unknown and all changes are currently only tested on Linux.  For [parity with the SDK](https://github.com/strands-agents/sdk-python/blob/912e1104fd52e3da99767a644b90b22b7eb606de/.github/workflows/test-lint-pr.yml#L59), start running tests on MacOS & Windows.

On MacOS all tests were already passing.  On Windows I:

 - added [`tzdata` as a dependency](https://pypi.org/project/tzdata/) to make the `current_time` work
 - lazy loaded `session: PromptSession` in `get_user_input` to avoid import errors as part of the tests 
 - updated [test_file_write.py](strands-agents/tools@main...zastrowm:tools:windows_support#diff-a2998f18449d69766944a95d9058de448de22c38443a848876abaf22674df84a) to not use a permissions check, as the GitHub action runners seemingly run as super-admin and can write to the provided folders
 - disabled tests that were not trivial to fix - `test_shell`, `test_python_repl`
 - disabled some environment tests to better mock `get_user_input` - the two tests are failing on windows because of the lack of an interactive console.  I'd like to fix these two tests to properly mock `get_user_input` but I'm going to break that out into a separate PR to keep this one more focused.

To get linting to pass, I formatted the mem0 tool.
arronbailiss pushed a commit that referenced this pull request May 21, 2025
* Add GitHub actions to run tests on Windows/MacOS & handle failures on Windows (#18)

Per #17 - Windows compatibility is currently unknown and all changes are currently only tested on Linux.  For [parity with the SDK](https://github.com/strands-agents/sdk-python/blob/912e1104fd52e3da99767a644b90b22b7eb606de/.github/workflows/test-lint-pr.yml#L59), start running tests on MacOS & Windows.

On MacOS all tests were already passing.  On Windows I:

 - added [`tzdata` as a dependency](https://pypi.org/project/tzdata/) to make the `current_time` work
 - lazy loaded `session: PromptSession` in `get_user_input` to avoid import errors as part of the tests 
 - updated [test_file_write.py](main...zastrowm:tools:windows_support#diff-a2998f18449d69766944a95d9058de448de22c38443a848876abaf22674df84a) to not use a permissions check, as the GitHub action runners seemingly run as super-admin and can write to the provided folders
 - disabled tests that were not trivial to fix - `test_shell`, `test_python_repl`
 - disabled some environment tests to better mock `get_user_input` - the two tests are failing on windows because of the lack of an interactive console.  I'd like to fix these two tests to properly mock `get_user_input` but I'm going to break that out into a separate PR to keep this one more focused.

To get linting to pass, I formatted the mem0 tool.

* fix: improve tool interoperability and remove dependencies (#14)

* chore: bump version from 0.1.0 to 0.1.1

* fix: improve tool interoperability and remove dependencies

This commit enhances multiple tool components to better work together:

- feat(think): inherit parent agent's traces and tools to maintain context
- fix(load_tool): remove unnecessary hot_reload_tools dependency check
- fix(use_llm): properly pass trace_attributes from parent agent to new instances
- style(mem0_memory): improve code formatting and readability
- test: update tests to match new implementation patterns

* fix(slack): add missing trace_attributes to Agent initialization

---------

Co-authored-by: Cagatay Cali <[email protected]>

* docs: update memory examples to use agent.tool.X syntax (#22)

* fix: Rewrite environment tests to properly mock dependencies (#19)

Mock os.environ for test_environment by using a fixture, eliminating the need to worry about the real os environment.

Properly mock the get_user_input function by using a fixture as well and having environment import user_input as a module rather than importing the function directly.  This is the more an important change as previously the user input wasn't being mocked in the tests - all tests were passing as the code paths didn't actually need "y".

Co-authored-by: Mackenzie Zastrow <[email protected]>

* Update version to v0.1.2 (#23)

---------

Co-authored-by: Mackenzie Zastrow <[email protected]>
Co-authored-by: ./c² <[email protected]>
Co-authored-by: Cagatay Cali <[email protected]>
Co-authored-by: Mackenzie Zastrow <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants