Skip to content
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

Rake task ignores dirs #69

Open
marco-nicola opened this issue Jan 10, 2017 · 3 comments
Open

Rake task ignores dirs #69

marco-nicola opened this issue Jan 10, 2017 · 3 comments
Assignees

Comments

@marco-nicola
Copy link

The attribute dirs seems to be ignored by rake FlayTask.

In FlayTask#define method, dirs should be passed as argument when invoking Flay.run (see flay_task.rb:48), which has the optional argument args that by default is set to ARGV (possibly not useful at all in this context).

@jdickey
Copy link

jdickey commented Feb 18, 2017

The dirs attribute is ignored completely even when passed in via #initialize.

My Makefile includes the task

FlayTask.new(:flay, 200, %w(lib)) do |t|
  t.verbose = true
  # t.dirs = %w(lib) # `test` not included
end

When I run flay in sequence with other tasks, e.g.

$ bin/rake test flay

# Running tests with run options --seed 23951:

.............................................

Finished tests in 0.058968s, 763.1278 tests/s, 763.1278 assertions/s.


45 tests, 45 assertions, 0 failures, 0 errors, 0 skips
Coverage report generated for Unit Tests to /Users/jeffdickey/src/conversagence/service_catalogue/v1/service_catalogue_uc_v1/coverage. 391 / 391 LOC (100.0%) covered.
rake aborted!
Flay total too high! 410 > 200
/Users/jeffdickey/src/conversagence/service_catalogue/v1/service_catalogue_uc_v1/gemsets/dev/gems/flay-2.8.1/lib/flay_task.rb:51:in `block in define'
/Users/jeffdickey/src/conversagence/service_catalogue/v1/service_catalogue_uc_v1/gemsets/dev/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
Tasks: TOP => flay
(See full trace by running task with --trace)
Total score (lower is better) = 410

1) Similar code found in :iter (mass = 168)
  test/service_catalogue_uc_v1/accept_content_type_selector_test.rb:219
  test/service_catalogue_uc_v1/accept_content_type_selector_test.rb:253

2) Similar code found in :iter (mass = 148)
  test/service_catalogue_uc_v1/accept_content_type_selector_test.rb:104
  test/service_catalogue_uc_v1/accept_content_type_selector_test.rb:135

3) Similar code found in :iter (mass = 54)
  test/service_catalogue_uc_v1/accept_content_type_selector_test.rb:29
  test/service_catalogue_uc_v1/accept_content_type_selector_test.rb:49

4) Similar code found in :iter (mass = 40)
  test/service_catalogue_uc_v1/service_component_describer_test.rb:98
  test/service_catalogue_uc_v1/service_component_describer_test.rb:105


NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE

This occurs for the default task including rake only with rake 12.0.0 (updating to which is when I discovered the problem). Going back to rake 11.3.0 does not manifest the issue. @marco-nicola, take note.

Version of flay used is Gem version 2.8.1.

However, running flay explicitly within rake, as in bin/rake test flay, produces the same output, indicating that the dirs setting is being ignored again. 💥

@jdickey
Copy link

jdickey commented Jun 4, 2020

Three years later, no resolution?

@rickhull
Copy link

See here for a workaround: https://github.com/rickhull/fitment/blob/master/Rakefile#L38

adam12 added a commit to adam12/flay that referenced this issue Apr 28, 2022
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 a pull request may close this issue.

4 participants