diff --git a/CHANGELOG.md b/CHANGELOG.md index f75eeaa..fbe9605 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,9 +8,11 @@ - Config for PHPStorm editor - Config for Sublime Text 3 editor - Config for Visual Studio Code editor +- Option to disable project on Dashboard ### Changed - Allow better configuration of editor's binary - Moved Laravel related classes out from Vendor\Laravel +- Completely restructure package directory ### Fixed - Abending when tester used in suite does not exists - Piper script not being diff --git a/LICENSE b/LICENSE.md similarity index 99% rename from LICENSE rename to LICENSE.md index e4e0277..b8cfe93 100644 --- a/LICENSE +++ b/LICENSE.md @@ -1,13 +1,13 @@ -Copyright (c) 2014, Antonio Carlos Ribeiro - -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Copyright (c) 2014, Antonio Carlos Ribeiro + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/composer.json b/composer.json index 3cf18d8..5e5418f 100644 --- a/composer.json +++ b/composer.json @@ -34,11 +34,11 @@ "autoload": { "psr-4": { - "PragmaRX\\TestsWatcher\\": "src/", + "PragmaRX\\TestsWatcher\\Package\\": "src/package", "PragmaRX\\TestsWatcher\\Tests\\": "tests/" }, "psr-0": { - "JasonLewis\\ResourceWatcher": "src/Support/jasonlewis/resource-watcher/src" + "JasonLewis\\ResourceWatcher": "src/package/Support/jasonlewis/resource-watcher/src" } }, @@ -46,7 +46,7 @@ "component": "package", "laravel": { "providers": [ - "PragmaRX\\TestsWatcher\\ServiceProvider" + "PragmaRX\\TestsWatcher\\Package\\ServiceProvider" ] } } diff --git a/src/Facade.php b/src/Facade.php deleted file mode 100644 index f4d3d3f..0000000 --- a/src/Facade.php +++ /dev/null @@ -1,37 +0,0 @@ -dataRepository = $dataRepository; - } - - /** - * Clear the runs table. - */ - public function clear() - { - $this->dataRepository->clearRuns(); - } -} diff --git a/src/config/ci.php b/src/config/ci.php index 5454b1a..2ee3f81 100644 --- a/src/config/ci.php +++ b/src/config/ci.php @@ -96,7 +96,7 @@ ], 'users' => [ - 'model' => PragmaRX\TestsWatcher\Entities\User::class, // App\User::class, + 'model' => PragmaRX\TestsWatcher\Package\Entities\User::class, // App\User::class, 'emails' => [ 'laravel-ci@mydomain.com', @@ -106,16 +106,16 @@ 'channels' => [ 'mail' => [ 'enabled' => false, - 'sender' => PragmaRX\TestsWatcher\Notifications\Channels\Mail::class, + 'sender' => PragmaRX\TestsWatcher\Package\Notifications\Channels\Mail::class, ], 'slack' => [ 'enabled' => true, - 'sender' => PragmaRX\TestsWatcher\Notifications\Channels\Slack::class, + 'sender' => PragmaRX\TestsWatcher\Package\Notifications\Channels\Slack::class, ], ], - 'notifier' => 'PragmaRX\TestsWatcher\Notifications', + 'notifier' => 'PragmaRX\TestsWatcher\Package\Notifications', ], /* diff --git a/src/migrations/.gitkeep b/src/database/migrations/.gitkeep similarity index 100% rename from src/migrations/.gitkeep rename to src/database/migrations/.gitkeep diff --git a/src/migrations/2014_11_14_200000_create_ci_testers_table.php b/src/database/migrations/2014_11_14_200000_create_ci_testers_table.php similarity index 100% rename from src/migrations/2014_11_14_200000_create_ci_testers_table.php rename to src/database/migrations/2014_11_14_200000_create_ci_testers_table.php diff --git a/src/migrations/2014_11_14_300000_create_ci_projects_table.php b/src/database/migrations/2014_11_14_300000_create_ci_projects_table.php similarity index 100% rename from src/migrations/2014_11_14_300000_create_ci_projects_table.php rename to src/database/migrations/2014_11_14_300000_create_ci_projects_table.php diff --git a/src/migrations/2014_11_14_400000_create_ci_suites_table.php b/src/database/migrations/2014_11_14_400000_create_ci_suites_table.php similarity index 100% rename from src/migrations/2014_11_14_400000_create_ci_suites_table.php rename to src/database/migrations/2014_11_14_400000_create_ci_suites_table.php diff --git a/src/migrations/2014_11_14_500000_create_ci_tests_table.php b/src/database/migrations/2014_11_14_500000_create_ci_tests_table.php similarity index 100% rename from src/migrations/2014_11_14_500000_create_ci_tests_table.php rename to src/database/migrations/2014_11_14_500000_create_ci_tests_table.php diff --git a/src/migrations/2014_11_14_700000_create_ci_queue_table.php b/src/database/migrations/2014_11_14_700000_create_ci_queue_table.php similarity index 100% rename from src/migrations/2014_11_14_700000_create_ci_queue_table.php rename to src/database/migrations/2014_11_14_700000_create_ci_queue_table.php diff --git a/src/migrations/2014_11_14_800000_create_ci_runs_table.php b/src/database/migrations/2014_11_14_800000_create_ci_runs_table.php similarity index 100% rename from src/migrations/2014_11_14_800000_create_ci_runs_table.php rename to src/database/migrations/2014_11_14_800000_create_ci_runs_table.php diff --git a/src/migrations/2017_09_25_800001_create_runs_indexes.php b/src/database/migrations/2017_09_25_800001_create_runs_indexes.php similarity index 100% rename from src/migrations/2017_09_25_800001_create_runs_indexes.php rename to src/database/migrations/2017_09_25_800001_create_runs_indexes.php diff --git a/src/migrations/2017_09_27_800002_create_runs_start_end.php b/src/database/migrations/2017_09_27_800002_create_runs_start_end.php similarity index 100% rename from src/migrations/2017_09_27_800002_create_runs_start_end.php rename to src/database/migrations/2017_09_27_800002_create_runs_start_end.php diff --git a/src/migrations/2017_09_30_800003_add_uses_tee.php b/src/database/migrations/2017_09_30_800003_add_uses_tee.php similarity index 100% rename from src/migrations/2017_09_30_800003_add_uses_tee.php rename to src/database/migrations/2017_09_30_800003_add_uses_tee.php diff --git a/src/migrations/2017_09_30_800004_add_screenshots.php b/src/database/migrations/2017_09_30_800004_add_screenshots.php similarity index 100% rename from src/migrations/2017_09_30_800004_add_screenshots.php rename to src/database/migrations/2017_09_30_800004_add_screenshots.php diff --git a/src/migrations/2017_10_01_800005_add_regex_pattern.php b/src/database/migrations/2017_10_01_800005_add_regex_pattern.php similarity index 100% rename from src/migrations/2017_10_01_800005_add_regex_pattern.php rename to src/database/migrations/2017_10_01_800005_add_regex_pattern.php diff --git a/src/migrations/2017_10_01_800006_add_test_path.php b/src/database/migrations/2017_10_01_800006_add_test_path.php similarity index 100% rename from src/migrations/2017_10_01_800006_add_test_path.php rename to src/database/migrations/2017_10_01_800006_add_test_path.php diff --git a/src/migrations/2017_10_08_800007_add_require_script.php b/src/database/migrations/2017_10_08_800007_add_require_script.php similarity index 100% rename from src/migrations/2017_10_08_800007_add_require_script.php rename to src/database/migrations/2017_10_08_800007_add_require_script.php diff --git a/src/migrations/2017_10_09_800008_add_sha1.php b/src/database/migrations/2017_10_09_800008_add_sha1.php similarity index 100% rename from src/migrations/2017_10_09_800008_add_sha1.php rename to src/database/migrations/2017_10_09_800008_add_sha1.php diff --git a/src/migrations/2017_10_10_800009_add_env.php b/src/database/migrations/2017_10_10_800009_add_env.php similarity index 100% rename from src/migrations/2017_10_10_800009_add_env.php rename to src/database/migrations/2017_10_10_800009_add_env.php diff --git a/src/migrations/2017_10_10_800010_add_editor.php b/src/database/migrations/2017_10_10_800010_add_editor.php similarity index 100% rename from src/migrations/2017_10_10_800010_add_editor.php rename to src/database/migrations/2017_10_10_800010_add_editor.php diff --git a/src/migrations/2017_10_11_800011_add_sha1_index.php b/src/database/migrations/2017_10_11_800011_add_sha1_index.php similarity index 100% rename from src/migrations/2017_10_11_800011_add_sha1_index.php rename to src/database/migrations/2017_10_11_800011_add_sha1_index.php diff --git a/src/migrations/2017_10_11_800012_add_project_enabled.php b/src/database/migrations/2017_10_11_800012_add_project_enabled.php similarity index 100% rename from src/migrations/2017_10_11_800012_add_project_enabled.php rename to src/database/migrations/2017_10_11_800012_add_project_enabled.php diff --git a/src/Console/Commands/BaseCommand.php b/src/package/Console/Commands/BaseCommand.php similarity index 85% rename from src/Console/Commands/BaseCommand.php rename to src/package/Console/Commands/BaseCommand.php index 75d86d7..af0dbb6 100644 --- a/src/Console/Commands/BaseCommand.php +++ b/src/package/Console/Commands/BaseCommand.php @@ -1,6 +1,6 @@ belongsTo('PragmaRX\TestsWatcher\Entities\Test'); + return $this->belongsTo('PragmaRX\TestsWatcher\Package\Entities\Test'); } } diff --git a/src/Entities/Run.php b/src/package/Entities/Run.php similarity index 88% rename from src/Entities/Run.php rename to src/package/Entities/Run.php index c354974..9c6d9ba 100644 --- a/src/Entities/Run.php +++ b/src/package/Entities/Run.php @@ -1,6 +1,6 @@ belongsTo('PragmaRX\TestsWatcher\Entities\Project'); + return $this->belongsTo('PragmaRX\TestsWatcher\Package\Entities\Project'); } /** @@ -52,7 +52,7 @@ public function project() */ public function tester() { - return $this->belongsTo('PragmaRX\TestsWatcher\Entities\Tester'); + return $this->belongsTo('PragmaRX\TestsWatcher\Package\Entities\Tester'); } /** @@ -62,7 +62,7 @@ public function tester() */ public function tests() { - return $this->hasMany('PragmaRX\TestsWatcher\Entities\Test'); + return $this->hasMany('PragmaRX\TestsWatcher\Package\Entities\Test'); } /** diff --git a/src/Entities/Test.php b/src/package/Entities/Test.php similarity index 86% rename from src/Entities/Test.php rename to src/package/Entities/Test.php index 3b6ab84..a909de4 100644 --- a/src/Entities/Test.php +++ b/src/package/Entities/Test.php @@ -1,6 +1,6 @@ belongsTo('PragmaRX\TestsWatcher\Entities\Suite'); + return $this->belongsTo('PragmaRX\TestsWatcher\Package\Entities\Suite'); } /** @@ -57,7 +57,7 @@ public function getTestCommandAttribute($value) */ public function runs() { - return $this->hasMany('PragmaRX\TestsWatcher\Entities\Run'); + return $this->hasMany('PragmaRX\TestsWatcher\Package\Entities\Run'); } /** diff --git a/src/Entities/Tester.php b/src/package/Entities/Tester.php similarity index 87% rename from src/Entities/Tester.php rename to src/package/Entities/Tester.php index 330f0e3..0afecdb 100644 --- a/src/Entities/Tester.php +++ b/src/package/Entities/Tester.php @@ -1,6 +1,6 @@ loadMigrationsFrom(__DIR__.'/migrations'); + $this->loadMigrationsFrom(__DIR__.'/../database/migrations'); } /** @@ -50,7 +50,7 @@ private function loadMigrations() */ private function loadViews() { - $this->loadViewsFrom(__DIR__.'/resources/views', 'pragmarx/ci'); + $this->loadViewsFrom(__DIR__.'/../resources/views', 'pragmarx/ci'); } /** @@ -59,7 +59,7 @@ private function loadViews() private function publishConfiguration() { $this->publishes([ - __DIR__.'/config/ci.php' => config_path('ci.php'), + __DIR__.'/../config/ci.php' => config_path('ci.php'), ]); } @@ -71,7 +71,7 @@ private function publishConfiguration() public function register() { if (!defined('CI_PATH')) { - define('CI_PATH', realpath(__DIR__.'/../')); + define('CI_PATH', realpath(__DIR__.'/../../')); } $this->registerResourceWatcher(); @@ -165,7 +165,7 @@ private function registerTestCommand() private function registerService() { $this->app->singleton('ci', function ($app) { - return app('PragmaRX\TestsWatcher\Service'); + return app('PragmaRX\TestsWatcher\Package\Service'); }); } @@ -175,7 +175,7 @@ private function registerService() private function registerWatcher() { $this->app->singleton('ci.watcher', function ($app) { - return app('PragmaRX\TestsWatcher\Services\Watcher'); + return app('PragmaRX\TestsWatcher\Package\Services\Watcher'); }); } @@ -185,7 +185,7 @@ private function registerWatcher() private function registerTester() { $this->app->singleton('ci.tester', function ($app) { - return app('PragmaRX\TestsWatcher\Services\Tester'); + return app('PragmaRX\TestsWatcher\Package\Services\Tester'); }); } @@ -204,10 +204,10 @@ private function loadRoutes() { Route::group([ 'prefix' => config('ci.url_prefix'), - 'namespace' => 'PragmaRX\TestsWatcher\Http\Controllers', + 'namespace' => 'PragmaRX\TestsWatcher\Package\Http\Controllers', 'middleware' => 'web', ], function () { - $this->loadRoutesFrom(__DIR__.'/routes/web.php'); + $this->loadRoutesFrom(__DIR__.'/../routes/web.php'); }); } diff --git a/src/Services/Base.php b/src/package/Services/Base.php similarity index 94% rename from src/Services/Base.php rename to src/package/Services/Base.php index 339bbe4..3b01ac2 100644 --- a/src/Services/Base.php +++ b/src/package/Services/Base.php @@ -1,6 +1,6 @@