Skip to content
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

Testes Unitários - Solicitar Metadados. #731

Open
4 tasks
amelquia opened this issue Nov 25, 2024 · 9 comments
Open
4 tasks

Testes Unitários - Solicitar Metadados. #731

amelquia opened this issue Nov 25, 2024 · 9 comments
Assignees
Labels
melhoria New feature or request

Comments

@amelquia
Copy link

Sua solicitação de melhoria está relacionada a um problema? Por favor descreva.

Não.


Descreva a solução que você gostaria

Executar testes unitários para o método solicitarMetadados


Critérios de aceite:

  • Configurar o ambiente de testes, incluindo dependências e mocks necessários.
  • Casos de sucesso (retorno esperado).
  • Casos de erro (tratamento de exceções).

Definição de Feito (D.O.D. - Definition of Done)

  • Evidências dos testes realizados.

Links úteis

https://homolog.api.processoeletronico.gov.br/swagger/swagger-ui/index.html#/


@amelquia amelquia added the melhoria New feature or request label Nov 25, 2024
@Mauro1706 Mauro1706 self-assigned this Dec 5, 2024
@Mauro1706
Copy link
Contributor

Realizado a implementação do teste no PR:
ModTramitaGovBR -> #749

Segue evidências dos testes:
https://github.com/user-attachments/assets/46c54882-3639-4cbd-b38d-40e3bc3c944f

@sergioadao
Copy link

Bom dia @amelquia , @Mauro1706 e @mateussbh ....segue evidência do funcionamento correto do teste:

$ make test-unit teste=ProcessoEletronicoRN/SolicitarMetadadosTest

Ambiente: SEI 4.0.12.15
Banco SQLServer
Branch feat/rest

$ make test-unit teste=ProcessoEletronicoRN/SolicitarMetadadosTest
docker compose -f tests_super/funcional/docker-compose.yml run --rm -w /tests php-test-unit bash -c 'XDEBUG_MODE=coverage vendor/bin/phpunit --testdox --coverage-html html rn/ProcessoEletronicoRN/SolicitarMetadadosTest.php'
WARN[0000] /home/toor/Documentos/ministerio_economia/aplicacao_sei/sei_versoes/sei-trad-4.0.12.15/src/sei/web/modulos/mod-sei-pen/tests_super/funcional/docker-compose.yml: the attribute version is obsolete, it will be ignored, please remove it to avoid potential confusion
PHPUnit 9.6.21 by Sebastian Bergmann and contributors.

Runtime: PHP 7.3.33 with Xdebug 3.0.4
Configuration: /tests/phpunit.xml

Solicitar Metadados
✔ Solicitar metadados retorna objeto correto 52 ms
✔ Solicitar metadados lanca excecao 6 ms

Time: 00:01.763, Memory: 36.00 MB

OK (2 tests, 7 assertions)

Generating code coverage report in Cobertura XML format ... done [00:14.226]

Generating code coverage report in HTML format ... done [00:02.954]

====================================================================================

@sergioadao
Copy link

Boa tarde @amelquia , @Mauro1706 e @mateussbh ....segue evidência do funcionamento correto do teste:

$ make test-unit teste=ProcessoEletronicoRN/SolicitarMetadadosTest

Ambiente: SEI 4.1.2
Banco SQLServer
Branch feat/rest

$ make test-unit teste=ProcessoEletronicoRN/SolicitarMetadadosTest
docker compose -f tests_sei41/funcional/docker-compose.yml run --rm -w /tests php-test-unit bash -c 'XDEBUG_MODE=coverage vendor/bin/phpunit --testdox --coverage-html html rn/ProcessoEletronicoRN/SolicitarMetadadosTest.php'
WARN[0000] /home/toor/Documentos/ministerio_economia/aplicacao_sei/sei_versoes/sei-trad-4.1.2/sei/web/modulos/mod-sei-pen/tests_sei41/funcional/docker-compose.yml: the attribute version is obsolete, it will be ignored, please remove it to avoid potential confusion
PHPUnit 9.6.21 by Sebastian Bergmann and contributors.

Runtime: PHP 7.3.33 with Xdebug 3.0.4
Configuration: /tests/phpunit.xml

Solicitar Metadados
✔ Solicitar metadados retorna objeto correto 100 ms
✔ Solicitar metadados lanca excecao 21 ms

Time: 00:01.908, Memory: 36.00 MB

OK (2 tests, 7 assertions)

Generating code coverage report in HTML format ... done [00:19.891]

@sergioadao
Copy link

