-
Notifications
You must be signed in to change notification settings - Fork 62
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
Guards with multiple criteria #43
Comments
Hello, It sounds good, please make a PR removing the extra guards. Yes, you can use: guard -> { platform_is :mingw and ruby_version_is ""..."2.4" } do
# specs
end So the usual guards also work without a block and return a boolean when called inside See https://github.com/ruby/spec/blob/master/CONTRIBUTING.md#guards re "greater or equal for ruby versions".
Do you mean specs not executed because of guards?
I think the number of examples should not change on the same setup (platform/machine/version/etc). Could you maybe do a diff of the
What went wrong? |
Could you file the bug with |
Thanks for the response. Very helpful. First, I'll get PR's in core for the unneeded guards, as the specs pass with MSYS2 builds (Ruby 2.4 forward), but they fail with Ruby 2.3 or earlier. Secondly, I'm going to make some changes to ruby-loco to see what's causing the spec numbers to jump around. And if I forget about Re |
Re guards, I've seen a few of these: # Guard against the Mathn library
conflicts_with :Prime do Could these be changed to: guard -> { ::Math.private_method_defined? :rsqrt } do I checked it with 2.3 & 2.4, and it's value depends on whether Mathn is loaded... FYI, locally I've got code outputting file and example count when running multi, and I'm looking at files with intermittent example counts. Also shuffling the file list... |
@MSP-Greg I didn't realize |
@MSP-Greg Done in ruby/spec@c0cb934. |
Tonite I was going to do some testing with older versions... Maybe some background might help. A long time ago, after ruby-loco seemed stable, I went thru the test-all suite. First, I wondered if there were tests that were being skipped due to issues with old Ruby versions, and also due to the older build system used with Ruby 2.3 and earlier on Windows. Secondly, both Travis and Appveyor had test totals that jumped around. So, after re-writing ruby-loco recently, I decided to do the same with the spec tests. First thing, I needed some data to look at. I've got a patched version of MSpec that runs multi and outputs data similar to:
Rather than the pid, I just assigned a letter, and the numeric value is the total number of examples. Then, I wrote a script to run the whole suite multiple times (running 20 at present), and another script to summarize the data from the twenty runs. Presently, I'm also shuffling the file list. So, what have I found?
So, that's where I am. At present I've been working with the files in ruby/ruby, as I can get at both mspec and spec from the same repo. I haven't pushed the work to my fork, but if that would be helpful... Maybe I should move over to ruby/spec? I've attached the output from my 'summary' script. I haven't made the output 'pretty', but I added some notes that (hopefully) clarify what the numbers are. So, how can I help? Thanks, Greg |
I noticed the recent updates, and ruby-loco passed as of r64844. I just noticed issue #36, and I suspect that explains the issues I had with intermittent I just redid the patch files in ruby-loco, and I've now got all the spec patches I'm using in the folder patches_spec. I mentioned in ruby/ruby that I had a strange issue with Encoding::Converter.search_convpath. Earlier today ruby-loco silent stopped on spec tests. Checking more earlier, the issue seems to be that: Encoding::Converter.search_convpath Encoding::ASCII_8BIT, Encoding::Emacs_Mule when running in the spec tests generates a silent SEGV. But the following does not (added Encoding::Converter.search_convpath Encoding::ASCII_8BIT.to_s, Encoding::Emacs_Mule.to_s The patch reverts the code I previously added that was somewhat 'out of character' for the suite... |
Sorry, I wasn't quite awake... Thanks for the patch. I briefly tried to repro it this morning. Can't create the SEGV outside of spec. Probably work on it tonite. Thanks for all your work on spec, the example numbers are now consistent. I've got one more patch that removes some MinGW guards. Travis is testing 2.3, but Appveyor will stick with 2.4? BTW, probably a wise choice, as Windows 2.3 builds are not current (they stopped at 2.3.3 and use older build tools). I'll move my code over to parallel.rb, and do some more testing in the next few days. I could set it up so Ever thought about adding a seed option? In other software, I've found it helpful when test runs were not consistent. The Thanks again, Greg |
PRs are welcome.
Does it not work currently? I'd be happy to accept a PR fixing it in that case.
Please file a new issue or PR for that :) |
Great :)
That sounds like a MRI bug, it would be great if you can find a reproduction and report a bug there.
Interesting, we should investiagte what is the root cause of this.
Right, that's harmless but I'd be happy to accept a PR removing those files for clarity (although some of them have examples, just exluced on Windows so those should remain obviously).
I'd love a PR to mspec for that :)
It's nicer for me and other ruby/spec contributors to review larger changes at ruby/spec.
Thanks! Note that I won't have much time for ruby/spec in the following weeks so I will be less responsive during October. |
they run no examples in 1 of 20 runs
I was thinking maybe something like change the file extension to
Everyone has been and has a right to be. I've got to re-write the multi thing for parallel.rb... |
@eregon
I'm re-writing ruby-loco, similar to what I helped with in Core. I've got a few spec patches that remove guards placed around tests for mingw.
But, I've only been testing with trunk, I'm now locally checking them with older Ruby versions. I need a guard to skip a test like
is :mingw and RUBY_VERSION < '2.4.0'
.Any suggestions or prefererence?
Re the Ruby version guards, it would be helpful if there was something like
less_than
andgreater_than
(orgreater_than_or equal
). Is there something similar to that?Lastly, I need to spend more time looking at all the options in mspec. Is there a way to output all skipped tests? In testing, the numbers jump around a little, but some may be due to parallel testing. BTW, things got a bit squirrely with
--random
...Thanks, Greg
The text was updated successfully, but these errors were encountered: