Skip to content

Handle fuubar #51

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

inkstak
Copy link

@inkstak inkstak commented Apr 8, 2024

Fix #23 : Allow to use the Fuubar formatter.

This pull request depends on #41.
The changes from #41 could be seen inkstak/turbo_tests@feature-parallel_options...feature-handle_fuubar

@inkstak
Copy link
Author

inkstak commented Apr 8, 2024

I had issues when using JSON formatter for extracting the number of total examples as suggested in #23 (comment)
The backticks capture the full output of the command, which may include other puts.

For example:

  • We have Dotenv configured to output which files are loaded on top of every rspec command:
    [dotenv] Load .env.test

  • Simplecov might output a line after the JSON output :
    Coverage report generated for ... (x%) covered.

Any ideas ?

@inkstak inkstak force-pushed the feature-handle_fuubar branch 2 times, most recently from 56d29b3 to 6bfb97b Compare April 11, 2024 13:13
@inkstak
Copy link
Author

inkstak commented Apr 11, 2024

PR updated :

  • I finally succeed to properly calculate the examples count using the JSON formatter as suggested in Usage with fuubar #23 (comment) by using a temporary file.
  • I removed all references specifici to Fuubar: the changes could now benefit to any custom formatter that requires the examples_count.

Changes are splitted in two commits :

  1. e1f8f6b is only a refactoring of the Runner class to allow forwarding files & parallel options (which depends on Support parallel_test options: pattern, exclude-pattern & group-by #41) to the Reporter

  2. 6bfb97b add a start notification with the examples_count

@inkstak
Copy link
Author

inkstak commented Apr 11, 2024

One more thing : to use Fuubar, you need to require it in the command :

bundle exec turbo_tests -r fuubar -f Fuubar spec/whatever

@pboling
Copy link

pboling commented Feb 4, 2025

The examples count code has been improved in main, such that I think this needs to be rebased and simplified.

@inkstak inkstak force-pushed the feature-handle_fuubar branch from b61bc10 to 21cb9e6 Compare April 28, 2025 07:21
@inkstak
Copy link
Author

inkstak commented Apr 28, 2025

PR rebased.
It's still depends on #41 (which have been rebased too).

The examples count code has been improved in main, such that I think this needs to be rebased and simplified.

@pboling Did you mean reporter.rb#L77 from #48 ?

Its seems that this methods returns the number of specs files while RSpec::Core::Notifications::StartNotification expects the number of examples.

I keep calculating this number only when custom formatter are present because on large applications, it could take few seconds (See: #51 (comment))

@pboling
Copy link

pboling commented Apr 28, 2025

Sorry, I no longer remember, and I'm not using this project currently. :(

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.

Usage with fuubar
3 participants