-
Notifications
You must be signed in to change notification settings - Fork 24
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
cage test <service>
can be misused
#65
Comments
@dkastner "antipattern" is the wrong word we're paving a cowpath, which is something that in fact, a lot of what |
I believe that:
The biggest limitation here is probably things like Rust containers, where there might be a two-container build process with no development tools in the final container. (Well, Alpine supports Rust now, so there are also one-container options.) But this raises all kinds of issues that I haven't yet figured out yet. I'm waiting for practical experience with an actual Rust cage service that I'm working on. |
First, what we're doing here with a shared test configuration is not something docker-compose refuses to upstream. There are other features cage provides where that is the case. Second, this is a dangerous cowpath that we should not encourage others to follow. Requiring other services to run in order to run your unit tests adds a lot of complexity.
Obviously, I agree with you here. But not that they should be run via a
I disagree but I can see an alternative where we keep The only reason we need |
In fact, I'd even go so far as to argue that we no longer need |
In the end, I'd rather just have a bare |
other things widely considered antipatterns that are still good ideas for some organizations because of culture or history:
|
From my perspective, that's definitely not why we have This is also because I feel that if we have a I am perfectly OK with a bare |
cage test <service>
is an antipatterncage test <service>
can be misused
We created
cage test <service>
for our own needs, but if we want cage to be an opinionated framework for multi-container apps that encourages best practices, we need to make this functionality more of a customization than an integral/recommended feature.The recommended setup ought to be that each service can run its own unit and integration tests independently from the rest of the other services.
Of course, you'd still want a test target that can run acceptance tests and any focused integration tests between a few services. But this test mode should not be relied on for independent service unit tests.
Example: We have a rails app called
web
. Inside there is a docker-compose.yml:And you can run tests with
docker-compose run prepare
and thendocker-compose run test
or individual RSpec tests withdocker-compose run test rspec spec/foo_spec.rb --fail-fast
The docker-compose.yml can be created by a future plugin system for generating apps.
The text was updated successfully, but these errors were encountered: