Skip to content

Conversation

@AniketDev7
Copy link
Contributor

🔧 Refactor Test Suite: Centralize Config, Remove Hardcoded Credentials, and Clean Up Deprecated Tests

✅ Summary

This PR enhances the maintainability, security, and clarity of the Contentstack Python SDK test suite through the following improvements:


🔐 Centralized Configuration

  • Introduced a single config.py to hold all API keys, tokens, environment names, and UIDs.
  • Removed all hardcoded values from individual test files.
  • All tests now dynamically import from config.py.

🧹 Test Suite Refactor

  • Updated all test files to use centralized config variables.
  • This simplifies updates when credentials or environments change in the future.
  • Ensures consistency across the suite.

🗃 Deprecated/Obsolete Test Cleanup

  • Commented out skipped/deprecated tests like:

    • test_16_initialise_sync in test_stack.py
  • Added comments to explain why each test was skipped and whether it needs future attention.


✅ Test Health Check

  • All tests pass after the changes, except for the intentionally skipped/deprecated ones.
  • No regressions or logic changes introduced.

✅ Ready for review and merge.

@AniketDev7 AniketDev7 requested a review from a team as a code owner July 3, 2025 22:28
@AniketDev7 AniketDev7 requested a review from sunil-lakshman July 3, 2025 23:15
sunil-lakshman
sunil-lakshman previously approved these changes Jul 4, 2025
Copy link
Contributor

@sunil-lakshman sunil-lakshman left a comment

Choose a reason for hiding this comment

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

LGTM

sunil-lakshman
sunil-lakshman previously approved these changes Jul 4, 2025
Copy link
Contributor

@sunil-lakshman sunil-lakshman left a comment

Choose a reason for hiding this comment

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

LGTM

@AniketDev7 AniketDev7 merged commit bbf9bef into development Jul 4, 2025
10 checks passed
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