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

Tests failing with Rails 5.2 RC1 #78

Open
paulmthiebauth opened this issue Feb 27, 2018 · 8 comments
Open

Tests failing with Rails 5.2 RC1 #78

paulmthiebauth opened this issue Feb 27, 2018 · 8 comments

Comments

@paulmthiebauth
Copy link

paulmthiebauth commented Feb 27, 2018

Currently upgrading an app from Rails 5.1 to Rails 5.2 RC1 and have started to run into some issues that don't exist on our primary/production branches. It appears that there are some issues with routes, as several tests are failing with No route matches /whatever although the routes are working fine (when looking at them in development environment), and Rails 5.1 branches pass these tests with no issues.

Something to note, when running the tests locally (they have some basic assert_routing statements) using bin/rails test test_name, they pass, however they fail when the same tests are run using bundle exec ruby -Itest. How is Minitest within Knapsack running the tests? Is there an internal issue with Knapsack and Rails 5.2?

Hoping you can help, thanks!

@ArturT
Copy link
Member

ArturT commented Feb 27, 2018

Hi @paulmthiebauth

Here you can see how minitest is run by knapsack https://github.com/ArturT/knapsack/blob/master/lib/knapsack/runners/minitest_runner.rb
Basically just the rake task is invoked.

Here is example rails app https://github.com/KnapsackPro/rails-app-with-knapsack
Could you try to upgrade to rails 5.2 and prepare example minitest test file that fails? Or you can prepare a new fresh rails 5.2 app with failing test so we could reproduce the issue.

@ArturT
Copy link
Member

ArturT commented Feb 27, 2018

There is actually rails5 branch here so you could use it https://github.com/KnapsackPro/rails-app-with-knapsack/commits/rails5

@paulmthiebauth
Copy link
Author

@ArturT Thanks for getting back to me, I'll work on this ASAP

@paulmthiebauth
Copy link
Author

@ArturT Im trying to bundle install but need a value for this line...what should I use?

This is in Gemfile

gem 'knapsack', path: ENV['KNAPSACK_REPO_PATH'] || '~/Documents/github/knapsack-pro/knapsack'

@ArturT
Copy link
Member

ArturT commented Feb 27, 2018

Please clone the https://github.com/ArturT/knapsack and use path to the directory with your local copy of knapsack. You can export KNAPSACK_REPO_PATH=/home/yourlogin/Documents/knapsack

@ArturT
Copy link
Member

ArturT commented Mar 3, 2018

I've upgraded rails to 5.2.0.rc1 on master. Feel free to use current master branch to reproduce the problem.

@david-fluxster
Copy link

david-fluxster commented Oct 12, 2022

Heya. Did anyone find an explanation for this? I am experiencing the same thing using Rails 6 and Rspec

EDIT: Some time later we discovered that for us, at least, the issue had nothing to do with Knapsack. Some of tests were modifying routes, and not reseting the routes back to default. If you run a single test locally, everything can appear to work, but if you run several tests in sequence locally you can produce an error as one test pollutes the application environment for the subsequent tests (by rewriting the routes)

@ArturT
Copy link
Member

ArturT commented Oct 13, 2022

The example project uses Rails 6
https://github.com/KnapsackPro/rails-app-with-knapsack

@david-fluxster Did you upgrade to Rails 6 recently? Or do you set up the knapsack gem for the first time?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants