Update CI/CD

This commit is contained in:
George Frederick "Buzz" Beurling
2020-06-21 12:15:32 -04:00
parent 5a019b2c92
commit 4539470537
6 changed files with 19 additions and 58 deletions

View File

@@ -11,8 +11,17 @@ variables:
stages: stages:
- build - build
- test
- deploy - deploy
- deploy
unit_test:
stage: test
script:
- cp .env.example .env
- composer install
- php artisan key:generate
- php artisan migrate
- vendor/bin/phpunit
build: build:
stage: build stage: build

View File

@@ -1 +1 @@
C:30:"PHPUnit\Runner\TestResultCache":187:{a:2:{s:7:"defects";a:1:{s:32:"Tests\Browser\UserTest::testUser";i:3;}s:5:"times";a:2:{s:34:"Tests\Browser\LoginTest::testLogin";d:5.605;s:32:"Tests\Browser\UserTest::testUser";d:14.139;}}} C:37:"PHPUnit\Runner\DefaultTestResultCache":272:{a:2:{s:7:"defects";a:2:{s:32:"Tests\Feature\AdminTest::testUrl";i:3;s:30:"Tests\Feature\ECCTest::testUrl";i:3;}s:5:"times";a:3:{s:32:"Tests\Feature\AdminTest::testUrl";d:0.098;s:30:"Tests\Feature\ECCTest::testUrl";d:0.014;s:33:"Tests\Feature\PublicTest::testUrl";d:0.03;}}}

View File

@@ -1,5 +1,5 @@
# Set the base image for subsequent instructions # Set the base image for subsequent instructions
FROM php:7.3 FROM php:7.4
# Update packages # Update packages
RUN apt-get update RUN apt-get update

View File

@@ -41,6 +41,7 @@
clone_repository_dev clone_repository_dev
run_composer_dev run_composer_dev
update_symlinks_dev update_symlinks_dev
remove_old_release_dev
@endstory @endstory
@story('deploy_227') @story('deploy_227')
@@ -160,6 +161,11 @@
@endtask @endtask
@task('remove_old_release_dev')
cd {{ $releases_dir_dev@ }}
rm -fr $(ls -t1 | tail -n +3)
@endtask
@task('clone_repository_227') @task('clone_repository_227')
echo 'Cloning repository' echo 'Cloning repository'
[ -d {{ $releases_dir_227 }} ] || mkdir {{ $releases_dir_227 }} [ -d {{ $releases_dir_227 }} ] || mkdir {{ $releases_dir_227 }}

View File

@@ -19,7 +19,7 @@ class AdminTest extends TestCase
$urls = [ $urls = [
'admin', 'admin',
'admin/calendar', 'admin/schedule',
'admin/message', 'admin/message',
'admin/message/add', 'admin/message/add',
'admin/inventory', 'admin/inventory',

View File

@@ -1,54 +0,0 @@
<?php
namespace Tests\Feature;
use Tests\TestCase;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\RefreshDatabase;
class ECCTest extends TestCase
{
/**
* A basic test example.
*
* @return void
*/
public function testUrl()
{
$appURL = "dev.c-cms.cf";
$urls = [
'ecc',
'ecc/calendar',
'ecc/messages',
'ecc/guide',
'ecc/update'
];
echo PHP_EOL;
foreach ($urls as $url) {
$response = $this->get($url);
if((int)$response->status() === 404){
echo $appURL . $url . ' (FAILED) return a 404.';
$this->assertTrue(false);
} else {
echo $appURL . $url . ' (SUCCESS)';
$this->assertTrue(true);
}
echo PHP_EOL;
}
foreach ($urls as $url) {
$response = $this->get($url);
if((int)$response->status() === 500){
echo $appURL . $url . ' (FAILED) return a 500.';
$this->assertTrue(false);
} else {
echo $appURL . $url . ' (SUCCESS)';
$this->assertTrue(true);
}
echo PHP_EOL;
}
}
}