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

Fix tests for Ruby 2.4.0 #1077

Closed

Conversation

junaruga
Copy link
Contributor

@junaruga junaruga commented Feb 8, 2017

Summary

Fixes tests for Ruby 2.4.0.
This fixes #1071

I referred #1071 (comment) about how to fix

Details

Motivation and Context

Want to pass tests on Ruby 2.4.0.

How Has This Been Tested?

Same way with #1069 (comment)

$ bundle exec rake spec
...
568 examples, 0 failures

$ bundle exec rake cucumber
...
207 scenarios (207 passed)
1217 steps (1217 passed)
0m25.223s

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

  • [] New feature (non-breaking change which adds functionality)

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

    I changed from FeatureFolderNotFoundException(e, path) to FeatureFolderNotFoundException(path)

Checklist:

  • I've added tests for my code
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@junaruga junaruga changed the title Relax filter for "/usr/local/ruby-X.Y.Z/bin/bundle". Fix tests for Ruby 2.4.0 Feb 8, 2017
@junaruga junaruga force-pushed the feature/fix-tests-on-ruby2.4 branch 5 times, most recently from ab8224d to f40781a Compare February 8, 2017 18:52
@junaruga
Copy link
Contributor Author

junaruga commented Feb 8, 2017

Finally we passed the tests for Ruby 2.4.0.
About a script for Travis, I referred this page: https://docs.travis-ci.com/user/customizing-the-build/

before_script:
# Patch for Ruby 2.4.0 compatibility.
- ./scripts/patch_simplecov_0_12_0

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 it would be better to upgrade to simplecov 0.13. This issue should be fixed: https://github.com/colszowka/simplecov/blob/0.13.0/CHANGELOG.md

Copy link
Contributor Author

@junaruga junaruga Feb 10, 2017

Choose a reason for hiding this comment

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

@nodo yes of course using simplecov 0.13 is better if we can use it on Travis.
But right now we can not use it on Travis, as far as I know.
Because we are using latest version coveralls 0.8.19 in our cucumber-ruby.
And it needs simplecov 0.12.x.

Actually I tried to do something to use simplecov 0.13 at first on Traivs. but I failed to use it.

See Gemfile.lock file after bundle install --path vendor/bundle in your local environment.

Gemfile.lock

...
    coveralls (0.8.19)
      json (>= 1.8, < 3)
      simplecov (~> 0.12.0)
...

About this situation, I have reported to coveralls upstream github.
So, they may change their dependency to use simplecov 0.13.

So the script ./scripts/patch_simplecov_0_12_0 is temporary one to pass the test for Ruby 2.4.0.
After they may update coveralls, we can remove this script.

I could not see the simplecov warnings in my local environment.
I do not know why..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As a reference, running ./scripts/patch_simplecov_0_12_0 is same with patching simplecov-ruby/simplecov@050eb68

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See also https://github.com/lemurheavy/coveralls-ruby/blob/v0.8.19/coveralls-ruby.gemspec#L23
If coveralls new version with simplecov 0.13 will be released, we do not need this patch for simplecov.
It's also good to watch coveralls project for that.

def initialize(path)
super('No such file or directory - features')
@path = path
end
end
Copy link
Member

Choose a reason for hiding this comment

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

I am not sure why this change is needed. Please, can you tell which test is failing for this?

Copy link
Contributor Author

@junaruga junaruga Feb 10, 2017

Choose a reason for hiding this comment

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

@nodo because of fixing this issue #1071 (comment) (Reason of the issue is https://bugs.ruby-lang.org/issues/9285)

There are 2 possible ways to fix this issue. And @mattwynne prefer "2".

  1. Adding Cucumber::RUBY_2_4 in above logic (FeatureFolderNotFoundException class).
  2. Not extending FileException

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@nodo the failing test is features/docs/getting_started.feature:7 # Scenario: Run Cucumber in an empty directory (#1071)

The script should be removed after simplecov-0.13.0 is available for cucumber.
@junaruga
Copy link
Contributor Author

I think my solution for failure tests by simplecov warnings, was not good.
I would close this PR.
Thanks for taking time for this PR.

@junaruga junaruga closed this Feb 23, 2017
@lock
Copy link

lock bot commented Oct 25, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

features/docs/getting_started.feature:7 fails on Ruby 2.4.
2 participants