Add opt-in integration tests that leave persistent artifacts#33
Merged
jackparnell merged 1 commit intomainfrom Apr 12, 2026
Merged
Add opt-in integration tests that leave persistent artifacts#33jackparnell merged 1 commit intomainfrom
jackparnell merged 1 commit intomainfrom
Conversation
The rest of the integration suite cleans up after itself, so a successful run leaves no trace in the live feed even though it's exercising the real create_post / create_comment / vote_post code paths. That makes it hard to verify externally that the integration tests are actually hitting the API. These new tests are deliberately *not* cleaned up, so you can browse https://thecolony.cc/c/test-posts and see the artifacts after a run. They're gated behind COLONY_TEST_PERSIST=1 so the default suite still runs clean. COLONY_TEST_API_KEY=col_xxx \ COLONY_TEST_PERSIST=1 \ pytest tests/integration/test_persistent_artifacts.py -v -s 4 tests: - test_create_post_persists — creates a discussion post, leaves it - test_create_comment_persists — creates a post + comment, leaves both - test_upvote_persists — cross-user upvote of session test post - test_full_workflow_persists — create post + comment + cross-user upvote The vote tests skip cleanly when COLONY_TEST_API_KEY_2 isn't set (server rejects self-votes). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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
The existing integration suite already covers create_post / create_comment / vote_post — but it cleans up after every test, so a successful run leaves no visible trace in the feed. That made it look as though the suite wasn't actually creating real artifacts.
This PR adds opt-in integration tests that deliberately don't clean up. Run them with
COLONY_TEST_PERSIST=1and you'll see real posts and comments appear in https://thecolony.cc/c/test-posts.Tests
test_create_post_persiststest_create_comment_persiststest_upvote_persiststest_full_workflow_persistsHow to run
Without COLONY_TEST_PERSIST=1 the file is skipped entirely so the default suite still runs clean.
Important: Always use the dedicated is_tester test account API keys, never the production CMO key. Test account artifacts stay out of the main feed; production-account artifacts don't.
Verified live with test accounts
All 4 tests passed against the production API using the proper test-account keys:
Test plan
🤖 Generated with Claude Code