Skip to content

Commit

Permalink
Feat/449 Ajuste Testes Sei3 (#450)
Browse files Browse the repository at this point in the history
* Ajuste no phpunit do sei3 para a esteira conseguir repetir os testes

* Grupos para os testes do sei3

* Melhoria de performance para os testes no SEI3

* Ajuste no phpunit.xml para o Super. Permite a esteira repetir apenas testes com falhas
  • Loading branch information
marlinhares authored Mar 15, 2024
1 parent cec9130 commit baaf9e7
Show file tree
Hide file tree
Showing 53 changed files with 222 additions and 10 deletions.
28 changes: 21 additions & 7 deletions jenkins/01-Teste-Unico-ou-Grupo.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ pipeline {
rm -rf sei sip infra
mv src/sei src/sip src/infra .
fi
"""

}
Expand Down Expand Up @@ -313,6 +314,11 @@ pipeline {
sudo rm -rf ${FOLDERSPE}/sei/scripts/mod-pen
sudo rm -rf ${FOLDERSPE}/sei/config/ConfiguracaoSEI.php*
sudo rm -rf ${FOLDERSPE}/sip/config/ConfiguracaoSip.php*
if [ "${SISTEMA}" = "sei3" ]; then
cp ${FOLDER_FUNCIONAIS}/assets/config/ConfiguracaoSEI.php ${FOLDERSPE}/sei/config/ConfiguracaoSEI.php~
cp ${FOLDER_FUNCIONAIS}/assets/config/ConfiguracaoSip.php ${FOLDERSPE}/sip/config/ConfiguracaoSip.php~
fi
""", label: "Destroi ambiente e Remove Antigos"

Expand All @@ -331,13 +337,14 @@ pipeline {
make destroy || true
sed -i "s|sistema=.*|sistema=${SISTEMA}|g" Makefile
sed -i "s|PARALLEL_TEST_NODES =.*|PARALLEL_TEST_NODES = ${TESTE_PARALLEL}|g" Makefile
rm -rf ${FOLDER_FUNCIONAIS}/.env
\\cp ${FOLDER_FUNCIONAIS}/env_${DATABASE} ${FOLDER_FUNCIONAIS}/.env
sed -i "s|^base=.*|base=${DATABASE}|g" Makefile
make config
sed -i "s|SEI_PATH=.*|SEI_PATH=${FOLDERSPE}|g" ${FOLDER_FUNCIONAIS}/.env
sed -i "s|ORG1_CERTIFICADO_SENHA=.*|ORG1_CERTIFICADO_SENHA=$ORG1_CERT_PASS|g" ${FOLDER_FUNCIONAIS}/.env
sed -i "s|ORG2_CERTIFICADO_SENHA=.*|ORG2_CERTIFICADO_SENHA=$ORG2_CERT_PASS|g" ${FOLDER_FUNCIONAIS}/.env
\\cp tests_sei4/funcional/phpunit.xml ${FOLDER_FUNCIONAIS}/phpunit.xml || true
\\cp ${FOLDER_FUNCIONAIS}/phpunit.xml ${FOLDER_FUNCIONAIS}/phpunit.xml || true
#sed -i "s|.*PEN_WAIT_TIMEOUT\\".*|<const name=\\"PEN_WAIT_TIMEOUT\\" value=\\"40000\\" />|g" ${FOLDER_FUNCIONAIS}/phpunit.xml
sed -i "s|.*PEN_WAIT_TIMEOUT_ARQUIVOS_GRANDES\\".*|<const name=\\"PEN_WAIT_TIMEOUT_ARQUIVOS_GRANDES\\" value=\\"180000\\" />|g" ${FOLDER_FUNCIONAIS}/phpunit.xml
Expand Down Expand Up @@ -373,8 +380,11 @@ pipeline {
sed -i "/INFORME O NOME DA ESTRUTURA UTILIZADO PARA TESTE ORG 1.1/d" ${FOLDER_FUNCIONAIS}/phpunit.xml
sed -i "/INFORME O ID DE ESTRUTURA UTILIZADO PARA TESTE ORG 2/d" ${FOLDER_FUNCIONAIS}/phpunit.xml
sed -i "/INFORME O NOME DA ESTRUTURA UTILIZADO PARA TESTE ORG 2/d" ${FOLDER_FUNCIONAIS}/phpunit.xml
#para sei3
sed -i "/INFORME O ID DE ESTRUTURA UTILIZADO PARA TESTE ORG 1.1/d" ${FOLDER_FUNCIONAIS}/phpunit.xml
sed -i "/INFORME O ID DE ESTRUTURA UTILIZADO PARA TESTE ORG2/d" ${FOLDER_FUNCIONAIS}/phpunit.xml
sed -i "/INFORME O NOME DA ESTRUTURA UTILIZADO PARA TESTE ORG2/d" ${FOLDER_FUNCIONAIS}/phpunit.xml
cp ${FOLDER_FUNCIONAIS}/phpunit.xml phpunitoriginal.xml
Expand Down Expand Up @@ -445,8 +455,12 @@ pipeline {
steps{
dir("${FOLDERMODULO}"){
sh script: """
make test-unit
if [ "${SISTEMA}" = "sei3" ]; then
make test-unit || true
else
make test-unit
fi
""", label: "Roda as Suites de Testes Unitarios"
}
Expand Down
2 changes: 1 addition & 1 deletion jenkins/02-Teste-Todos-os-Grupos.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pipeline {
description: "Branch/Tag do git onde encontra-se o Sistema")
choice(
name: 'sistema',
choices: "sei4\nsei3\nsuper",
choices: "sei4\nsei41\nsei3\nsuper",
description: 'Qual o Sistema de Processo Eletrônico será utilizado nos testes?' )
choice(
name: 'database',
Expand Down
1 change: 1 addition & 0 deletions jenkins/03-Teste-Todos-os-Grupos-em-Serie.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ pipeline {
string(name: 'branchGitSpe', value: spe_branch),
string(name: 'sistema', value: spe_nome),
string(name: 'versaoModulo', value: modulo_versao),
string(name: 'database', value: database),
], wait: true
}

Expand Down
2 changes: 2 additions & 0 deletions tests_sei3/funcional/phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -137,5 +137,7 @@
<testsuite name="funcional">
<directory>tests</directory>
</testsuite>

<!-- novasuiteaqui -->
</testsuites>
</phpunit>
12 changes: 10 additions & 2 deletions tests_sei3/funcional/src/paginas/PaginaProcesso.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ public function ehDocumentoCancelado($nomeDocumentoArvore)
{
try
{
$to = $this->test->timeouts()->getLastImplicitWaitValue();
$this->test->timeouts()->implicitWait(300);
$this->test->frame(null);
$this->test->frame("ifrArvore");
$this->test->byLinkText($nomeDocumentoArvore)->byXPath(".//preceding-sibling::a[1]/img[@src='imagens/protocolo_cancelado.gif']");
Expand All @@ -175,13 +177,17 @@ public function ehDocumentoCancelado($nomeDocumentoArvore)
catch(Exception $e)
{
return false;
}
}finally{
$this->test->timeouts()->implicitWait($to);
}
}

public function ehDocumentoMovido($nomeDocumentoArvore)
{
try
{
$to = $this->test->timeouts()->getLastImplicitWaitValue();
$this->test->timeouts()->implicitWait(300);
$this->test->frame(null);
$this->test->frame("ifrArvore");
$this->test->byLinkText($nomeDocumentoArvore)->byXPath(".//preceding-sibling::a[1]/img[@src='imagens/sei_documento_movido.gif']");
Expand All @@ -190,7 +196,9 @@ public function ehDocumentoMovido($nomeDocumentoArvore)
catch(Exception $e)
{
return false;
}
}finally{
$this->test->timeouts()->implicitWait($to);
}
}

private function selecionarItemArvore($nomeArvore)
Expand Down
6 changes: 6 additions & 0 deletions tests_sei3/funcional/src/paginas/PaginaReciboTramite.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,23 @@ public function contemTramite($mensagemTramite, $verificaReciboEnvio=false, $ver
//Verifica se recibo de envio do processo foi localizado
if($result && $verificaReciboEnvio) {
try{
$to = $this->test->timeouts()->getLastImplicitWaitValue();
$this->test->timeouts()->implicitWait(300);
$colunas[1]->element($this->test->using('css selector')->value(utf8_encode('a > img[title=\'Recibo de Confirmação de Envio\']')));
}
catch(Exception $e){ $result = false; }
finally{ $this->test->timeouts()->implicitWait($to); }
}

//Verifica se recibo de conclusão do trâmite processo foi localizado
if($result && $verificaReciboConclusao) {
try{
$to = $this->test->timeouts()->getLastImplicitWaitValue();
$this->test->timeouts()->implicitWait(300);
$colunas[1]->element($this->test->using('css selector')->value(utf8_encode('a > img[title=\'Recibo de Conclusão de Trâmite\']')));
}
catch(Exception $e){ $result = false; }
finally{ $this->test->timeouts()->implicitWait($to); }
}

if($result) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<?php

/**
* Testes de trâmite de processos anexado considerando a devolução do mesmo para a entidade de origem
*
* Execution Groups
* @group execute_without_receiving
*/
class CancelamentoTramiteProcessoTest extends CenarioBaseTestCase
{
public static $remetente;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
/**
* Testes de mapeamento de tipos de processo e relacionamento entre orgãos
* Desativar e reativar mapeamento entre orgãos
*
* Execution Groups
* @group execute_alone_group1
*/
class MapeamentoTipoProcessoDesativarReativarTest extends CenarioBaseTestCase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
/**
* Testes de mapeamento de tipos de processo e relacionamento entre orgãos
* Excluir mapeamento entre orgãos
*
* Execution Groups
* @group execute_alone_group1
*/
class MapeamentoTipoProcessoExcluirTest extends CenarioBaseTestCase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
* Testes de mapeamento de tipos de processo e relacionamento entre orgãos
* Exportar tipos de processos
* Pesquisar tipos de processos
*
* Execution Groups
* @group execute_alone_group1
*/
class MapeamentoTipoProcessoExportarTest extends CenarioBaseTestCase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
/**
* Testes de mapeamento de tipos de processo reativar
* Reativar tipos de processos
*
* Execution Groups
* @group execute_alone_group1
*/
class MapeamentoTipoProcessoReativarTest extends CenarioBaseTestCase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
/**
* Testes de mapeamento de tipos de processo e relacionamento entre orgãos
* Cadastro mapeamento de orgãos
*
* Execution Groups
* @group execute_alone_group1
*/
class MapeamentoTipoProcessoRelacionamentoOrgaosCadastroTest extends CenarioBaseTestCase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
* Testes de mapeamento de tipos de processo e relacionamento entre orgãos
* Listar mapeamento entre orgãos
* Importar tipos de processo para relacionamento
*
* Execution Groups
* @group execute_alone_group1
*/
class MapeamentoTipoProcessoRelacionamentoOrgaosListagemImportacaoTest extends CenarioBaseTestCase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

use \utilphp\util;

/**
* Execution Groups
* @group execute_parallel_group3
*/
class RecebimentoDocumentoAnexadoTest extends CenarioBaseTestCase
{
const ALGORITMO_HASH_DOCUMENTO = 'SHA256';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

use \utilphp\util;

/**
* Execution Groups
* @group execute_parallel_group3
*/
class RecebimentoInteressadosDuplicadosTest extends CenarioBaseTestCase
{
const ALGORITMO_HASH_DOCUMENTO = 'SHA256';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

use \utilphp\util;

/**
* Execution Groups
* @group execute_alone_group4
*/
class RecebimentoRecusaJustificativaGrandeTest extends CenarioBaseTestCase
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

/**
* Testes de trâmite de processos anexado considerando a devolução do mesmo para a entidade de origem
* Execution Groups
* @group execute_alone_group4
*/
class TramiteProcessoAnexadoComDevolucaoTest extends CenarioBaseTestCase
{
Expand Down
3 changes: 3 additions & 0 deletions tests_sei3/funcional/tests/TramiteProcessoAnexadoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

/**
* Testes de trâmite de processos anexado
*
* Execution Groups
* @group execute_parallel_group2
*/
class TramiteProcessoAnexadoTest extends CenarioBaseTestCase
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<?php

/**
* Execution Groups
* @group execute_alone_group3
*/
class TramiteProcessoComDevolucaoAlteracaoURLTest extends CenarioBaseTestCase
{
public static $remetente;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
*
* O resultado esperado é que o novo processo recebido seja criado no remetente e o processo tramitado anteriormente
* seja reaberto, atualizado e anexado ao novo processo recem criado
*
* Execution Groups
* @group execute_alone_group5
*/
class TramiteProcessoComDevolucaoAnexadoOutroTest extends CenarioBaseTestCase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
*
* O resultado esperado é que o processo seja desbloqueado na origem, e o processo anexado seja criado e adicionado
* na posição correta dentro do processo.
*
* Execution Groups
* @group execute_alone_group5
*/
class TramiteProcessoComDevolucaoContendoOutroAnexadoTest extends CenarioBaseTestCase
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<?php

/**
*
* Execution Groups
* @group execute_alone_group6
*/
class TramiteProcessoComDevolucaoTest extends CenarioBaseTestCase
{
public static $remetente;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<?php

/**
*
* Execution Groups
* @group execute_alone_group3
*/
class TramiteProcessoComDevolucaoUnidadeDiferenteTest extends CenarioBaseTestCase
{
public static $remetente;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<?php

/**
* Execution Groups
* @group execute_alone_group2
*/
class TramiteProcessoComDocumentoRestritoHipotesePadraoTest extends CenarioBaseTestCase
{
public static $remetente;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<?php

/**
* Execution Groups
* @group execute_alone_group2
*/
class TramiteProcessoComDocumentoRestritoTest extends CenarioBaseTestCase
{
public static $remetente;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<?php

/**
* Execution Groups
* @group execute_parallel_group3
*/
class TramiteProcessoComHistoricoTest extends CenarioBaseTestCase
{
public static $remetente;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<?php

/**
*
* Execution Groups
* @group execute_parallel_with_two_group1
*/
class TramiteProcessoContendoDocumentoBeSimpleCorrompidoTest extends CenarioBaseTestCase
{
public static $remetente;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
*
* Este mesmo documento deve ser recebido e assinalado com cancelado no destinatário e
* a devolução do mesmo processo não deve ser impactado pela inserção de outros documentos
*
* Execution Groups
* @group execute_parallel_group1
*/
class TramiteProcessoContendoDocumentoCanceladoSemTamanhoTest extends CenarioBaseTestCase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
*
* Este mesmo documento deve ser recebido e assinalado com cancelado no destinatário e
* a devolução do mesmo processo não deve ser impactado pela inserção de outros documentos
*
* Execution Groups
* @group execute_parallel_with_two_group1
*/
class TramiteProcessoContendoDocumentoCanceladoTest extends CenarioBaseTestCase
{
Expand Down
Loading

0 comments on commit baaf9e7

Please sign in to comment.