Skip to content

Conversation

@hovu96
Copy link
Contributor

@hovu96 hovu96 commented Nov 4, 2025

Summary

  • Fixed test isolation issue where tests failed when WORKATO_API_TOKEN, WORKATO_HOST, or WORKATO_PROFILE environment variables were set in the shell
  • Updated the isolate_tests fixture in tests/conftest.py to clear these environment variables before running tests
  • This ensures tests are properly isolated from the developer's shell environment

Changes

  • Added monkeypatch.delenv() calls in the isolate_tests fixture to clear WORKATO_API_TOKEN, WORKATO_HOST, and WORKATO_PROFILE environment variables
  • Tests can still explicitly set these variables when needed for specific test scenarios

Test plan

  • Verified the specific failing test now passes
  • Ran all 130 tests in affected test files with environment variables set - all pass
  • Ran full test suite (919 tests) with all three environment variables exported - all pass
  • Verified type checker (mypy), linter (ruff), and formatter pass

🤖 Generated with Claude Code

Tests were failing when WORKATO_API_TOKEN, WORKATO_HOST, or WORKATO_PROFILE environment variables were set in the shell. The isolate_tests fixture now clears these variables to prevent shell environment from affecting test behavior.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions
Copy link

github-actions bot commented Nov 4, 2025

Coverage

Coverage Report
FileStmtsMissCoverMissing
__init__.py68494%10–11, 69–70
cli
   __init__.py52394%49, 51, 60
   containers.py270100% 
cli/commands
   __init__.py00100% 
   api_clients.py291996%27, 302, 448–449, 483, 493, 584, 615, 623
   api_collections.py257398%28, 183, 347
   assets.py47295%55–56
   connections.py526599%591, 593, 599, 637, 988
   data_tables.py165596%31, 253, 267, 321–322
   guide.py166199%106
   init.py900100% 
   profiles.py2030100% 
   properties.py97198%21
   pull.py172298%193–194
   workspace.py39294%61, 71
cli/commands/connectors
   __init__.py00100% 
   command.py90297%110, 159
   connector_manager.py203498%176, 292, 300–301
cli/commands/projects
   __init__.py00100% 
   command.py2721096%359–362, 373, 439–441, 491, 495
   project_manager.py166795%48, 66, 263–264, 276, 317, 325
cli/commands/push
   __init__.py00100% 
   command.py133496%109, 112, 230, 308
cli/commands/recipes
   __init__.py00100% 
   command.py427997%117, 133–134, 272–275, 403, 709
   validator.py7062097%174, 883, 1136, 1223, 1246, 1279, 1281–1282, 1359–1361, 1457–1458, 1517–1518, 1707–1708, 1736–1738
cli/utils
   __init__.py30100% 
   exception_handler.py3042591%134–135, 140–141, 143–144, 170–171, 177, 220, 267, 294, 321, 378, 413, 472, 474–475, 480–481, 483–487
   gitignore.py140100% 
   ignore_patterns.py230100% 
   spinner.py430100% 
   version_checker.py135695%24, 26, 33–34, 72, 102
cli/utils/config
   __init__.py50100% 
   manager.py4671995%125, 136–138, 141, 154, 204–205, 357, 438–439, 478, 692, 835–836, 850–851, 912, 971
   models.py330100% 
   profiles.py3091096%93, 189–190, 193, 228–230, 255–257
   workspace.py680100% 
TOTAL560115397% 

@hovu96 hovu96 self-assigned this Nov 4, 2025
@oalami oalami requested a review from Copilot November 4, 2025 19:35
Copy link
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

This PR improves test isolation by clearing environment variables that could interfere with test execution. The change ensures that tests are not affected by environment variables set in the developer's shell, making tests more deterministic and reliable.

Key changes:

  • Added cleanup of WORKATO_API_TOKEN, WORKATO_HOST, and WORKATO_PROFILE environment variables in the autouse isolate_tests fixture

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@oalami oalami merged commit d40f8c5 into main Nov 4, 2025
11 checks passed
@oalami oalami deleted the DEVP-430-Test-Keyring-test-fails-when-API-Token-is-exported branch November 4, 2025 19:38
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.

3 participants