Skip to content

Commit

Permalink
Ajustes Jenkins, Performance e Outros (#444)
Browse files Browse the repository at this point in the history
* Jobs Jenkins

* Jobs Jenkins

* Jobs Jenkins

* Testes Com grupos e Ajustes Diversos para velocidade

* Ajustes nos testes da 41 para melhorar velocidade e agrupar

* Subindo pasta assets para o sei41

* Atualizando check alive para ser compativel com a 41

* Atualizando rotina Jenkins com novo formato do phpunit
  • Loading branch information
marlinhares authored and Carlos Melo committed Mar 15, 2024
1 parent d8630c2 commit 0fdf15c
Show file tree
Hide file tree
Showing 60 changed files with 1,573 additions and 14 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ CMD_INSTALACAO_SIP_MODULO = echo -ne '$(SIP_DATABASE_USER)\n$(SIP_DATABASE_PASSW
CMD_COMPOSE_UNIT = $(CMD_DOCKER_COMPOSE) -f $(PEN_TEST_UNIT)/docker-compose.yml --env-file $(PEN_TEST_UNIT)/.env
CMD_COMPOSE_FUNC = $(CMD_DOCKER_COMPOSE) -f $(PEN_TEST_FUNC)/docker-compose.yml --env-file $(PEN_TEST_FUNC)/.env
CMD_COMPOSE_FUNC_EXEC = $(CMD_COMPOSE_FUNC) exec -T
CMD_CURL_LOGIN_ORG1 = $(CMD_COMPOSE_FUNC_EXEC) org1-http bash -c 'curl -s -L $${HOST_URL:-$$SEI_HOST_URL}/sei | grep -q "<input.*txtUsuario.*>"'
CMD_CURL_LOGIN_ORG2 = $(CMD_COMPOSE_FUNC_EXEC) org2-http bash -c 'curl -s -L $${HOST_URL:-$$SEI_HOST_URL}/sei | grep -q "<input.*txtUsuario.*>"'
CMD_CURL_LOGIN_ORG1 = $(CMD_COMPOSE_FUNC_EXEC) org1-http bash -c 'curl -s -L $${HOST_URL:-$$SEI_HOST_URL}/sei | grep -q "input.*txtUsuario.*"'
CMD_CURL_LOGIN_ORG2 = $(CMD_COMPOSE_FUNC_EXEC) org2-http bash -c 'curl -s -L $${HOST_URL:-$$SEI_HOST_URL}/sei | grep -q "input.*txtUsuario.*"'
FILE_VENDOR_FUNCIONAL = $(PEN_TEST_FUNC)/vendor/bin/phpunit
FILE_VENDOR_UNITARIO = $(PEN_TEST_UNIT)/vendor/bin/phpunit

Expand Down
683 changes: 683 additions & 0 deletions jenkins/01-Teste-Unico-ou-Grupo.groovy

Large diffs are not rendered by default.

585 changes: 585 additions & 0 deletions jenkins/02-Teste-Todos-os-Grupos.groovy

Large diffs are not rendered by default.

104 changes: 104 additions & 0 deletions jenkins/03-Teste-Todos-os-Grupos-em-Serie.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
/*
Usuario jenkins precisa ter permissao de sudo
Jenkins minimo em 2.332
chama o job 02 de forma serializada
*/

pipeline {
agent {
node{
label "master"
}
}

options {
disableConcurrentBuilds()
}

parameters {

string(
name: 'versoes',
defaultValue:"SPE=4.0.11,NOME_SPE=sei4,VERSAO_MODULO=master,BASE=mysql;SPE=4.0.12.15,NOME_SPE=sei4,VERSAO_MODULO=master,BASE=mysql;",
description: "Lista de versoes do SPE e modulo no formato como exemplo acima, separados por ;")


}

stages {



stage("Preparar execucao"){

steps{

script{

if ( env.BUILD_NUMBER == '1' ){
currentBuild.result = 'ABORTED'
warning('Informe os valores de parametro iniciais. Caso eles n tenham aparecido faça login novamente')
}

QTDTENTATIVAS=0
VERSOES_STRING = params.versoes
arrGeneral = VERSOES_STRING.split(';')

buildDescription "Versoes: ${VERSOES_STRING}"

}

}

}

stage("Executar nas Bases"){
steps {
script {

def paramValue
def spe_branch
def spe_controle_versao
def modulo_versao
def database

for (int i = 0; i < arrGeneral.length; i++) {
paramValue = arrGeneral[i].split(',')
spe_branch = paramValue[0].split('=')[1]
spe_nome = paramValue[1].split('=')[1]
modulo_versao = paramValue[2].split('=')[1]
database = paramValue[3].split('=')[1]

stage("Montando Ambiente Rodando Testes ${paramValue[0]} / ${paramValue[1]} / ${paramValue[2]}" ) {

warnError('Erro no build!'){

retry(QTDTENTATIVAS){


build job: '02-Teste-Todos-os-Grupos.groovy',
parameters:
[
string(name: 'branchGitSpe', value: spe_branch),
string(name: 'sistema', value: spe_nome),
string(name: 'versaoModulo', value: modulo_versao),
], wait: true
}

}

}


}

}
}

}
}

}
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions tests_sei41/funcional/assets/arquivos/arquivo_pequeno.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
arquivo pequeno
Binary file not shown.
Binary file not shown.
Binary file not shown.
10 changes: 10 additions & 0 deletions tests_sei41/funcional/assets/arquivos/test_files_index.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
https://archive.org/download/arquivo_pdf_testes/arquivo_pequeno.txt
https://archive.org/download/arquivo_pdf_testes/arquivo_pequeno_A.pdf
https://archive.org/download/arquivo_pdf_testes/arquivo_pequeno_B.pdf
https://archive.org/download/arquivo_pdf_testes/arquivo_pequeno_C.pdf
https://archive.org/download/arquivo_pdf_testes/arquivo_001.pdf
https://archive.org/download/arquivo_pdf_testes/arquivo_003.pdf
https://archive.org/download/arquivo_pdf_testes/arquivo_020.pdf
https://archive.org/download/arquivo_pdf_testes/arquivo_060.pdf
https://archive.org/download/arquivo_pdf_testes/arquivo_corrompimento_besimplesoap.pdf
https://archive.org/download/arquivo_pdf_testes/arquivo_extensao_nao_permitida.docx
12 changes: 10 additions & 2 deletions tests_sei41/funcional/src/paginas/PaginaProcesso.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,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[contains(@src,'svg/documento_cancelado.svg?')]");
Expand All @@ -192,13 +194,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[contains(@src,'svg/documento_movido.svg?')]");
Expand All @@ -207,7 +213,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_sei41/funcional/src/paginas/PaginaReciboTramite.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,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
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_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_sei41/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,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 TramiteProcessoComCancelamentoTest extends CenarioBaseTestCase
{
public static $remetente;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

/**
* @group rodarseparado
* @group rodarseparado1
* 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
Loading

0 comments on commit 0fdf15c

Please sign in to comment.