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

Fix test dependencies #738

Merged
merged 3 commits into from
Jan 10, 2022
Merged

Fix test dependencies #738

merged 3 commits into from
Jan 10, 2022

Conversation

mishina2228
Copy link
Contributor

Running the test with only test/env_test.rb or test/util_test.rb specified results in errors.
This PR addresses these issues.

  • test/env_test.rb

    • Before
    $ PATTERN=test/env_test.rb be rake test 
    Loaded suite /home/owner/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/rake_test_loader
    Started
    E
    ========================================================================================================================================================================
    Error: test_daemonizes_when_background_is_true(Env):
      NameError: uninitialized constant Resque::Scheduler::Env
      Did you mean?  ENV
    /home/owner/git-repos/resque-scheduler/test/env_test.rb:7:in `new_env'
    /home/owner/git-repos/resque-scheduler/test/env_test.rb:12:in `block (2 levels) in <top (required)>'
    
    ...(truncated)
    
    Finished in 0.017296834 seconds.
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    6 tests, 0 assertions, 0 failures, 6 errors, 0 pendings, 0 omissions, 0 notifications
    0% passed
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    346.88 tests/s, 0.00 assertions/s
    
    • After
    $ PATTERN=test/env_test.rb be rake test 
    Loaded suite /home/owner/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/rake_test_loader
    Started
    ......
    Finished in 0.002148279 seconds.
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    6 tests, 8 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
    100% passed
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    2792.93 tests/s, 3723.91 assertions/s
    
  • test/util_test.rb

    • Before
    $ PATTERN=test/util_test.rb be rake test 
    /home/owner/git-repos/resque-scheduler/test/util_test.rb:4:in `<top (required)>': undefined method `context' for main:Object (NoMethodError)
            from /home/owner/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/rake_test_loader.rb:21:in `require'
            from /home/owner/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/rake_test_loader.rb:21:in `block in <main>'
            from /home/owner/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/rake_test_loader.rb:6:in `select'
            from /home/owner/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/rake_test_loader.rb:6:in `<main>'
    
    • After
    $ PATTERN=test/util_test.rb be rake test 
    Loaded suite /home/owner/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/rake_test_loader
    Started
    ..
    Finished in 0.000772694 seconds.
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    2 tests, 2 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
    100% passed
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    2588.35 tests/s, 2588.35 assertions/s
    

@iloveitaly iloveitaly merged commit 189cdcf into resque:master Jan 10, 2022
@mishina2228 mishina2228 deleted the fix-test branch January 11, 2022 09:36
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.

2 participants