Skip to content

Conversation

@mircealungu
Copy link
Member

Summary

  • Session-scoped app fixture — creates Flask app once per session instead of per-test, eliminating ~4.6s × 189 overhead
  • JSON fixture for article/NLP data — pre-computed article tokenization loaded from JSON, skipping the 25s Stanza NLP pipeline at setup
  • Wordstats mock — fake WordInfo/LanguageInfo objects avoid loading 400k entries from disk (~12s savings)
  • Fix production bug: article.get_tokenized_content() loaded Stanza tokenizer before checking the cache — now checks cache first and returns immediately on hit
  • Remove unused hardcoded feeds from FeedRule (was creating 3 extra feeds per BookmarkRule invocation)
  • Consolidate tests: article tests (4→1), bookmark tests (18→3), feed tests deleted (stable functionality)
  • Delete redundant slow tests: feed download tests, Article.find_or_create tests, duplicate test_create_article

Test plan

  • Full test suite passes: 161 tests in ~44s (was 189 tests in ~160s)
  • Verify no test coverage regression for critical paths
  • Cold run timing (first run after reboot) to confirm setup savings

🤖 Generated with Claude Code

- Session-scoped app fixture (no per-test create_app)
- JSON fixture for pre-computed article/NLP data (skips Stanza pipeline)
- Wordstats mock (avoids loading 400k WordInfo objects)
- Fix: check tokenization cache before loading Stanza in get_tokenized_content()
- Remove unused hardcoded feeds from FeedRule (3 extra feeds per BookmarkRule)
- Consolidate article tests (4→1), bookmark tests (18→3)
- Delete redundant slow tests (feed download, Article.find_or_create)

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

github-actions bot commented Jan 28, 2026

ArchLens - No architecturally relevant changes to the existing views

mircealungu and others added 3 commits January 28, 2026 14:10
- Move cache_on_data_keys decorator to core/utils/caching.py
- Move feature toggle logic to core/user_feature_toggles.py
- Create core/test/test_app.py for minimal test Flask app
- Create core/test/fixtures.py for shared test fixtures
- Add BookmarkValidationError exception to update_bookmark.py
- Change search_subscription to raise ValueError instead of HTTP response
- Remove unused make_error import from feedback_component.py

The core module no longer imports from api, eliminating the
circular dependency pattern. Test infrastructure now uses a
minimal Flask app that doesn't require the full API.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Move FleschKincaidDifficultyEstimator import inside _get_estimators()
so that nltk and scipy are only loaded when difficulty estimation is
actually needed, not at module import time.

This cuts test startup time by ~1.5 seconds.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Move the test fixture regeneration code from core/test/_session_data.py
to tools/regenerate_test_fixture.py. This removes the last core→api
import, as the regeneration script legitimately needs the full API
but doesn't belong in the core module.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Simplify run_tests.sh to just run pytest
- Remove pytest-testmon from requirements.txt
- Delete docs/SMART_TESTS.md and run_tests_full.sh
- Clean up .gitignore entries for testmon data files

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@mircealungu mircealungu merged commit 40e6bcb into master Jan 28, 2026
3 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.

2 participants