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

[railties] 2 errors in test/engine/commands_test.rb when run in PTY-less environment #47656

Closed
Apteryks opened this issue Mar 13, 2023 · 3 comments

Comments

@Apteryks
Copy link

Steps to reproduce

Run the test suite in a containerized environment lacking a PTY (rake test).

Expected behavior

All tests should pass.

Actual behavior

The following errors are reported, I think because the 'ensure' cleanup is run even when the test is marked as skipped?

--- test/engine/commands_test.rb
/gnu/store/j4z07lyi1ykk8bc68h1p4bpj1il9dn3f-ruby-2.7.4/bin/ruby -w -Itest -Ilib test/engine/commands_test.rb
Run options: --seed 29701

# Running:

hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint: 
hint: 	git config --global init.defaultBranch <name>
hint: 
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint: 
hint: 	git branch -m <name>
E

Error:
Rails::Engine::CommandsTest#test_dbconsole_command_work_inside_engine:
NoMethodError: private method `puts' called for nil:NilClass
    test/engine/commands_test.rb:53:in `ensure in test_dbconsole_command_work_inside_engine'
    test/engine/commands_test.rb:53:in `test_dbconsole_command_work_inside_engine'

rails test test/engine/commands_test.rb:45

hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint: 
hint: 	git config --global init.defaultBranch <name>
hint: 
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint: 
hint: 	git branch -m <name>
Shint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint: 
hint: 	git config --global init.defaultBranch <name>
hint: 
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint: 
hint: 	git branch -m <name>
.hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint: 
hint: 	git config --global init.defaultBranch <name>
hint: 
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint: 
hint: 	git branch -m <name>
.hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint: 
hint: 	git config --global init.defaultBranch <name>
hint: 
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint: 
hint: 	git branch -m <name>
E

Error:
Rails::Engine::CommandsTest#test_server_command_work_inside_engine:
TypeError: no implicit conversion from nil to integer
    test/engine/commands_test.rb:80:in `kill'
    test/engine/commands_test.rb:80:in `kill'
    test/engine/commands_test.rb:64:in `ensure in test_server_command_work_inside_engine'
    test/engine/commands_test.rb:64:in `test_server_command_work_inside_engine'

rails test test/engine/commands_test.rb:56


Finished in 2.806294s, 1.7817 runs/s, 1.4254 assertions/s.
5 runs, 4 assertions, 0 failures, 2 errors, 1 skips

Rails version: 7.0.4.2

Ruby version: 2.7.4

@Apteryks Apteryks changed the title 2 errors in test/engine/commands_test.rb when run in PTY-less environment [railties] 2 errors in test/engine/commands_test.rb when run in PTY-less environment Mar 13, 2023
@skipkayhil
Copy link
Member

Thank you for opening an issue

This was fixed in #45216 on main. I'm not exactly sure if changes to tests would be eligible for backporting as bug fixes, so I'll confirm in Discord.

@skipkayhil
Copy link
Member

I confirmed on Discord that this will not be backported, so I'm going to close this

@skipkayhil skipkayhil closed this as not planned Won't fix, can't repro, duplicate, stale Apr 15, 2023
@zzak
Copy link
Member

zzak commented May 16, 2023

Link to the discussion for context.

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

No branches or pull requests

3 participants