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
Remove "integration" from testing #8307
Conversation
Move more tests to describing what they test instead of how.
Move tests to "requests" directory. Another step in changeing tests to describe what is tested instead of how.
|
@guilleiguaran Yep, but we weren't moving closer to a resolution on the mailing list, so I thought I'd open a pull request. I'm happy to update the PR if a better name than "requests" can be agreed upon. |
|
I would stick with integration. I don't see a reason for changing if requests is all we can come up with. |
|
Well, the move is to change the naming from 'what kind of test is it' to 'what is it testing?' 'integration' is about the level of the test, and the parts of the stack you're exercising. Having 'integration' and 'model' tests are weird, having 'integration' and 'unit' tests makes sense, having 'request' and 'model' tests makes sense. |
|
I believe @steveklabnik has a good point. |
|
Using the point exposed by @steveklabnik, I think that 'system' is a better answer to the question 'what is it testing?' |
|
The reason to stick with 'request' is that this is what RSpec calls them. That said, I'd support 'system' too. |
|
I desire a concensus around a replacement for "integration", whether it be "requests" or something else. The viable options from the previous discussion are:
The reasons I think "requests" makes the most sense is that it is what rspec-rails uses. That means it has a certain amount of mindshare. It seems to be the strongest name, but I desire a concensus more than any particular name. Additionally, rspec-rails is introducing a new type named "features" for tests using Capybara. By separating the ActionDispatch-based tests from the Capybara-based tests it seems to clarify their purpose a bit more IMO. I plan on creating a gem to do something similar with capybara and minitest. |
|
I'm |
|
Ping. Can we get some more discussion on this? |
|
I like the name "integration." What is being tested? The integrations between multiple controllers. |
|
I would personally support "request" as well, not that my opinion carries any weight either ;-) I don't really care for "system" as it seems really generalized to me. "resources" sounds feasible, but I feel that the mindshare from "request" that rspec has established trumps that. But that's just my opinion, and I'm not even a contributor - just a user! :) All that said, I'll be the last person on Earth to complain no matter what it's called! |
|
This seems OK to me, but I don't have a very strong opinion. I'd prefer to defer to someone else (maybe @dhh) ? |
|
Appreciate the pull request, but we're not ready to do any mass-renaming at this point. Our http testing apis need some closer consideration. They're relics of a pre-rack rails, before middleware stacks were involved. It's time to reintegrate the separate APIs and use the integration tests' http-oriented API to test controllers. |
|
@jeremy Gotcha. Thanks for the update. How can I help? |
|
@blowmage The main drawback of integration testing setup is that it's slower than functional testing. So one way to help is to massively speed up integration tests. Profile the code and make it at least as fast as an equivalent functional test. Here's a start, comparing functional & integration tests of a simple action: Functional: Integration The integration tests are roughly 40% slower. Let's erase that gap! |
|
@blowmage if you're interested here's a couple of profiler charts I did to compare what's going on in an integration vs. functional test of a basic Integration TestFunctional Test |


Rails 4 has replaced the "unit" and "functional" names for tests and instead named the tests by what is being tested (models, controllers, helpers, etc). This pull request aims to continue that change by removing the name "integration" from the test classes and locations.
This pull request is a continuation of #7878. Instead of renaming "integration" to "acceptance", they are renamed to "requests".
attn: @spastorino, @tenderlove