-
Notifications
You must be signed in to change notification settings - Fork 112
Add browser engine & family detection, improve test performance, update fixtures & regexes #127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: ci
Are you sure you want to change the base?
Conversation
* restructured RSpec tests for DeviceDetector with subject, let, and context; * replaced explicit class instantiations with described_class.new; * extracted utility logic into new helpers (ConditionalHelper, MatcherHelper); * cleaned up spec_helper.rb, auto-requiring all files under spec/support; * improved fixture specs and test isolation.
* added FixturesLoaderHelper with YAML-to-JSON caching via Oj for faster spec runs; * integrated caching and helper loading into spec_helper.rb with bootsnap setup; * removed redundant require_relative statements from specs; * added development dependencies (bootsnap, oj, rubocop-rspec) and new RSpec task in Rakefile; * cleaned up .gitignore and deleted outdated bot_spec.rb.
* added engine and engine_version parsing based on browser_engine.yml * implemented build_engine_version with regex-based UA extraction * updated specs to validate engine name, version, and family * improved DeviceDetector::Parser for safer version comparison * refactored helper methods and cleaned up duplicated logic
* update fixtures * update regexes * switch update fixtures & regexes rake tasks to revision instead of branch
* enabled parallel test execution with parallel_tests * extracted shared detector examples into a reusable module * split detector fixture specs into multiple smaller files for parallel runs * introduced FixtureNormalizerHelper for consistent fixture key/value normalization
* fix regexes path to absolute ones * moved parser class registration to a class-level constant improved and expanded RSpec coverage for class-level methods
- introduced `DeviceDetector.reset_cache!` for global cache reinitialization - added MemoryCache#purge! to fully clear in-memory cache contents - implemented `.add_fixture_path and `.reset_custom_fixtures!` for dynamic fixture loading in parsers - refactored regex loading to merge multiple fixture sources safely - expanded RSpec coverage for cache reset and fixture reloading behavior
- update fixtures to last revision of Matomo repo - fix path to custom regex file in tests
|
@matisojka @benzimmer any comments? |
|
I think @spiderpug is the guy to look into this! |
|
@kugaevsky Hey Nick, thanks for the PR. It's really hard to review to be honest. Would it be possible to split the different topics into smaller PRs that we can check independently? |
✨ Summary
This PR improves User-Agent data extraction, test performance, and fixture handling in
device_detector.It introduces browser engine detection, parallelized RSpec, and a cleaner, modular test architecture.
🧠 What’s Changed
🔧 Bugfixes
🕵️ User-Agent Data Extraction
DeviceDetector::Parser⚡ Test Performance
🧩 Code Structure
FixtureNormalizerHelperfor consistent fixture structureFixturesLoaderHelperwith smarter path resolution and caching🧪 Test Consistency
🧰 Developer Experience
tmp/failing_specs.logDeviceDetector.reset_cache!for global cache reinitialization.add_fixture_pathand.reset_custom_fixtures!for dynamic fixture loading in parsers