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 - Cancelar Trâmite. #728

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

Testes Unitários - Cancelar Trâmite. #728

amelquia opened this issue Nov 25, 2024 · 4 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 cancelarTramite


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#/


@NinetiesPaul
Copy link
Contributor

Aberto PR para criação do teste unitário que valida o método cancelarTramite

Execute-o com: make test-unit teste=ProcessoEletronicoRN/CancelarTramiteTest

Evidencia de execução

image

@sergioadao
Copy link

sergioadao commented Dec 4, 2024

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

$ make test-unit teste=ProcessoEletronicoRN/CancelarTramiteTest

Ambiente: SEi 4.1.2
Branch: feat/rest

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

$ make test-unit teste=ProcessoEletronicoRN/CancelarTramiteTest

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/CancelarTramiteTest.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

Cancelar Tramite
✔ Cancelar tramite sucesso 64 ms
✔ Cancelar tramite lanca excecao 8 ms

Time: 00:01.632, Memory: 36.00 MB

OK (2 tests, 5 assertions)

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

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

image

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

$ make test-unit teste=ProcessoEletronicoRN/CancelarTramiteTest

Ambiente: SEi 4.0.12.15
Branch: feat/rest

=================================================================================
RESULTADO DO TESTE

$ make test-unit teste=ProcessoEletronicoRN/CancelarTramiteTest
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/CancelarTramiteTest.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

Cancelar Tramite
✔ Cancelar tramite sucesso 44 ms
✔ Cancelar tramite lanca excecao 5 ms

Time: 00:01.685, Memory: 36.00 MB

OK (2 tests, 5 assertions)

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

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

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

image

@sergioadao
Copy link

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

$ make test-unit teste=ProcessoEletronicoRN/CancelarTramiteTest

**Ambiente utilizado foi :

SEI 4.1.2
Branch: feat/rest
BANCO SQLSERVER

RESULTADO: OK

PHPUnit 9.6.22 by Sebastian Bergmann and contributors.

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

Cancelar Tramite
✔ Cancelar tramite sucesso 45 ms
✔ Cancelar tramite lanca excecao 5 ms

Time: 00:01.667, Memory: 36.00 MB

OK (2 tests, 5 assertions)

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

@sergioadao
Copy link

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

$ make test-unit teste=ProcessoEletronicoRN/CancelarTramiteTest

**Ambiente utilizado foi :

SEI 4.0.12.15
Branch: feat/rest
BANCO SQLSERVER

RESULTADO: OK

$ make test-unit teste=ProcessoEletronicoRN/CancelarTramiteTest
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/CancelarTramiteTest.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

Cancelar Tramite
✔ Cancelar tramite sucesso 47 ms
✔ Cancelar tramite lanca excecao 7 ms

Time: 00:03.117, Memory: 36.00 MB

OK (2 tests, 5 assertions)

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

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

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