Open onnimonni opened 5 years ago
Something like this would be awesome:
with_service(:lambda) do
describe run(command: 'handler.hello'), retry: 1 do # disable retries here
its(:stdout) { should include 'Hello Ruby!' }
its(:stderr) { should eq '' }
end
describe run(command: 'handler.check_environment', environment: { HELLO: 'RUBY'}), retry: 1 do # disable retries here
its(:stdout) { should include '"HELLO"=>"RUBY"' }
its(:stderr) { should eq '' }
end
end
Which would run something similiar to:
$ docker-compose run --rm lambda handler.hello
$ docker-compose run -e HELLO=RUBY --rm lambda handler.check_enviroment
And I already did initial support for docker-compose.yml
version 3 into docker-compose-api
gem:
https://github.com/mauricioklein/docker-compose-api/pulls
I'm just not sure how to pass the contexts correctly inside dockerspec.
Dockerspec Version
0.5.0
Ruby Version
2.5.3
Platform Details
MacOS
Scenario
Steps to Reproduce
handler.rb
docker-compose.yml
:spec/lambda_spec.rb
:Expected Result
I know that this doesn't work. I'm willing to contribute on this feature but I'm in need of feedback.
How would you enhance this gem so that I could do multiple runs like these:
Actual Result
Currently it just fails because the lambda container stops immediately:
So the current way runs something similiar to
docker-compose exec service-name
. I would want to use something like thisdocker-compose --rm run service-name
multiple times.I know you must be busy but I would want to support this feature financially as well.