ci: add Jenkins pipeline with JaCoCo coverage reports
This commit is contained in:
+12
@@ -0,0 +1,12 @@
|
||||
---
|
||||
schemaVersion: 1
|
||||
id: "ART-0002"
|
||||
workId: "WRK-0004"
|
||||
origin: "aie-jenkins-final-evidence.txt"
|
||||
purpose: "Comando completo de CI, 126 testes, 11 cenários de pipeline e relatórios\
|
||||
\ JaCoCo verificados"
|
||||
path: "artifacts/evidence/ART-0002/payload"
|
||||
sha256: "eab61e1af988a9eb3ab3b1abdd3984caa2e449aea528aa4eab6febb21fbbf171"
|
||||
size: 4702
|
||||
author: "agent"
|
||||
createdAt: "2026-11-16T10:32:22.869800Z"
|
||||
+111
@@ -0,0 +1,111 @@
|
||||
WRK-0004 — verificação final Jenkins/JaCoCo
|
||||
|
||||
Comandos executados:
|
||||
1. ./gradlew clean --no-daemon --console=plain: BUILD SUCCESSFUL.
|
||||
2. ./gradlew test jacocoTestReport jenkinsPipelineTest --continue --parallel --max-workers=2 --build-cache --no-daemon --console=plain: BUILD SUCCESSFUL em 4m57s; 16 tarefas executadas. Este é o comando do Jenkinsfile.
|
||||
3. git diff --check: sem erros. aie project validate --format json: valid=true, issues=[].
|
||||
|
||||
Resultados medidos:
|
||||
{
|
||||
"testSuites": 20,
|
||||
"junit": {
|
||||
"tests": 126,
|
||||
"failures": 0,
|
||||
"errors": 0,
|
||||
"skipped": 0
|
||||
},
|
||||
"pipelineFixtureScenarios": 11,
|
||||
"coverage": {
|
||||
"INSTRUCTION": {
|
||||
"missed": 3468,
|
||||
"covered": 23484,
|
||||
"percent": 87.13,
|
||||
"gatePassed": true
|
||||
},
|
||||
"BRANCH": {
|
||||
"missed": 763,
|
||||
"covered": 1728,
|
||||
"percent": 69.37,
|
||||
"gatePassed": true
|
||||
},
|
||||
"LINE": {
|
||||
"missed": 200,
|
||||
"covered": 2421,
|
||||
"percent": 92.37,
|
||||
"gatePassed": true
|
||||
},
|
||||
"COMPLEXITY": {
|
||||
"missed": 731,
|
||||
"covered": 1363,
|
||||
"percent": 65.09
|
||||
},
|
||||
"METHOD": {
|
||||
"missed": 66,
|
||||
"covered": 775,
|
||||
"percent": 92.15,
|
||||
"gatePassed": true
|
||||
},
|
||||
"CLASS": {
|
||||
"missed": 2,
|
||||
"covered": 138,
|
||||
"percent": 98.57,
|
||||
"gatePassed": true
|
||||
}
|
||||
},
|
||||
"outputs": {
|
||||
"build/reports/jacoco/jacocoTestReport/jacocoTestReport.xml": {
|
||||
"bytes": 487358,
|
||||
"sha256": "4c3de5d772ce6cffdef540ae49336d3080afdbc87fe7842befa3396853c46a07"
|
||||
},
|
||||
"build/reports/jacoco/jacocoTestReport/html/index.html": {
|
||||
"bytes": 13076,
|
||||
"sha256": "a67be38c4a30366e5c72e0352f441cad71bc26ae5399fecef37fb6cd3db64bbd"
|
||||
},
|
||||
"build/jacoco/test.exec": {
|
||||
"bytes": 208847,
|
||||
"sha256": "00d8a2d4bfe09b3422ca9436c1da81dde71ffb4a7f690dfee08bf873410cf5e7"
|
||||
},
|
||||
"build/reports/tests/test/index.html": {
|
||||
"bytes": 7532,
|
||||
"sha256": "938f5d30964a23e77049bb50a075fae63b691c26e53c0a4dbe4b0a1f5309a12f"
|
||||
}
|
||||
},
|
||||
"nativeCliPreserved": true,
|
||||
"controllerExecuted": false
|
||||
}
|
||||
|
||||
As cinco métricas configuradas estão acima dos limites do Studio (CLASS/METHOD/LINE/INSTRUCTION 50%, BRANCH 40%). Os limites têm criticidade UNSTABLE no Jenkins; nenhuma falha de teste é ocultada. Não há exclusões de classes para elevar artificialmente cobertura. JaCoCo 0.8.14 instrumenta o JVM test worker, não os subprocessos CLI nem smoke nativo.
|
||||
|
||||
A falha controlada anterior retornou exit 1 e produziu JUnit (1 teste, 1 falha), XML válido de cobertura, HTML e test.exec. A suíte normal foi executada após limpar essas saídas; os 126 testes finais não incluem CiFailureProbeTest.
|
||||
|
||||
Fonte da falha controlada (temporária, não adicionada aos fontes versionados):
|
||||
package net.intrepid.aiengineering;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import static org.junit.jupiter.api.Assertions.fail;
|
||||
class CiFailureProbeTest {
|
||||
@Test void deliberateFailure() { fail("Controlled CI failure probe"); }
|
||||
}
|
||||
|
||||
Init script usado apenas no probe:
|
||||
gradle.projectsEvaluated {
|
||||
rootProject.sourceSets.test.java.srcDir(new File(System.getProperty('aie.ci.probe'), 'probe'))
|
||||
rootProject.tasks.named('test') {
|
||||
filter { includeTestsMatching 'net.intrepid.aiengineering.CiFailureProbeTest' }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
O teste local do Jenkinsfile executa 11 cenários com passos controlados: sucesso, clean falho com caminhos antigos, falha com relatórios parciais, falha sem relatórios, três relatórios obrigatórios ausentes e falha isolada de cada um dos quatro publicadores. Não invoca plugins nem controlador Jenkins.
|
||||
|
||||
Setup no controlador documentado em files/config/README.md: Pipeline from SCM, Script Path files/config/Jenkinsfile, agente Unix com JDK 25 e Git, cache gravável e plugins Pipeline/Gradle/JUnit/Checks API/Coverage/HTML Publisher. Publicação real de checks e relatórios exige execução nesse controlador, que não foi configurado nem acessado nesta sessão.
|
||||
|
||||
Studio usado apenas como referência de leitura. Works COMPLETED existentes preservados. Nenhuma fonte Java de produção foi alterada. O executável nativo instalado foi preservado/restaurado com hash idêntico durante o clean local.
|
||||
|
||||
Hashes dos arquivos de implementação/documentação/teste:
|
||||
{
|
||||
"build.gradle.kts": "bef54ef73fd9eb9dd7b01774d9d17265ee5b0237add51dfc8774cf6b1693c612",
|
||||
"README.md": "6fd6010b0b688cef888b4593279d4116dea5af5d41d19237e8b5a60a8356feb1",
|
||||
"files/config/Jenkinsfile": "def60462f283b314b783cf92ca1ed105b1e8b4e9751bc9c81b542436a71e0dea",
|
||||
"files/config/README.md": "8d8fd77f6259511cc2ef219d75fe107a305c57868de02d833e58452ffb9f7d61",
|
||||
"scripts/test-jenkins-pipeline.groovy": "0221c4e4015a515b40274d2eae50ee626eccf7ccb95d48bc60a30969aed02a50"
|
||||
}
|
||||
Reference in New Issue
Block a user