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

Separate optional test dependencies with Gemfiles #239

Merged
merged 1 commit into from
Oct 3, 2019
Merged

Conversation

JacobEvelyn
Copy link
Owner

@JacobEvelyn JacobEvelyn commented Sep 24, 2019

This commit adds a Gemfile.old which is used for testing
old Ruby versions in Travis. This file does not include
dependencies such as Rubocop and SimpleCov that are only
used in either local development or our Travis build for
the latest Ruby version.

Included in these changes is pinning the SimpleCov dependency
to the version fixed by
simplecov-ruby/simplecov#747 to fix tests.

@Shen-Sat was instrumental in
discussing these changes and coming up with many parts of
the overall approach. Many thanks!

Fixes #238


Hi there! Thanks so much for submitting a pull request!

Let's just make sure together that all of these boxes are checked before we
merge this change:

  • The code in these changes works correctly.
  • Code has tests as appropriate.
  • Code has been reviewed by @JacobEvelyn.
  • All tests pass on Travis CI.
  • Code coverage remains high.
  • Rubocop reports no issues on Travis CI.
  • The README.md file is updated as appropriate.

Don't worry—this list will get checked off in no time!

Repository owner deleted a comment from codecov bot Sep 24, 2019
@shen-sat
Copy link
Contributor

shen-sat commented Oct 2, 2019

Hey @JacobEvelyn, I'm just taking a nosy peek at this PR to understand why the tests are failing. I don't quite understand the test output:

1) Failure:
add nickname::when friend name has no matches#test_0001_prints an error message [/home/travis/build/JacobEvelyn/friends/test/helper.rb:118]:
--- expected
+++ actual
@@ -1,2 +1,2 @@
 "Error: No friend found for \"Garbage\"
-"
+SimpleCov failed with exit 1"

Am I correct in saying that this test (for example) failed because the app didn't give the correct output? If the correct output is "Error: No friend found for \"Garbage\", then what was the actual output?

And I'm guessing the line +SimpleCov failed with exit 1" is there because you've configured SimpleCov to exit with 1 if any of the tests fail?

Sorry for all the questions, just eager to understand what is going on so I can help in any way I can 🤓

Thanks!

@JacobEvelyn
Copy link
Owner Author

Hey @shen-sat, great questions. This is actually a dependency issue—simplecov introduced a change that added the SimpleCov failed with exit 1 message to STDERR, which is what's breaking tests. I wrote a much more detailed explanation in simplecov-ruby/simplecov#747 (comment), but let me know if I can explain anything more clearly there!

Re: the simplecov maintainer's suggestion of using Gemfiles for dev dependencies, that's not something I've seen before. Do you have any insight into the pros/cons of that approach (aside from that it would let tests pass once more)?

@shen-sat
Copy link
Contributor

shen-sat commented Oct 2, 2019

Hey @JacobEvelyn, thanks for your explanantion and the link to your PR - that cleared things up :)

I can't think of many cons - the code on github will eventually be the code on RubyGems right? And looking at the RubyGems security policy, there doesn't seem to be any added security when using RubyGems as a source as opposed to Github.

I guess the only con is that when using Github as a gem source then you're kind of constantly using it in "beta" mode ie any pull requests that get merged into master for SimpleCov will automatically be applied to SimpleCov in Friends, even if the pull request ends up breaking the gem somehow. Where as if you use RubyGems, then you will always be using "stable" releases, I guess..?

The Gemfile modification for using a github source for a gem seems simple enough. I've actually used exclusively Gemfiles for dependencies, so I'm happy to make a pull request for this if you want, and we can see it in action?

@codecov
Copy link

codecov bot commented Oct 3, 2019

Codecov Report

Merging #239 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           master    #239   +/-   ##
======================================
  Coverage    98.3%   98.3%           
======================================
  Files          23      23           
  Lines         709     709           
======================================
  Hits          697     697           
  Misses         12      12

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f0a44f4...e0e81e0. Read the comment docs.

This commit adds a `Gemfile.old` which is used for testing
old Ruby versions in Travis. This file does not include
dependencies such as Rubocop and SimpleCov that are only
used in either local development or our Travis build for
the latest Ruby version.

Included in these changes is pinning the SimpleCov dependency
to the version fixed by
simplecov-ruby/simplecov#747 to fix tests.

[@shen-sat](https://github.com/shen-sat) was instrumental in
discussing these changes and coming up with many parts of
the overall approach. Many thanks!

Fixes #238
@JacobEvelyn JacobEvelyn changed the title Fix tests in master Separate optional test dependencies with Gemfiles Oct 3, 2019
@JacobEvelyn
Copy link
Owner Author

Sure, @shen-sat, I'm open to trying it. One way to avoid the "beta" issue is to just pin simplecov to the specific commit we want. I wanted to include your commits from #240 to give you credit, but it got a bit too complicated to make that work so in the end I just took some of your ideas and gave you a shoutout in the commit message. I hope that's okay!

I also figured that with the other open PRs you have, you'll be an official contributor soon anyway! 🎉

The one thing I didn't add yet is the Dependabot config file. If Dependabot starts getting annoying I figured one of us is welcome to add that!

@JacobEvelyn JacobEvelyn merged commit a1cb48f into master Oct 3, 2019
@JacobEvelyn JacobEvelyn deleted the fix-tests branch October 3, 2019 15:04
@JacobEvelyn JacobEvelyn mentioned this pull request Oct 3, 2019
7 tasks
@shen-sat
Copy link
Contributor

shen-sat commented Oct 3, 2019

Ah, looks like I just missed out on my first merged pull request in OS 😢 But understandable! Most of all I'm glad the SimpleCov issue is fixed and I now have rubocop available to use locally - a clean slate for me to start building on top of 🙌 Thanks for the shout-out @JacobEvelyn, and I aim to be an official contributor soon ✊

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.

Tests are failing in main
2 participants