infinity_test 2.0.0.rc1 → 2.0.0.rc2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/HISTORY.md +84 -0
  3. data/README.md +249 -9
  4. data/TODO.markdown +36 -27
  5. data/lib/infinity_test/core/auto_discover.rb +3 -3
  6. data/lib/infinity_test/core/command_runner.rb +16 -40
  7. data/lib/infinity_test/core/continuous_test_server.rb +18 -0
  8. data/lib/infinity_test/core/version.rb +1 -1
  9. data/lib/infinity_test/framework/base.rb +36 -0
  10. data/lib/infinity_test/framework/django.rb +109 -0
  11. data/lib/infinity_test/framework/elixir_mix.rb +47 -0
  12. data/lib/infinity_test/framework/fast_api.rb +104 -0
  13. data/lib/infinity_test/framework/padrino.rb +5 -8
  14. data/lib/infinity_test/framework/phoenix.rb +72 -0
  15. data/lib/infinity_test/framework/python_package.rb +97 -0
  16. data/lib/infinity_test/framework/rails.rb +5 -14
  17. data/lib/infinity_test/framework/rocket.rb +70 -0
  18. data/lib/infinity_test/framework/rust_cargo.rb +69 -0
  19. data/lib/infinity_test/strategy/base.rb +17 -1
  20. data/lib/infinity_test/strategy/elixir_default.rb +20 -0
  21. data/lib/infinity_test/strategy/python_default.rb +22 -0
  22. data/lib/infinity_test/strategy/rbenv.rb +3 -1
  23. data/lib/infinity_test/strategy/ruby_default.rb +2 -1
  24. data/lib/infinity_test/strategy/rust_default.rb +21 -0
  25. data/lib/infinity_test/strategy/rvm.rb +3 -1
  26. data/lib/infinity_test/test_framework/cargo_test.rb +49 -0
  27. data/lib/infinity_test/test_framework/ex_unit.rb +53 -0
  28. data/lib/infinity_test/test_framework/pytest.rb +65 -0
  29. data/lib/infinity_test.rb +13 -0
  30. data/spec/infinity_test/core/auto_discover_spec.rb +29 -3
  31. data/spec/infinity_test/framework/django_spec.rb +95 -0
  32. data/spec/infinity_test/framework/elixir_mix_spec.rb +44 -0
  33. data/spec/infinity_test/framework/fast_api_spec.rb +96 -0
  34. data/spec/infinity_test/framework/padrino_spec.rb +28 -6
  35. data/spec/infinity_test/framework/phoenix_spec.rb +85 -0
  36. data/spec/infinity_test/framework/python_package_spec.rb +95 -0
  37. data/spec/infinity_test/framework/rails_spec.rb +28 -6
  38. data/spec/infinity_test/framework/rocket_spec.rb +69 -0
  39. data/spec/infinity_test/framework/rust_cargo_spec.rb +94 -0
  40. data/spec/infinity_test/strategy/elixir_default_spec.rb +46 -0
  41. data/spec/infinity_test/strategy/python_default_spec.rb +56 -0
  42. data/spec/infinity_test/strategy/rbenv_spec.rb +19 -2
  43. data/spec/infinity_test/strategy/ruby_default_spec.rb +19 -2
  44. data/spec/infinity_test/strategy/rust_default_spec.rb +56 -0
  45. data/spec/infinity_test/strategy/rvm_spec.rb +23 -6
  46. data/spec/infinity_test/test_framework/cargo_test_spec.rb +145 -0
  47. data/spec/infinity_test/test_framework/ex_unit_spec.rb +153 -0
  48. data/spec/infinity_test/test_framework/pytest_spec.rb +182 -0
  49. metadata +47 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: de5c732203c3b409f78bed3dfeb549cc51e473bba5777b5cfa7c25ea4ced3727
4
- data.tar.gz: c0e116e50c6d435b892507c4643e615467be709453840ed23fe946a1edd3d071
3
+ metadata.gz: a6911d2416f7e79b5629dda190203656dad3c90b8b10dae6e8abaf0103412082
4
+ data.tar.gz: 5434be704db02566f39a2f6272eb238f648956d6396eb95b3ad0da5f44ef6d10
5
5
  SHA512:
6
- metadata.gz: b1e7d0fc5bce31d3bdc2ed40d01fea49561702b78900460a735b41b8425b2f16e725c21e5add80dfb13b952e6ee70058432d65b1254ce78b7081ac6ce820ab64
7
- data.tar.gz: 0a2d0157905c8fa52bb8bb6f07424317346ff3c1dc1f274821a9d6cb9099105e4e228a987bf7f2ab66e0e4d8e3ee00d63312c723a2838da91a54e98ae7dde0af
6
+ metadata.gz: 3401363f1c87b54b3242a518f7ff70f9c9c401753e22be535a24ea59984f902cda041363777fe32b0b416b168d30b18be4ed76dbdd981d29d67aeab5f7268242
7
+ data.tar.gz: 46cb6773e7ddce619f210c120b2ab4b88085266af6da383b593d90a4b8bc3430d4baa3386012d35ef7280efeafd8eaf8c40e231ca518d0f66676021b2a2f1a37
data/HISTORY.md ADDED
@@ -0,0 +1,84 @@
1
+ # History
2
+
3
+ ## 2.0.0
4
+
5
+ ### New Features
6
+
7
+ - **Elixir Support**: Added ExUnit test framework, ElixirMix and Phoenix frameworks, and ElixirDefault strategy
8
+ - Auto-discovers Elixir projects by detecting `mix.exs`
9
+ - Phoenix framework: detects `lib/*_web` directory, watches all lib subdirectories
10
+ - ElixirMix framework: for standard Mix projects
11
+ - Watches `lib/**/*.ex` and `test/**/*.exs` files
12
+ - Parses ExUnit output (tests, failures, skipped)
13
+
14
+ - **Python Support**: Added Pytest test framework, PythonPackage framework, and PythonDefault strategy
15
+ - Auto-discovers Python projects by detecting `pyproject.toml`, `setup.py`, or `setup.cfg`
16
+ - Watches `src/`, `lib/`, and package directories with `__init__.py`
17
+ - Watches `tests/` or `test/` directories for test files
18
+ - Parses Pytest output (passed, failed, skipped)
19
+
20
+ - **Django Framework**: Full support for Django projects
21
+ - Auto-discovers Django projects by detecting `manage.py` with Django imports
22
+ - Watches Django app directories (models.py, views.py, apps.py)
23
+ - Maps app files to their corresponding tests
24
+
25
+ - **FastAPI Framework**: Support for FastAPI/ML API projects
26
+ - Auto-discovers FastAPI projects by detecting FastAPI imports in main.py
27
+ - Watches `app/`, `src/`, `routers/`, `api/`, `endpoints/` directories
28
+ - Perfect for ML model serving APIs
29
+
30
+ - **Rust Support**: Added CargoTest test framework, RustCargo and Rocket frameworks, and RustDefault strategy
31
+ - Auto-discovers Rust projects by detecting `Cargo.toml`
32
+ - Rocket framework: detects `rocket` dependency in Cargo.toml
33
+ - Watches `src/*.rs` files and runs tests matching module names
34
+ - Watches `tests/*.rs` for integration tests
35
+ - Parses cargo test output (passed, failed, ignored)
36
+
37
+ - **Modern Observers**: Replaced watchr with listen and filewatcher observers
38
+ - `listen` (default): Event-driven, uses native OS notifications
39
+ - `filewatcher`: Polling-based, works in VMs/NFS environments
40
+
41
+ - **RVM and RbEnv Strategies**: Multi-version Ruby testing support
42
+ - Run tests against multiple Ruby versions simultaneously
43
+ - Gemset support for RVM
44
+
45
+ - **Callbacks System**: Before/after hooks for test runs
46
+ - `before(:all)`, `after(:all)` for all test runs
47
+ - `before(:each_ruby)`, `after(:each_ruby)` for each Ruby version
48
+
49
+ - **Focus Mode**: Run specific tests with `--focus` option
50
+ - `--focus=:failures` to run only previously failed tests
51
+ - `--focus=path/to/file` to run specific test file
52
+
53
+ - **Just Watch Mode**: `--just-watch` option to skip initial test run
54
+
55
+ - **Auto-discover App Directories**: Automatically detect and watch Rails/Padrino app subdirectories (models, controllers, components, etc.)
56
+
57
+ - **Start Banner**: Display configuration summary on startup
58
+
59
+ - **Bundler Support**: Automatic `bundle exec` wrapping when Gemfile is present
60
+
61
+ - **Colored Output**: Preserve terminal colors with PTY and verbose command display
62
+
63
+ - **CLI Options**: Added `--notifications` and `--mode` options for desktop notifications
64
+
65
+ ### Improvements
66
+
67
+ - **Modern Notifications**: Updated to use modern notifiers gem with support for:
68
+ - macOS: terminal-notifier, osascript
69
+ - Linux: notify-send, dunstify
70
+
71
+ - **Priority Ordering**: Auto-discover now respects priority order for strategies, frameworks, and test frameworks
72
+
73
+ - **Rails and Padrino Heuristics**: Improved file watching patterns for Rails and Padrino applications
74
+
75
+ - **GitHub Actions**: Replaced Travis CI with GitHub Actions for CI/CD
76
+
77
+ - **Configuration File**: Renamed config file to `INFINITY_TEST`
78
+
79
+ ### Compatibility
80
+
81
+ - Updated for Ruby 3.x compatibility
82
+ - Updated for ActiveSupport 7.0+ compatibility
83
+ - Updated for modern RSpec syntax (replaced deprecated `stub` with `allow().to receive()`)
84
+ - Improved test descriptions by removing 'should' prefix
data/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  Infinity Test is a continuous testing library and a flexible alternative to Autotest and Guard. It watches your files for changes and automatically runs your tests, providing instant feedback with desktop notifications.
6
6
 
7
- Version 2.0.0 brings a complete rewrite with modern dependencies, multi-Ruby support via RVM/RbEnv, and a powerful callbacks system.
7
+ Version 2.0.0 brings a complete rewrite with modern dependencies, multi-Ruby support via RVM/RbEnv, a powerful callbacks system, and experimental support for Elixir (Phoenix, ExUnit), Python (Django, FastAPI, Pytest), and Rust (Rocket, Cargo).
8
8
 
9
9
  ## Table of Contents
10
10
 
@@ -15,6 +15,9 @@ Version 2.0.0 brings a complete rewrite with modern dependencies, multi-Ruby sup
15
15
  - [Ruby Version Managers](#ruby-version-managers)
16
16
  - [Test Frameworks](#test-frameworks)
17
17
  - [Application Frameworks](#application-frameworks)
18
+ - [Experimental: Elixir Support](#experimental-elixir-support)
19
+ - [Experimental: Python Support](#experimental-python-support)
20
+ - [Experimental: Rust Support](#experimental-rust-support)
18
21
  - [Notifications](#notifications)
19
22
  - [Image Themes](#image-themes)
20
23
  - [Callbacks](#callbacks)
@@ -25,14 +28,16 @@ Version 2.0.0 brings a complete rewrite with modern dependencies, multi-Ruby sup
25
28
 
26
29
  ## Installation
27
30
 
31
+ Since this is a release candidate (rc1), you need to explicitly request the pre-release version:
32
+
28
33
  ```bash
29
- gem install infinity_test
34
+ gem install infinity_test --pre
30
35
  ```
31
36
 
32
37
  Or add to your Gemfile:
33
38
 
34
39
  ```ruby
35
- gem 'infinity_test', group: :development
40
+ gem 'infinity_test', '~> 2.0.0.rc2', group: :development
36
41
  ```
37
42
 
38
43
  Then run:
@@ -59,8 +64,8 @@ infinity_test
59
64
 
60
65
  That's it! Infinity Test will:
61
66
 
62
- 1. Auto-detect your test framework (RSpec or Test::Unit)
63
- 2. Auto-detect your application framework (Rails, Padrino, or Rubygems)
67
+ 1. Auto-detect your test framework (RSpec, Test::Unit, ExUnit, or Pytest)
68
+ 2. Auto-detect your application framework (Rails, Padrino, Rubygems, Phoenix, Django, FastAPI, etc.)
64
69
  3. Run all tests immediately
65
70
  4. Watch for file changes and re-run relevant tests
66
71
  5. Show desktop notifications with test results
@@ -77,8 +82,8 @@ Edit your files and watch the tests run automatically!
77
82
  |--------|-------|-------------|
78
83
  | `--ruby strategy` | | Ruby manager strategy: `auto_discover`, `rvm`, `rbenv`, `ruby_default` |
79
84
  | `--rubies=versions` | | Ruby versions to test against (comma-separated) |
80
- | `--test library` | | Test framework: `auto_discover`, `rspec`, `test_unit` |
81
- | `--framework library` | | Application framework: `auto_discover`, `rails`, `rubygems`, `padrino` |
85
+ | `--test library` | | Test framework: `auto_discover`, `rspec`, `test_unit`, `ex_unit`, `pytest`, `cargo_test` |
86
+ | `--framework library` | | Application framework: `auto_discover`, `rails`, `padrino`, `rubygems`, `phoenix`, `elixir_mix`, `django`, `fast_api`, `python_package`, `rocket`, `rust_cargo` |
82
87
  | `--options=options` | | Additional options to pass to test command |
83
88
  | `--notifications library` | | Notification system: `auto_discover`, `osascript`, `terminal_notifier`, `notify_send`, `dunstify` |
84
89
  | `--mode theme` | | Image theme for notifications (see [Image Themes](#image-themes)) |
@@ -167,11 +172,11 @@ InfinityTest.setup do |config|
167
172
  config.gemset = 'my_project'
168
173
 
169
174
  # Test framework
170
- # Options: :auto_discover, :rspec, :test_unit
175
+ # Options: :auto_discover, :rspec, :test_unit, :ex_unit, :pytest, :cargo_test
171
176
  config.test_framework = :rspec
172
177
 
173
178
  # Application framework
174
- # Options: :auto_discover, :rails, :padrino, :rubygems
179
+ # Options: :auto_discover, :rails, :padrino, :rubygems, :phoenix, :elixir_mix, :django, :fast_api, :python_package, :rocket, :rust_cargo
175
180
  config.framework = :rails
176
181
 
177
182
  # File observer
@@ -324,6 +329,10 @@ Auto-detected when `test/` directory exists with `test_helper.rb` or `*_test.rb`
324
329
  config.test_framework = :test_unit
325
330
  ```
326
331
 
332
+ ### Other Test Frameworks (Experimental)
333
+
334
+ See [Elixir Support](#experimental-elixir-support) for ExUnit and [Python Support](#experimental-python-support) for Pytest.
335
+
327
336
  ---
328
337
 
329
338
  ## Application Frameworks
@@ -358,6 +367,237 @@ Used for gem development and simple Ruby projects.
358
367
 
359
368
  ---
360
369
 
370
+ ## Experimental: Elixir Support
371
+
372
+ > **Note:** Elixir support is experimental. Please report any issues.
373
+
374
+ Infinity Test can watch Elixir projects and run ExUnit tests automatically.
375
+
376
+ ### ExUnit Test Framework
377
+
378
+ Auto-detected when `test/` directory exists with `test_helper.exs` or `*_test.exs` files.
379
+
380
+ ```ruby
381
+ config.test_framework = :ex_unit
382
+ ```
383
+
384
+ ### Phoenix Framework
385
+
386
+ Auto-detected when `mix.exs` exists and `lib/*_web/` directory is present.
387
+
388
+ **Watched directories:**
389
+ - `lib/my_app/` → runs corresponding tests in `test/my_app/`
390
+ - `lib/my_app_web/controllers/` → runs corresponding controller tests
391
+ - `lib/my_app_web/live/` → runs corresponding LiveView tests
392
+ - `test/` → runs the changed test file
393
+ - `test/test_helper.exs` → runs all tests
394
+
395
+ ```ruby
396
+ config.framework = :phoenix
397
+ ```
398
+
399
+ ### ElixirMix Framework
400
+
401
+ For standard Elixir/Mix projects (non-Phoenix). Auto-detected when `mix.exs` exists.
402
+
403
+ **Watched directories:**
404
+ - `lib/` → runs corresponding tests
405
+ - `test/` → runs the changed test file
406
+
407
+ ```ruby
408
+ config.framework = :elixir_mix
409
+ ```
410
+
411
+ ### Elixir Configuration Example
412
+
413
+ ```ruby
414
+ InfinityTest.setup do |config|
415
+ config.test_framework = :ex_unit
416
+ config.framework = :phoenix # or :elixir_mix
417
+ config.strategy = :elixir_default
418
+ config.notifications = :terminal_notifier
419
+ end
420
+ ```
421
+
422
+ ---
423
+
424
+ ## Experimental: Python Support
425
+
426
+ > **Note:** Python support is experimental. Please report any issues.
427
+
428
+ Infinity Test can watch Python projects and run Pytest tests automatically.
429
+
430
+ ### Pytest Test Framework
431
+
432
+ Auto-detected when `tests/` or `test/` directory exists with `test_*.py` or `*_test.py` files.
433
+
434
+ ```ruby
435
+ config.test_framework = :pytest
436
+ ```
437
+
438
+ **Output parsing:**
439
+ - `5 passed` → success
440
+ - `1 failed, 4 passed` → failure
441
+ - `4 passed, 1 skipped` → pending
442
+
443
+ ### Django Framework
444
+
445
+ Auto-detected when `manage.py` exists with Django imports.
446
+
447
+ **Watched directories:**
448
+ - Django app directories (containing `models.py`, `views.py`, or `apps.py`)
449
+ - Each app's `tests/` directory or `tests.py` file
450
+ - `conftest.py` → runs all tests
451
+
452
+ ```ruby
453
+ config.framework = :django
454
+ ```
455
+
456
+ ### FastAPI Framework
457
+
458
+ Auto-detected when `main.py` (or `app/main.py`, `src/main.py`) contains FastAPI imports. Ideal for ML model serving APIs.
459
+
460
+ **Watched directories:**
461
+ - `app/` → API application code
462
+ - `routers/` → API route definitions
463
+ - `api/` → API endpoints
464
+ - `endpoints/` → endpoint handlers
465
+ - `tests/` → test files
466
+
467
+ ```ruby
468
+ config.framework = :fast_api
469
+ ```
470
+
471
+ ### PythonPackage Framework
472
+
473
+ For standard Python packages. Auto-detected when `pyproject.toml`, `setup.py`, or `setup.cfg` exists.
474
+
475
+ **Watched directories:**
476
+ - `src/` → source code
477
+ - `lib/` → library code
478
+ - Package directories (containing `__init__.py`)
479
+ - `tests/` or `test/` → test files
480
+
481
+ ```ruby
482
+ config.framework = :python_package
483
+ ```
484
+
485
+ ### Python Configuration Example
486
+
487
+ ```ruby
488
+ InfinityTest.setup do |config|
489
+ config.test_framework = :pytest
490
+ config.framework = :fast_api # or :django, :python_package
491
+ config.strategy = :python_default
492
+ config.notifications = :terminal_notifier
493
+ end
494
+ ```
495
+
496
+ ### Python Project Structure Examples
497
+
498
+ **FastAPI ML API:**
499
+ ```
500
+ my_ml_api/
501
+ ├── app/
502
+ │ ├── main.py # from fastapi import FastAPI
503
+ │ ├── models/ # ML models
504
+ │ └── routers/ # API endpoints
505
+ ├── tests/
506
+ │ ├── conftest.py
507
+ │ └── test_api.py
508
+ └── pyproject.toml
509
+ ```
510
+
511
+ **Django ML Dashboard:**
512
+ ```
513
+ my_dashboard/
514
+ ├── manage.py
515
+ ├── dashboard/ # Django app
516
+ │ ├── models.py
517
+ │ ├── views.py
518
+ │ └── tests/
519
+ ├── ml_pipeline/ # Django app
520
+ │ ├── models.py
521
+ │ └── tests.py
522
+ └── requirements.txt
523
+ ```
524
+
525
+ ---
526
+
527
+ ## Experimental: Rust Support
528
+
529
+ > **Note:** Rust support is experimental. Please report any issues.
530
+
531
+ Infinity Test can watch Rust projects and run `cargo test` automatically.
532
+
533
+ ### CargoTest Test Framework
534
+
535
+ Auto-detected when `Cargo.toml` exists.
536
+
537
+ ```ruby
538
+ config.test_framework = :cargo_test
539
+ ```
540
+
541
+ **Output parsing:**
542
+ - `5 passed; 0 failed; 0 ignored` → success
543
+ - `3 passed; 2 failed; 0 ignored` → failure
544
+ - `4 passed; 0 failed; 1 ignored` → pending
545
+
546
+ ### Rocket Framework
547
+
548
+ Auto-detected when `Cargo.toml` contains `rocket` dependency. For Rocket web applications.
549
+
550
+ **Watched directories:**
551
+ - `src/*.rs` → runs tests matching the module name (e.g., `src/routes.rs` → `cargo test routes`)
552
+ - `src/lib.rs` or `src/main.rs` → runs all tests
553
+ - `tests/*.rs` → runs the specific integration test
554
+ - `Cargo.toml` → runs all tests
555
+ - `Rocket.toml` → runs all tests (if exists)
556
+
557
+ ```ruby
558
+ config.framework = :rocket
559
+ ```
560
+
561
+ ### RustCargo Framework
562
+
563
+ For standard Rust libraries and applications. Auto-detected when `Cargo.toml` exists (and no Rocket dependency).
564
+
565
+ **Watched directories:**
566
+ - `src/*.rs` → runs tests matching the module name
567
+ - `tests/*.rs` → runs the specific integration test
568
+ - `Cargo.toml` → runs all tests
569
+
570
+ ```ruby
571
+ config.framework = :rust_cargo
572
+ ```
573
+
574
+ ### Rust Configuration Example
575
+
576
+ ```ruby
577
+ InfinityTest.setup do |config|
578
+ config.test_framework = :cargo_test
579
+ config.framework = :rust_cargo # or :rocket
580
+ config.strategy = :rust_default
581
+ config.notifications = :terminal_notifier
582
+ end
583
+ ```
584
+
585
+ ### Rust Project Structure Example
586
+
587
+ ```
588
+ my_rust_project/
589
+ ├── Cargo.toml
590
+ ├── src/
591
+ │ ├── lib.rs # Changes run all tests
592
+ │ ├── user.rs # Changes run `cargo test user`
593
+ │ └── utils.rs # Changes run `cargo test utils`
594
+ └── tests/
595
+ ├── integration.rs # Changes run `cargo test --test integration`
596
+ └── api_tests.rs # Changes run `cargo test --test api_tests`
597
+ ```
598
+
599
+ ---
600
+
361
601
  ## Notifications
362
602
 
363
603
  Desktop notifications show test results with themed images.
data/TODO.markdown CHANGED
@@ -1,29 +1,38 @@
1
1
  ## Todo
2
2
 
3
- Infinity test is a gem that watch files changes and run tests.
4
-
5
- That also can run with different ruby versions all test suite or only that file change (using rvm or
6
- rbenv), ruby default just run the test on the current ruby version.
7
-
8
- ## What Needs to Be Done
9
-
10
- * ~~Make notifications work with Notifiers gem (remove growl and use the autodiscover from notifiers gem).~~ DONE
11
- * ~~Change .infinity_test to INFINITY_TEST~~ DONE
12
- * ~~Make Test::Unit to work (the infinity test to check test folder).~~ DONE
13
- * ~~Make RSpec work~~ DONE
14
- * ~~Finish RubyDefault strategy~~ DONE
15
- * ~~Finish RVM (running different versions - the user need to specify)~~ DONE
16
- * ~~Finish RbEnv (running different versions - the user need to specify)~~ DONE
17
- * Make callbacks work in the new structure (loading the infinity test file).
18
- * ~~Finish Gem autodiscover and its changes heuristics.~~ DONE
19
- * ~~Finish Rails autodiscover and its changes heuristics.~~ DONE
20
- * ~~Padrino autodiscover and its changes heuristics.~~ DONE
21
- * ~~Improve auto discover feature priorization subclasses for #run? method.~~ DONE
22
- * ~~Focus feature(fails, pass one file, run entire suite) with --focus (experimented feature)!~~ DONE
23
- * ~~Add post-run hooks to be added to the INFINITY_TEST file that run other things (coverage, code
24
- analysis, etc - see ideas)~~ DONE (via callbacks system)
25
-
26
- * ~~Give some ideas (write to a md file the ideas) about how to integrate the infinity test with AI tools/AI agents or
27
- even Claude code ... so ruby developers can see~~ DONE (see AI_INTEGRATION_IDEAS.md)
28
-
29
- * ~~Update HISTORY with all changes since last version.~~ DONE
3
+ Potential improvements and features for Infinity Test.
4
+
5
+ ## Next Steps
6
+
7
+ ### High Priority
8
+
9
+ * Replace Hike gem dependency (last updated 12 years ago) with a simple built-in file finder
10
+ * Add support for notification timeout/duration (use alerter for macOS, notify-send -t for Linux)
11
+ * Add Minitest as explicit test framework option (currently uses test_unit)
12
+
13
+ ### Features
14
+
15
+ * Add `--watch-only` option to specify specific directories to watch
16
+ * Add `--ignore` CLI option to ignore specific files/patterns
17
+ * Support for custom file extensions beyond .rb (e.g., .rake, .erb with embedded Ruby)
18
+ * Add `--fail-fast` option to stop on first failure
19
+
20
+ ### Developer Experience
21
+
22
+ * Add `--dry-run` option to show what command would be executed without running
23
+ * Add `--debug` flag for troubleshooting file watching issues
24
+ * Improve error messages when test framework is not found
25
+ * Add startup banner showing detected configuration (framework, test lib, ruby strategy)
26
+
27
+ ### Integrations
28
+
29
+ * Add GitHub Actions workflow template for CI
30
+ * Add hook system for pre/post test execution scripts
31
+ * Support for Docker-based Ruby version testing
32
+ * Integration with code coverage tools (SimpleCov reporting)
33
+
34
+ ### Documentation
35
+
36
+ * Add more examples to wiki for common use cases
37
+ * Add troubleshooting guide
38
+ * Add migration guide from Guard/Autotest
@@ -6,9 +6,9 @@ module InfinityTest
6
6
  # Priority order for auto discovery (higher priority first)
7
7
  # More specific libraries should be checked before generic ones
8
8
  PRIORITY = {
9
- strategy: [:rvm, :rbenv, :ruby_default],
10
- framework: [:rails, :padrino, :rubygems],
11
- test_framework: [:rspec, :test_unit]
9
+ strategy: [:rvm, :rbenv, :elixir_default, :python_default, :rust_default, :ruby_default],
10
+ framework: [:rails, :padrino, :phoenix, :elixir_mix, :django, :fast_api, :python_package, :rocket, :rust_cargo, :rubygems],
11
+ test_framework: [:rspec, :test_unit, :ex_unit, :pytest, :cargo_test]
12
12
  }.freeze
13
13
 
14
14
  def initialize(base)
@@ -1,3 +1,5 @@
1
+ require 'pty'
2
+
1
3
  module InfinityTest
2
4
  module Core
3
5
  class CommandRunner < String
@@ -10,52 +12,26 @@ module InfinityTest
10
12
  end
11
13
 
12
14
  def run!
13
- SynchronizeStdout.new do
14
- open("| #{@command}", "r") do |file|
15
- @command_output = CommandOutput.new(file)
16
- @command_output.puts
17
- end
18
- end
19
-
20
- @command_output.stdout
21
- end
22
- end
23
-
24
- class CommandOutput
25
- def initialize(file)
26
- @file = file
27
- @results = []
28
- @line = []
29
- end
30
-
31
- def puts
32
- until @file.eof? do
33
- test_line = @file.getc or break
34
- print(test_line)
35
- @line.push(test_line)
36
- if test_line == ?\n
37
- # @results.push(yarv? ? @line.join : @line.pack('c*'))
38
- @results.push(@line.join)
39
- @line.clear
40
- end
41
- end
42
- end
43
-
44
- def stdout
45
- @results.join
46
- end
47
- end
48
-
49
- class SynchronizeStdout
50
- def initialize
51
- old_sync = $stdout.sync
15
+ output = []
16
+ old_sync = $stdout.sync
52
17
  $stdout.sync = true
53
18
 
54
19
  begin
55
- yield
20
+ PTY.spawn(@command) do |stdout, _stdin, _pid|
21
+ stdout.each_char do |char|
22
+ print char
23
+ output << char
24
+ end
25
+ end
26
+ rescue PTY::ChildExited
27
+ # Command finished
28
+ rescue Errno::EIO
29
+ # End of output
56
30
  ensure
57
31
  $stdout.sync = old_sync
58
32
  end
33
+
34
+ output.join
59
35
  end
60
36
  end
61
37
  end
@@ -10,10 +10,28 @@ module InfinityTest
10
10
  end
11
11
 
12
12
  def start
13
+ print_banner
13
14
  run_strategy unless just_watch
14
15
  start_observer
15
16
  end
16
17
 
18
+ # Print startup banner showing detected configuration.
19
+ # Only shows when verbose mode is enabled.
20
+ #
21
+ def print_banner
22
+ return unless Base.verbose?
23
+
24
+ puts "\e[96m"
25
+ puts "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
26
+ puts " InfinityTest - To Infinity and Beyond!"
27
+ puts "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
28
+ puts " Framework: #{base.framework}"
29
+ puts " Test Framework: #{base.test_framework}"
30
+ puts " Strategy: #{base.strategy}"
31
+ puts "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\e[0m"
32
+ puts
33
+ end
34
+
17
35
  # Run strategy based on the choosed ruby strategy.
18
36
  #
19
37
  def run_strategy
@@ -1,5 +1,5 @@
1
1
  module InfinityTest
2
2
  module Core
3
- VERSION = '2.0.0.rc1'
3
+ VERSION = '2.0.0.rc2'
4
4
  end
5
5
  end
@@ -52,6 +52,42 @@ module InfinityTest
52
52
  file = hike.find(file_name)
53
53
  continuous_test_server.rerun_strategy(file) if file.present?
54
54
  end
55
+
56
+ # Auto-discover and watch all directories under app/ that contain Ruby files.
57
+ # Maps app/components to spec/components, app/wizards to spec/wizards, etc.
58
+ # Skips directories without .rb files (e.g., app/views, app/assets).
59
+ #
60
+ def watch_app_dirs
61
+ return unless File.directory?('app')
62
+
63
+ Dir.glob('app/*').each do |app_dir|
64
+ next unless File.directory?(app_dir)
65
+ next unless Dir.glob("#{app_dir}/**/*.rb").any?
66
+
67
+ watch_dir(app_dir) { |file| run_test_in_subdir(file, app_dir) }
68
+ end
69
+ end
70
+
71
+ # Run test preserving the subdirectory structure.
72
+ # E.g: app/components/wizard.rb -> spec/components/wizard_spec.rb
73
+ #
74
+ # @param changed_file [<InfinityTest::Core::ChangedFile>]
75
+ # @param app_dir [String] The app directory (e.g., 'app/components')
76
+ #
77
+ def run_test_in_subdir(changed_file, app_dir)
78
+ subdir = File.basename(app_dir)
79
+ test_file = File.join(test_framework.test_dir, subdir, "#{changed_file.path}_#{test_framework.test_dir}.#{extension}")
80
+
81
+ if File.exist?(test_file)
82
+ continuous_test_server.rerun_strategy(test_file)
83
+ else
84
+ # Fallback: try finding with hike in test_dir/subdir
85
+ hike.prepend_path(File.join(test_framework.test_dir, subdir))
86
+ file_name = "#{changed_file.path}_#{test_framework.test_dir}.#{extension}"
87
+ file = hike.find(file_name)
88
+ continuous_test_server.rerun_strategy(file) if file.present?
89
+ end
90
+ end
55
91
  end
56
92
  end
57
93
  end