Skip to content

Commit

Permalink
Merge pull request #108 from lageIBUSP/relatorios
Browse files Browse the repository at this point in the history
Otimizações e testes
  • Loading branch information
Lobz authored May 1, 2024
2 parents 0bf41f3 + 65fb62c commit 736f1d2
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 38 deletions.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,18 @@ Os testes foram escritos para ajudar no desenvolvimento da plataforma. Todos os
Para testar e desenvolver a plataforma, instale o notaR no seu ambiente local para testes, seguindo o guia acima. Além disso, é necessário instalar o `npm`. Com isso, para abrir a interface gráfica do `cypress`, basta executar o seguinte comando:

```
npx cypress run
npx cypress open
```

Na interface gráfica, selecione **E2E Testing**, e um browser à sua escolha.

Para rodar todos os testes de uma vez, direto do terminal, rode:

```
npx cypress run
```


Para mais detalhes, consulte a [documentação do Cypress](https://docs.cypress.io/).

## Licença de uso
Expand Down
64 changes: 32 additions & 32 deletions database/seeders/DatabaseSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use App\Models\Nota;
use App\Models\Prazo;
use App\Models\Teste;
use Monolog\Handler\SamplingHandler;

class DatabaseSeeder extends Seeder
{
Expand All @@ -20,43 +21,42 @@ class DatabaseSeeder extends Seeder
public function run()
{
$ind_user = User::factory()->create();
$alunos = User::factory()->count(3)->create();
$turma = Turma::factory()
->hasAttached($alunos)
->create();
$alunos = User::factory()->count(30)->create();

$turma_vazia = Turma::factory()->create();

$exercicios = Exercicio::factory()->count(5)
->has(Teste::factory()->count(3))
->create();


Prazo::factory()
->for($turma)
->for($exercicios[1])
->create();
Prazo::factory()
->for($turma_vazia)
->for($exercicios[2])
$turmas = Turma::factory()->count(10)
->hasAttached($alunos)
->create();

Nota::factory()->count(2)
->for($ind_user)
->for($exercicios[1])
->create();
Nota::factory()->count(2)
->for($ind_user)
->for($exercicios[2])
->create();
Nota::factory()->count(2)
->for($alunos[1])
->for($exercicios[1])
->create();
Nota::factory()->count(2)
->for($alunos[2])
->for($exercicios[2])
$exercicios = Exercicio::factory()->count(30)
->has(Teste::factory()->count(3))
->create();


foreach ($exercicios as $exercicio) {
Nota::factory()->count(2)
->for($ind_user)
->for($exercicio)
->create();

Prazo::factory()
->for($turma_vazia)
->for($exercicio)
->create();

foreach ($turmas as $turma) {
Prazo::factory()
->for($turma)
->for($exercicio)
->create();
}

foreach ($alunos as $aluno) {
Nota::factory()->count(5)
->for($aluno)
->for($exercicio)
->create();
}
}
}
}
2 changes: 1 addition & 1 deletion deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ git pull
docker-compose down
docker-compose build
docker-compose up -d
docker exec -t notar_app_1 ./docker-deploy.sh
docker exec -t --env-file .env notar_app_1 ./docker-deploy.sh
15 changes: 11 additions & 4 deletions docker-deploy.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
#!/bin/sh

# Installs and upgrades any new PHP libraries
composer install
if [ "$APP_ENV" == "production" ]; then
composer install --no-dev -o
else
composer install
fi
# Makes sure our storage link is set up
php artisan storage:link
# Clear application and config caches
php artisan config:clear
php artisan cache:clear
# Runs any DB migration
php artisan migrate --force
# Clear and restart caches
php artisan cache:clear
php artisan config:cache
php artisan view:cache
php artisan route:cache
php artisan event:cache
1 change: 1 addition & 0 deletions tests/cypress/integration/01_admin_login.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ describe('Login test', () => {
// seed a user in the DB that we can control from our tests
cy.exec(`${artisan} migrate:fresh`)
cy.exec(`${artisan} migrate:admin ${password}`)
cy.exec(`${artisan} db:seed`)

})

Expand Down

0 comments on commit 736f1d2

Please sign in to comment.