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

Update tests for 'newer' Windows builds #2348

Merged
merged 1 commit into from Jul 9, 2018

Conversation

MSP-Greg
Copy link
Contributor

@MSP-Greg MSP-Greg commented Jul 7, 2018

Description:

Two test files have 'Windows' skips that are not required for newer versions of Ruby when Windows is run with full admin access (as is the case with Appveyor).

Updated the tests, and tested locally as a non-admin, tests then skip.

Note: one test (test_extract_symlink_parent) that was updated had a single space indent instead of two. Corrected the indent for the whole test.

Tasks:

  • Describe the problem / feature
  • Write tests
  • Write code to solve the problem
  • Get code review from coworkers / friends

I will abide by the code of conduct.

@MSP-Greg
Copy link
Contributor Author

MSP-Greg commented Jul 7, 2018

Change in test results:

Ruby 2.2.6
pre:  2022 runs, 5958 assertions, 0 failures, 0 errors, 39 skips
post: 2022 runs, 5995 assertions, 0 failures, 0 errors, 31 skips

Trunk
pre:  2022 runs, 5963 assertions, 0 failures, 0 errors, 39 skips
post: 2022 runs, 6007 assertions, 0 failures, 0 errors, 28 skips

Copy link
Member

@hsbt hsbt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Please consider my comments.

@@ -179,7 +179,7 @@ def test_sign_in_with_other_credentials_doesnt_overwrite_other_keys
end

def test_sign_in_with_bad_credentials
skip 'Always uses $stdin on windows' if Gem.win_platform?
skip 'Always uses $stdin on windows' if Gem.win_platform? && RUBY_VERSION <= '1.9.2'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this line completely, Because the master branch only supports Ruby2.2+

@@ -190,7 +190,7 @@ def test_sign_in_with_bad_credentials
end

def util_sign_in response, host = nil, args = []
skip 'Always uses $stdin on windows' if Gem.win_platform?
skip 'Always uses $stdin on windows' if Gem.win_platform? && RUBY_VERSION <= '1.9.2'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as L182.

@@ -472,28 +480,32 @@ def test_extract_tar_gz_symlink_relative_path
end

def test_extract_symlink_parent
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you revert stylistic changes? We shouldn't mix it and feature changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Respectfully, no. I will remove the above two code lines. To not waste another set of tests, I'll do so when this is resolved.

Given what I've seen in this repo:

  1. If I submitted a PR with a new test and the 1st indent within the method def was one space, would I be asked to change it?

  2. I've aligned the formatting of one test in a file of 16, among over two thousand test methods in total.

  3. I've seen maintainers/members discuss things they admit to never having used, want benchmarks that had so many parameters affecting them as to make them pointless, and discuss engine/platform configurations they have never used anything comparable to. I've also seen them not respond to very specific questions.

I'm just trying to make RubyGems better for myself and also users in general (including new users). I've been writing code since I was a teenager using an acoustic-coupler and a teletype. I started in CompSci before changing to EE/Math. IOW, I'm old enough to say:

Y'all need to quit badgering contributors and let them improve RubyGems

Sorry for the rant...

Copy link
Member

@hsbt hsbt Jul 8, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, I will never merge this until you fixed them. It's an elementary request in pull request of GitHub.

See No.4 in http://blog.ploeh.dk/2015/01/15/10-tips-for-better-pull-requests/.

Copy link
Contributor Author

@MSP-Greg MSP-Greg Jul 8, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See No.4

And No.4's first paragraph is: "You may feel the urge to change the formatting of the existing code to fit 'your' style. Please abstain."

I did not do that. I formatted a test method I was already changing to match all the other test methods. My editor's ruby configuration replaces a tab with two spaces. and the non-standard spacing made it a PITA to edit. So I fixed it.

Unfortunately, I will never

Then I guess we're at an impasse...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MSP-Greg @hsbt I opened #2350 to unblock this!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MSP-Greg If you rebase now everyone should be happy I think! 💪

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Conflict with the rebase, just a bit more work. Thanks, Greg

begin
File.symlink('code.rb', 'lib/code_sym.rb')
rescue Errno::EACCES
skip "symlink - must be admin with no UAC on Windows"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be a if Gem.win_platform?, otherwise this skip could show up on other platforms where this message does not make much sense to the user.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it hits the rescue and it's not windows, what should happen? Nothing, raise the error, or something else?

I only added it because many windows desktops (including mine) will raise the error unless testing is run from an 'admin prompt/console'. Servers are normally configured differently. On Appvyor, the tests do not skip.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that it should raise so that the exception propagates back up to the user.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@colby

Rebased, and also added similar logic to line 514. And yeah, I screwed up offsetting line 513...

begin
package.extract_tar_gz tgz_io, @destination
rescue Errno::EACCES
skip "symlink - must be admin with no UAC on Windows"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same a previous comment

@bundlerbot
Copy link
Collaborator

☔ The latest upstream changes (presumably #2350) made this pull request unmergeable. Please resolve the merge conflicts.

@hsbt
Copy link
Member

hsbt commented Jul 9, 2018

@bundlerbot r+

@bundlerbot
Copy link
Collaborator

📌 Commit 2e3dbb0 has been approved by hsbt

@bundlerbot
Copy link
Collaborator

⌛ Testing commit 2e3dbb0 with merge c81a917...

bundlerbot added a commit that referenced this pull request Jul 9, 2018
Update tests for 'newer' Windows builds

# Description:

Two test files have 'Windows' skips that are not required for newer versions of Ruby when Windows is run with full admin access (as is the case with Appveyor).

Updated the tests, and tested locally as a non-admin, tests then skip.

Note: one test (test_extract_symlink_parent) that was updated had a single space indent instead of two.  Corrected the indent for the whole test.

# Tasks:

- [X] Describe the problem / feature
- [X] Write tests
- [X] Write code to solve the problem
- [ ] Get code review from coworkers / friends

I will abide by the [code of conduct](https://github.com/rubygems/rubygems/blob/master/CODE_OF_CONDUCT.md).
@bundlerbot
Copy link
Collaborator

☀️ Test successful - status-travis
Approved by: hsbt
Pushing c81a917 to master...

@bundlerbot bundlerbot merged commit 2e3dbb0 into rubygems:master Jul 9, 2018
@MSP-Greg MSP-Greg deleted the fix_windows_skips branch July 9, 2018 14:42
bundlerbot added a commit that referenced this pull request Jul 10, 2018
…wandale

Normalize comment indentations

# Description:

This is a minor follow up to #2350, that fixes another style inconsistency that showed up in #2348.
______________

# Tasks:

- [x] Describe the problem / feature
- [ ] Write tests
- [x] Write code to solve the problem
- [ ] Get code review from coworkers / friends

I will abide by the [code of conduct](https://github.com/rubygems/rubygems/blob/master/CODE_OF_CONDUCT.md).
bundlerbot added a commit that referenced this pull request Jul 10, 2018
…wandale

Normalize comment indentations

# Description:

This is a minor follow up to #2350, that fixes another style inconsistency that showed up in #2348.
______________

# Tasks:

- [x] Describe the problem / feature
- [ ] Write tests
- [x] Write code to solve the problem
- [ ] Get code review from coworkers / friends

I will abide by the [code of conduct](https://github.com/rubygems/rubygems/blob/master/CODE_OF_CONDUCT.md).
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.

None yet

6 participants