Boa tarde @amelquia , @Mauro1706 e @mateussbh ....segue evidência do funcionamento correto do teste:

$ make test-unit teste=ProcessoEletronicoRN/SolicitarMetadadosTest

Ambiente: SEI 4.1.2
Banco MySQL
Branch feat/rest

$ make test-unit teste=ProcessoEletronicoRN/SolicitarMetadadosTest
docker compose -f tests_sei41/funcional/docker-compose.yml run --rm -w /tests php-test-unit bash -c 'XDEBUG_MODE=coverage vendor/bin/phpunit --testdox --coverage-html html rn/ProcessoEletronicoRN/SolicitarMetadadosTest.php'
WARN[0000] /home/toor/Documentos/ministerio_economia/aplicacao_sei/sei_versoes/sei-trad-4.1.2/sei/web/modulos/mod-sei-pen/tests_sei41/funcional/docker-compose.yml: the attribute version is obsolete, it will be ignored, please remove it to avoid potential confusion
PHPUnit 9.6.21 by Sebastian Bergmann and contributors.

Runtime: PHP 7.3.33 with Xdebug 3.0.4
Configuration: /tests/phpunit.xml

Solicitar Metadados
✔ Solicitar metadados retorna objeto correto 45 ms
✔ Solicitar metadados lanca excecao 5 ms

Time: 00:01.597, Memory: 36.00 MB

OK (2 tests, 7 assertions)

Generating code coverage report in HTML format ... done [00:19.663]

@sergioadao
Copy link

Boa tarde @amelquia , @Mauro1706 e @mateussbh ....segue evidência do funcionamento correto do teste:

$ make test-unit teste=ProcessoEletronicoRN/SolicitarMetadadosTest

Ambiente: SEI 4.0.12.15
Banco MySQL
Branch feat/rest

$ make test-unit teste=ProcessoEletronicoRN/SolicitarMetadadosTest
docker compose -f tests_super/funcional/docker-compose.yml run --rm -w /tests php-test-unit bash -c 'XDEBUG_MODE=coverage vendor/bin/phpunit --testdox --coverage-html html rn/ProcessoEletronicoRN/SolicitarMetadadosTest.php'
WARN[0000] /home/toor/Documentos/ministerio_economia/aplicacao_sei/sei_versoes/sei-trad-4.0.12.15/src/sei/web/modulos/mod-sei-pen/tests_super/funcional/docker-compose.yml: the attribute version is obsolete, it will be ignored, please remove it to avoid potential confusion
PHPUnit 9.6.21 by Sebastian Bergmann and contributors.

Runtime: PHP 7.3.33 with Xdebug 3.0.4
Configuration: /tests/phpunit.xml

Solicitar Metadados
✔ Solicitar metadados retorna objeto correto 70 ms
✔ Solicitar metadados lanca excecao 30 ms

Time: 00:02.994, Memory: 36.00 MB

OK (2 tests, 7 assertions)

Generating code coverage report in Cobertura XML format ... done [00:17.469]

Generating code coverage report in HTML format ... done [00:04.244]

@sergioadao
Copy link

Bom dia @amelquia , @Mauro1706 e @mateussbh ....segue evidência do funcionamento correto do teste:

$ make test-unit teste=ProcessoEletronicoRN/SolicitarMetadadosTest

Ambiente: SEI 4.0.12.15
Banco Postgresql
Branch feat/rest

$ make test-unit teste=ProcessoEletronicoRN/SolicitarMetadadosTest
docker compose -f tests_super/funcional/docker-compose.yml run --rm -w /tests php-test-unit bash -c 'XDEBUG_MODE=coverage vendor/bin/phpunit --testdox --coverage-html html rn/ProcessoEletronicoRN/SolicitarMetadadosTest.php'
WARN[0000] /home/toor/Documentos/ministerio_economia/aplicacao_sei/sei_versoes/sei-trad-4.0.12.15/src/sei/web/modulos/mod-sei-pen/tests_super/funcional/docker-compose.yml: the attribute version is obsolete, it will be ignored, please remove it to avoid potential confusion
PHPUnit 9.6.21 by Sebastian Bergmann and contributors.

Runtime: PHP 7.3.33 with Xdebug 3.0.4
Configuration: /tests/phpunit.xml

Solicitar Metadados
✔ Solicitar metadados retorna objeto correto 76 ms
✔ Solicitar metadados lanca excecao 6 ms

Time: 00:01.904, Memory: 36.00 MB

OK (2 tests, 7 assertions)

Generating code coverage report in Cobertura XML format ... done [00:16.045]

Generating code coverage report in HTML format ... done [00:03.346]

@sergioadao
Copy link

Boa Tarde @amelquia , @Mauro1706 e @mateussbh ....segue evidência do funcionamento correto do teste:

$ make test-unit teste=ProcessoEletronicoRN/SolicitarMetadadosTest

Ambiente: SEI 4.1.2
Banco Postgresql
Branch feat/rest

make test-unit teste=ProcessoEletronicoRN/SolicitarMetadadosTest
docker compose -f tests_sei41/funcional/docker-compose.yml run --rm -w /tests php-test-unit bash -c 'XDEBUG_MODE=coverage vendor/bin/phpunit --testdox --coverage-html html rn/ProcessoEletronicoRN/SolicitarMetadadosTest.php'
WARN[0000] /home/toor/Documentos/ministerio_economia/aplicacao_sei/sei_versoes/sei-trad-4.1.2/sei/web/modulos/mod-sei-pen/tests_sei41/funcional/docker-compose.yml: the attribute version is obsolete, it will be ignored, please remove it to avoid potential confusion
PHPUnit 9.6.21 by Sebastian Bergmann and contributors.

Runtime: PHP 7.3.33 with Xdebug 3.0.4
Configuration: /tests/phpunit.xml

Solicitar Metadados
✔ Solicitar metadados retorna objeto correto 81 ms
✔ Solicitar metadados lanca excecao 12 ms

Time: 00:01.766, Memory: 36.00 MB

OK (2 tests, 7 assertions)

@sergioadao
Copy link

Bom dia @amelquia , @Mauro1706 e @mateussbh ....segue evidência do funcionamento correto do teste:

$ make test-unit teste=ProcessoEletronicoRN/SolicitarMetadadosTest

Ambiente: SEI 4.0.12.15
Banco Oracle
Branch feat/rest

make test-unit teste=ProcessoEletronicoRN/SolicitarMetadadosTest
docker compose -f tests_super/funcional/docker-compose.yml run --rm -w /tests php-test-unit bash -c 'XDEBUG_MODE=coverage vendor/bin/phpunit --testdox --coverage-html html rn/ProcessoEletronicoRN/SolicitarMetadadosTest.php'
WARN[0000] /home/toor/Documentos/ministerio_economia/aplicacao_sei/sei_versoes/sei-trad-4.0.12.15/src/sei/web/modulos/mod-sei-pen/tests_super/funcional/docker-compose.yml: the attribute version is obsolete, it will be ignored, please remove it to avoid potential confusion
PHPUnit 9.6.21 by Sebastian Bergmann and contributors.

Runtime: PHP 7.3.33 with Xdebug 3.0.4
Configuration: /tests/phpunit.xml

Solicitar Metadados
✔ Solicitar metadados retorna objeto correto 49 ms
✔ Solicitar metadados lanca excecao 5 ms

Time: 00:01.556, Memory: 36.00 MB

OK (2 tests, 7 assertions)

Generating code coverage report in Cobertura XML format ... done [00:14.370]

Generating code coverage report in HTML format ... done [00:08.231]

@sergioadao
Copy link

Bom dia @amelquia , @Mauro1706 e @mateussbh ....segue evidência do funcionamento correto do teste:

$ make test-unit teste=ProcessoEletronicoRN/SolicitarMetadadosTest

Ambiente: SEI 4.1.2
Banco Oracle
Branch feat/rest

$ make test-unit teste=ProcessoEletronicoRN/SolicitarMetadadosTest
sudo docker compose -f tests_sei41/funcional/docker-compose.yml run --rm -w /tests php-test-unit bash -c 'vendor/bin/phpunit rn/ProcessoEletronicoRNTest.php'
WARN[0000] /home/toor/Documentos/ministerio_economia/aplicacao_sei/sei_versoes/sei-trad-4.1.2/src/sei/web/modulos/mod-sei-pen/tests_sei41/funcional/docker-compose.yml: the attribute version is obsolete, it will be ignored, please remove it to avoid potential confusion
Xdebug: [Step Debug] Could not connect to debugging client. Tried: host.docker.internal:9003 (fallback through xdebug.client_host/xdebug.client_port) :-(
PHPUnit 5.7.27 by Sebastian Bergmann and contributors.

Runtime: PHP 7.3.33 with Xdebug 3.0.4
Configuration: /tests/phpunit.xml

.. 2 / 2 (100%)

Time: 406 ms, Memory: 10.00MB

OK (2 tests, 25 assertions)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
melhoria New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants