From 6eef179a6709dbd70e56b97c8350af5aa89401e5 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 9 Mar 2017 17:23:56 +0200 Subject: [PATCH] Working on adding check-data to Travis --- .travis.yml | 27 ++++++++++++++------------- app/Console/Commands/CheckData.php | 5 ++++- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index 92bf4064b3..3c6b4778c2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -70,24 +70,25 @@ before_script: #- php artisan ninja:create-test-data 25 script: - - php ./vendor/codeception/codeception/codecept run --debug acceptance AllPagesCept.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance APICest.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance TaxRatesCest.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance CheckBalanceCest.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance ClientCest.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance ExpenseCest.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance CreditCest.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceCest.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance QuoteCest.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceDesignCest.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance OnlinePaymentCest.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance PaymentCest.php - - php ./vendor/codeception/codeception/codecept run --debug acceptance TaskCest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance AllPagesCept.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance APICest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance TaxRatesCest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance CheckBalanceCest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance ClientCest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance ExpenseCest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance CreditCest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceCest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance QuoteCest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance InvoiceDesignCest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance OnlinePaymentCest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance PaymentCest.php + #- php ./vendor/codeception/codeception/codecept run --debug acceptance TaskCest.php #- sed -i 's/NINJA_DEV=true/NINJA_PROD=true/g' .env #- php ./vendor/codeception/codeception/codecept run acceptance GoProCest.php after_script: + - php artisan ninja:check-data --no-interaction - cat .env - mysql -u root -e 'select * from accounts;' ninja - mysql -u root -e 'select * from account_gateways;' ninja diff --git a/app/Console/Commands/CheckData.php b/app/Console/Commands/CheckData.php index 8f72829028..fdb97a1b07 100644 --- a/app/Console/Commands/CheckData.php +++ b/app/Console/Commands/CheckData.php @@ -4,6 +4,7 @@ namespace App\Console\Commands; use Carbon; use DB; +use Exception; use Illuminate\Console\Command; use Mail; use Symfony\Component\Console\Input\InputOption; @@ -77,13 +78,15 @@ class CheckData extends Command $errorEmail = env('ERROR_EMAIL'); $this->info($this->log); - + throw new Exception('Check data failed!!'); if ($errorEmail) { Mail::raw($this->log, function ($message) use ($errorEmail) { $message->to($errorEmail) ->from(CONTACT_EMAIL) ->subject('Check-Data: ' . strtoupper($this->isValid ? RESULT_SUCCESS : RESULT_FAILURE)); }); + } elseif (! $this->isValid) { + throw new Exception('Check data failed!!'); } }