-
Notifications
You must be signed in to change notification settings - Fork 65
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
Task for running (and enforcing passed) tests #117
Comments
Thanks to @radmen I was able to identify the problem. The tests were throwing deprecation notices that would let the process fail. The notices could be hidden by this configuration in <php>
<env name="SYMFONY_DEPRECATIONS_HELPER" value="weak" />
</php> Solution provided here by @BigZ: Symfony 2: set :tests_path, fetch(:app_path) + "/../tests"
set :vendor_path, fetch(:app_path) + "/../vendor"
namespace :deploy do
before :starting, "tasks:run_tests"
end
namespace :tasks do
task :run_tests do
run_locally do
execute :php, fetch(:vendor_path) + "/phpunit/phpunit/phpunit --configuration " + fetch(:app_path) + "/phpunit.xml " + fetch(:tests_path)
end
end
end If you are using the PHPUnit Bridge and Symfony >= 3: set :tests_path, "tests"
set :vendor_path, "vendor"
namespace :deploy do
before :starting, "tasks:run_tests"
end
namespace :tasks do
task :run_tests do
run_locally do
execute :php, fetch(:vendor_path) + "/bin/simple-phpunit --configuration phpunit.xml " + fetch(:tests_path)
end
end
end Anybody interested in adding this task to this repo? |
Hi @webdevilopers |
Thanks for the hint @BigZ ! |
Maybe it is an interesting feature to run unit tests either locally before deploying or on production after deploy.
I'm no ruby expert so this was my first approach:
Based on this question:
But I'm not sure how to get a return value to inform cap to continue. Currently this solution will stop deployment even when tests pass.
Trace:
The text was updated successfully, but these errors were encountered: