-
Notifications
You must be signed in to change notification settings - Fork 554
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
add_group() sees files in 0.17.0 but does not in 0.18.1 #860
Comments
👋 Hi @JonJagger ! Thanks for your report! I have a hunch that this might be due to you calling I'm guessing that with One more thing, you should be able to call both |
🤝 With 0.17.0, this works:
It sees both Switching to 0.18.1 Thanks. |
@JonJagger hm that's... interesting. And weird. I have no idea how/why that is happening 🤷♂️ How do you run your tests? Aka what command is used? Where is the test setting invoked? You don't happen to have a small repro reproducing it? I can try to reproduce it, but I fear I'll be out of luck because if we generally skipped e.g. https://github.com/colszowka/simplecov/blob/master/features/test_unit_basic.feature specifically tests they show up. |
I will try to put together a small repo that reproduces the problem... |
Sure, no hurry. Would be great if you did, otherwise reproduction is sadly quite hard :( If you want to be extra cool, there's a |
Had an unexpected few hours this evening... |
@JonJagger thank you! 💚 For reference, you didn't manage to reproduce it without docker did you? I'll try without first and then well install docker and do that dance when I got time :) |
No. I do everything inside docker nowadays. It is awesome. |
@PragTob I'm still really hoping we can resolve this error together somehow. It is usually very easy to install docker. Once you've done that you'll be able to follow the readme on the repo I created: Run one script. Edit one file. Run the script again. That way you would at least have replicated the error :-) |
@JonJagger hey, yeah I know and have used docker but my experiences have been.. mixed. Just didn't have it on my desktop before, but Corona has changed that as well. I should be fine. I guess I'll have to put together a day/half a day one of these days to iron out some issues and make a new release. Still feel free to ping me again if I haven't in the next ~2 weeks 🤞 (albeit life is also relatively hectic these days) |
Will do. Thanks :-) |
@JonJagger hey I tried debugging it but I believe the shell script is mac specific (at least it fails for me), at least I don't have an However, while trying to then run it myself I noticed that the app with the Gemfile is in a separate folder from the test directory and a |
Hi Tobias. Got your comment. Ah rats. A missing bash source command :( |
I ran it again. Same result. |
Hmmm. The reason for you getting a no |
@JonJagger will try later. But it's not released yet, so do |
@PragTob Alas adding the github: option to my Gemfile did not work. The output included this...
but
Ach so close! |
@JonJagger it's not there as a normal gem. Try |
I added the 'bundle exec' to the test-script execution (and pushed it to the repo). That gets me the gem :-) |
@JonJagger ah damn :( script still doesn't work for me as well :( DOCKER_MACHINE_NAME is unbound
|
Ah that's a different error. Sorry. I've pushed a fix. Thanks. |
Hi @PragTob |
@JonJagger 👋 thanks for the nudge. Script's still not working for me 😅 I already added
|
So I tried running it without the script etc. and replicating what the script does but simplified. So I created require_relative 'coverage'
require_relative 'server/creator_test' Running it still errors out: tobi@speedy:~/github/possible-simplecov-bug(master)$ bundle exec ruby test/tests.rb
Run options: --seed 9406
# Running:
.
Finished in 0.000415s, 2409.0697 runs/s, 2409.0697 assertions/s.
1 runs, 1 assertions, 0 failures, 0 errors, 0 skips
/home/tobi/.asdf/installs/ruby/2.7.0/lib/ruby/2.7.0/delegate.rb
/home/tobi/.asdf/installs/ruby/2.7.0/lib/ruby/2.7.0/mutex_m.rb
/home/tobi/.asdf/installs/ruby/2.7.0/lib/ruby/2.7.0/optparse.rb
/home/tobi/.asdf/installs/ruby/2.7.0/lib/ruby/2.7.0/tempfile.rb
/home/tobi/.asdf/installs/ruby/2.7.0/lib/ruby/2.7.0/tmpdir.rb
/home/tobi/.asdf/installs/ruby/2.7.0/lib/ruby/gems/2.7.0/gems/minitest-5.14.1/lib/minitest.rb
/home/tobi/.asdf/installs/ruby/2.7.0/lib/ruby/gems/2.7.0/gems/minitest-5.14.1/lib/minitest/assertions.rb
/home/tobi/.asdf/installs/ruby/2.7.0/lib/ruby/gems/2.7.0/gems/minitest-5.14.1/lib/minitest/autorun.rb
/home/tobi/.asdf/installs/ruby/2.7.0/lib/ruby/gems/2.7.0/gems/minitest-5.14.1/lib/minitest/expectations.rb
/home/tobi/.asdf/installs/ruby/2.7.0/lib/ruby/gems/2.7.0/gems/minitest-5.14.1/lib/minitest/mock.rb
/home/tobi/.asdf/installs/ruby/2.7.0/lib/ruby/gems/2.7.0/gems/minitest-5.14.1/lib/minitest/parallel.rb
/home/tobi/.asdf/installs/ruby/2.7.0/lib/ruby/gems/2.7.0/gems/minitest-5.14.1/lib/minitest/pride_plugin.rb
/home/tobi/.asdf/installs/ruby/2.7.0/lib/ruby/gems/2.7.0/gems/minitest-5.14.1/lib/minitest/spec.rb
/home/tobi/.asdf/installs/ruby/2.7.0/lib/ruby/gems/2.7.0/gems/minitest-5.14.1/lib/minitest/test.rb
/home/tobi/.asdf/installs/ruby/2.7.0/lib/ruby/gems/2.7.0/gems/minitest-5.14.1/lib/minitest/unit.rb
/home/tobi/github/possible-simplecov-bug/app/src/creator.rb
/home/tobi/github/possible-simplecov-bug/test/server/creator_test.rb
Coverage report generated for Unit Tests to /home/tobi/github/possible-simplecov-bug/coverage. 1046 / 2124 LOC (49.25%) covered. But even with When I use it from master, the file is seen but also doesn't show up in the category (I guess the regex is wrong):
So I can't detect anything wrong right now. |
Ok. We are close now! (I think)
This is from
when Thanks. I really appreciate your patience on this. |
alrighty, confirmed it doesn't show up anymore. I'm inclined to believe it might be the default root_filter we started including. Pkay nah that was always there. strange. |
When I comment out the |
Alright. So this is fun and broken on many different levels 🤔
Future fix:
Current possible workarounds (or so I believe):
Simplecov fixes for now:
|
Ok. That's for the report. I will ponder what to do. It should be relatively painless to docker volume-mount the tests to a different directory. |
@JonJagger each one should work by itself, all granted my understanding of the problem is complete. Virtually every ruby project I've ever seen goes: project_name
so all in one, that's what I'd recommend. All in all, it's also all bugs and I'm somewhat confident I'll fix and release them within the next 3 weeks. |
@PragTob I'll hang on for a root = '/' fix. |
I'm running some Ruby tests inside a docker container (Alpine 3.11)
The version of ruby inside the container is 2.6.5p114
My code is in a dir called /app (inside the image).
My tests are in a dir called /test (volume-mounted).
Note: the tests are not underneath the /app dir (and that is how I prefer it).
I get coverage of both the code (in /app) and the tests (in /test).
My coverage is setup like this..
My Gemfile.lock shows
All works fine.
I get coverage of the code.
I also get coverage of the tests (easy to keep this at 100%!)
:-)
When I move to simplecov 0.18.1 and leave everything else the same I am no longer getting any coverage of my tests (in /test). Uncommenting the line
shows that no /test/files are being seen at all.
The text was updated successfully, but these errors were encountered: