forked from mapasculturais/mapasculturais
-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/phpunit #28
Merged
Merged
Feature/phpunit #28
Changes from 11 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
5548f2d
Adiciona pipeline para executar testes unitários
lpirola 2c047ef
Pequenos ajustes para carregar o App pelo phpunit
lpirola 70bd12c
Atualiza ambiente de testes unitários
lpirola 3c5ea7b
Atualiza ambiente de testes unitários
lpirola 87085a7
fix WorkflowTest
LeonardoZanotti e0800ee
fixed request based tests
LeonardoZanotti eef466c
fixed port 8888
LeonardoZanotti af900d1
testSearch fixed
LeonardoZanotti 454318f
fixed APITest find events with predefined ID
LeonardoZanotti a2f974d
AgendaSingle Test removed
LeonardoZanotti bde736f
fixed run migrations
vicmagpac a0a3e24
Troca o gatilho para pipeline de testes ser executada em todos os com…
lpirola File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Testing | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- "develop" | ||
|
||
jobs: | ||
phpunit: | ||
strategy: | ||
matrix: | ||
operating-system: [ubuntu-20.04] | ||
php-versions: ["8.2"] | ||
runs-on: ${{ matrix.operating-system }} | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Add hosts to /etc/hosts | ||
run: | | ||
sudo echo "127.0.0.1 db" | sudo tee -a /etc/hosts | ||
|
||
- uses: hoverkraft-tech/[email protected] | ||
with: | ||
compose-file: "dev/docker-compose.yml" | ||
services: "db" | ||
up-flags: "-d" | ||
down-flags: "-v" | ||
|
||
- name: Install composer and dependencies | ||
uses: php-actions/composer@v6 | ||
|
||
- name: Run migrations | ||
run: | | ||
mkdir var/private-files/dbupdate_documento | ||
php src/tools/apply-updates.php | ||
env: | ||
APP_MODE: development | ||
|
||
- name: PHPUnit Tests | ||
uses: php-actions/phpunit@v3 | ||
env: | ||
XDEBUG_MODE: coverage | ||
with: | ||
configuration: phpunit.xml | ||
php_extensions: pdo_pgsql xdebug mbstring curl xml | ||
args: tests --coverage-clover ./coverage.xml | ||
|
||
- name: Upload to Codecov | ||
uses: codecov/codecov-action@v2 | ||
with: | ||
token: ${{ secrets.CODE_COV_TOKEN }} | ||
files: ./coverage.xml | ||
verbose: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lpirola analisando especificamente o momento de executar os testes fico pensando se faz sentido executar em todos os commits, dessa forma conseguimos identificar o problema de forma mais rápida. Vou mandar aqui alguns pontos positivos e negativos baseado das duas abordagens:
Vantagens:
Desvantagens:
Vantagens:
Desvantagens:
Para adicionar em todos os commits podemos usar:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
feito!