Skip to content

Commit

Permalink
test(servidor): evitar exceder los limites de memoria
Browse files Browse the repository at this point in the history
La librería Eloquence utiliza una cantidad excesiva de memoria RAM (memory leak), lo que provoca un error fatal (Allowed memory size of 134217728 bytes exhausted) cuando se ejecutan los tests
  • Loading branch information
MatiasOlivera committed Sep 17, 2019
1 parent 2a3359c commit eef6621
Show file tree
Hide file tree
Showing 13 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ jobs:
- run: cd server && php artisan migrate --env=testing --force

# ejecutar los tests unitarios
- run: cd server && phpdbg -qrr vendor/bin/phpunit --coverage-clover=coverage/clover.xml
- run: cd server && phpdbg -qrr vendor/bin/phpunit --coverage-clover=coverage/clover.xml -d memory_limit=512M
- store_artifacts:
path: server/coverage/clover.xml
# subir la cobertura del código a codecov
Expand Down
2 changes: 2 additions & 0 deletions server/tests/Feature/app/ClienteDomicilioTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
use Tests\TestCase;
use App\ClienteDomicilio;
use Illuminate\Foundation\Testing\WithFaker;
use Tests\Feature\Utilidades\EloquenceSolucion;
use Illuminate\Foundation\Testing\RefreshDatabase;

class ClienteDomicilioTest extends TestCase
{
use RefreshDatabase;
use EloquenceSolucion;

public function test_deberia_acceder_a_la_relacion_cotizaciones()
{
Expand Down
2 changes: 2 additions & 0 deletions server/tests/Feature/app/ClienteRazonSocialTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
use Tests\TestCase;
use App\ClienteRazonSocial;
use Illuminate\Foundation\Testing\WithFaker;
use Tests\Feature\Utilidades\EloquenceSolucion;
use Illuminate\Foundation\Testing\RefreshDatabase;

class ClienteRazonSocialTest extends TestCase
{
use RefreshDatabase;
use EloquenceSolucion;

public function test_deberia_acceder_a_la_relacion_cotizaciones()
{
Expand Down
2 changes: 2 additions & 0 deletions server/tests/Feature/app/ClienteTelefonoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
use Tests\TestCase;
use App\ClienteTelefono;
use Illuminate\Foundation\Testing\WithFaker;
use Tests\Feature\Utilidades\EloquenceSolucion;
use Illuminate\Foundation\Testing\RefreshDatabase;

class ClienteTelefonoTest extends TestCase
{
use RefreshDatabase;
use EloquenceSolucion;

public function test_deberia_acceder_a_la_relacion_cotizaciones()
{
Expand Down
2 changes: 2 additions & 0 deletions server/tests/Feature/app/ClienteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
use App\Cotizacion;
use Tests\TestCase;
use Illuminate\Foundation\Testing\WithFaker;
use Tests\Feature\Utilidades\EloquenceSolucion;
use Illuminate\Foundation\Testing\RefreshDatabase;

class ClienteTest extends TestCase
{
use RefreshDatabase;
use EloquenceSolucion;

public function test_deberia_acceder_a_la_relacion_cotizaciones()
{
Expand Down
2 changes: 2 additions & 0 deletions server/tests/Feature/app/CotizacionEstadoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@
use Tests\TestCase;
use App\CotizacionEstado;
use Illuminate\Foundation\Testing\WithFaker;
use Tests\Feature\Utilidades\EloquenceSolucion;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\Feature\Utilidades\EstructuraCotizacionEstado;

class CotizacionEstadoTest extends TestCase
{
use RefreshDatabase;
use EloquenceSolucion;
use EstructuraCotizacionEstado;

public function test_deberia_crear_un_estado()
Expand Down
2 changes: 2 additions & 0 deletions server/tests/Feature/app/CotizacionProductoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@
use CotizacionEstadoSeeder;
use CategoriaProductoSeeder;
use Illuminate\Foundation\Testing\WithFaker;
use Tests\Feature\Utilidades\EloquenceSolucion;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\Feature\Utilidades\EstructuraCotizacionProducto;

class CotizacionProductoTest extends TestCase
{
use RefreshDatabase;
use EloquenceSolucion;
use EstructuraCotizacionProducto;

protected function setUp(): void
Expand Down
2 changes: 2 additions & 0 deletions server/tests/Feature/app/CotizacionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@
use App\CotizacionProducto;
use CategoriaProductoSeeder;
use Illuminate\Foundation\Testing\WithFaker;
use Tests\Feature\Utilidades\EloquenceSolucion;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\Feature\Utilidades\EstructuraCotizacion;

class CotizacionTest extends TestCase
{
use RefreshDatabase;
use EloquenceSolucion;
use EstructuraCotizacion;

protected function setUp(): void
Expand Down
2 changes: 2 additions & 0 deletions server/tests/Feature/app/EmpleadoCargoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@
use Tests\TestCase;
use App\EmpleadoCargo;
use Illuminate\Foundation\Testing\WithFaker;
use Tests\Feature\Utilidades\EloquenceSolucion;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\Feature\Utilidades\EstructuraEmpleadoCargo;

class EmpleadoCargoTest extends TestCase
{
use RefreshDatabase;
use EloquenceSolucion;
use EstructuraEmpleadoCargo;

public function test_deberia_crear_un_cargo()
Expand Down
2 changes: 2 additions & 0 deletions server/tests/Feature/app/EmpleadoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@
use Tests\TestCase;
use App\EmpleadoCargo;
use Illuminate\Foundation\Testing\WithFaker;
use Tests\Feature\Utilidades\EloquenceSolucion;
use Tests\Feature\Utilidades\EstructuraEmpleado;
use Illuminate\Foundation\Testing\RefreshDatabase;

class EmpleadoTest extends TestCase
{
use RefreshDatabase;
use EloquenceSolucion;
use EstructuraEmpleado;

public function test_deberia_crear_un_empleado()
Expand Down
2 changes: 2 additions & 0 deletions server/tests/Feature/app/PedidoEstadoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@
use Tests\TestCase;
use App\PedidoEstado;
use Illuminate\Foundation\Testing\WithFaker;
use Tests\Feature\Utilidades\EloquenceSolucion;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\Feature\Utilidades\EstructuraPedidoEstado;

class PedidoEstadoTest extends TestCase
{
use RefreshDatabase;
use EloquenceSolucion;
use EstructuraPedidoEstado;

public function test_deberia_crear_un_estado()
Expand Down
2 changes: 2 additions & 0 deletions server/tests/Feature/app/PedidoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@
use App\ClienteRazonSocial;
use Illuminate\Foundation\Testing\WithFaker;
use Tests\Feature\Utilidades\EstructuraPedido;
use Tests\Feature\Utilidades\EloquenceSolucion;
use Illuminate\Foundation\Testing\RefreshDatabase;

class PedidoTest extends TestCase
{
use RefreshDatabase;
use EstructuraPedido;
use EloquenceSolucion;

public function test_deberia_crear_un_pedido()
{
Expand Down
2 changes: 2 additions & 0 deletions server/tests/Feature/app/ProductoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
use App\CotizacionProducto;
use CategoriaProductoSeeder;
use Illuminate\Foundation\Testing\WithFaker;
use Tests\Feature\Utilidades\EloquenceSolucion;
use Tests\Feature\Utilidades\EstructuraProducto;
use Illuminate\Foundation\Testing\RefreshDatabase;

class ProductoTest extends TestCase
{
use RefreshDatabase;
use EloquenceSolucion;
use EstructuraProducto;

protected function setUp(): void
Expand Down

0 comments on commit eef6621

Please sign in to comment.