Giter VIP home page Giter VIP logo

Comments (7)

zenspider avatar zenspider commented on May 26, 2024
9979 % ruby -e 'pp ARGV' bundle exec rails test test/integration/my_cool_test.rb -n /user registration/
["bundle",
 "exec",
 "rails",
 "test",
 "test/integration/my_cool_test.rb",
 "-n",
 "/user",
 "registration/"]

from minitest.

zenspider avatar zenspider commented on May 26, 2024
9980 % ruby -e 'pp ARGV' bundle exec rails test test/integration/my_cool_test.rb -n "/user registration/"
["bundle",
 "exec",
 "rails",
 "test",
 "test/integration/my_cool_test.rb",
 "-n",
 "/user registration/"]

from minitest.

zenspider avatar zenspider commented on May 26, 2024
9981 % ruby -e 'pp ARGV' bundle exec rails test test/integration/my_cool_test.rb -n /user.registration/
["bundle",
 "exec",
 "rails",
 "test",
 "test/integration/my_cool_test.rb",
 "-n",
 "/user.registration/"]

from minitest.

abatko avatar abatko commented on May 26, 2024

I tried those ideas, and got it to work when substituting the space in the name with ..

Both of these work:

bundle exec rails test test/integration/flow_test.rb -n /caregiver.registration/
bundle exec rails test test/integration/flow_test.rb -n "/caregiver.registration/"

LoadError:

bundle exec rails test test/integration/my_cool_test.rb -n /caregiver registration/ 

No tests run:

bundle exec rails test test/integration/flow_test.rb -n "/caregiver registration/"

0 runs, 0 assertions, 0 failures, 0 errors, 0 skips

So, is that the way?... replace spaces in test names with dots (aka any char reg exp)?

from minitest.

zenspider avatar zenspider commented on May 26, 2024

you're removing too much output... minitest shows you what arguments it processes in the test output.

So, is that the way?... replace spaces in test names with dots (aka any char reg exp)?

no. it is a way, but isn't the way. If quoting + spaces isn't working, that's not minitest. Try removing bundle exec rails test and use plain ruby to run:

ruby test/integration/flow_test.rb -n "/caregiver registration/"

from minitest.

zenspider avatar zenspider commented on May 26, 2024

no response in a week. closing

from minitest.

abatko avatar abatko commented on May 26, 2024

I only removed the output because as far as I could tell, there was nothing else in it that hinted at the problem...

Without double-quotes (but still using a space):

bundle exec rails test test/integration/flow_test.rb -n /caregiver registration/ 
/Users/meme/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require': cannot load such file -- /Users/meme/Projects/myorg/myrepo/test/integration/flow_test.rb (LoadError)
        from /Users/meme/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
        from /Users/meme/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/test_unit/runner.rb:50:in `block in load_tests'
        from /Users/meme/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/test_unit/runner.rb:50:in `each'
        from /Users/meme/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/test_unit/runner.rb:50:in `load_tests'
        from /Users/meme/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/test_unit/runner.rb:39:in `run'
        from /Users/meme/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/commands/test/test_command.rb:33:in `perform'
        from /Users/meme/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
        from /Users/meme/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
        from /Users/meme/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
        from /Users/meme/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/command/base.rb:69:in `perform'
        from /Users/meme/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/command.rb:48:in `invoke'
        from /Users/meme/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/railties-6.1.7/lib/rails/commands.rb:18:in `<main>'
        from /Users/meme/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
        from /Users/meme/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
        from bin/rails:4:in `<main>'

With double-quotes (but still using a space):

bundle exec rails test test/integration/flow_test.rb -n "/caregiver registration/"
Seeding data from file: common
- Creating Riddle Network
- Creating riddle dummy company
Seeding data from common complete!
Seeding data from file: test
Seeding data from test complete!
Run options: -n "/caregiver registration/" --seed 21482

# Running:


Top 0 slowest tests (0.000000 seconds, 0.0% of total time):

[Minitest::CI] Generating test report in JUnit XML format...


Finished in 0.000777s, 0.0000 runs/s, 0.0000 assertions/s.
0 runs, 0 assertions, 0 failures, 0 errors, 0 skips
Coverage report generated for Integration Tests to /Users/meme/Projects/myorg/myrepo/coverage. 2593 / 4853 LOC (53.43%) covered.

Removing bundle exec rails test and use plain ruby to run:

ruby test/integration/flow_test.rb -n "/caregiver registration/"
<internal:/Users/meme/.rbenv/versions/3.1.3/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- test_helper (LoadError)
        from <internal:/Users/meme/.rbenv/versions/3.1.3/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from test/integration/flow_test.rb:1:in `<main>'

from minitest.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.