← ClaudeAtlas

jenkinsfile-test-stageslisted

Use for any question or task about running tests in Jenkins, including quick ones such as running tests in parallel or publishing JUnit results when tests fail: declarative Jenkinsfile test stages, parallel stages across agents, post always/failure actions, JUnit report publishing and lockable resources for shared test infrastructure.
testland/qa · ★ 13 · Testing & QA · score 80
Install: claude install-skill testland/qa
# jenkinsfile-test-stages ## Overview Jenkins Declarative Pipeline (introduced 2017) is the modern Jenkinsfile syntax - replaces older Scripted Pipeline for most use cases. A Jenkinsfile defines: - **Pipeline** - top-level container. - **Agent** - where stages run (any agent / specific node / Docker container). - **Stages** - sequential or parallel phases. - **Steps** - commands within a stage. - **Post** - actions after stages (always / success / failure / unstable / changed). ## When to use - Enterprise / regulated environments using Jenkins. - Existing Jenkins infrastructure; migration to GitHub Actions / GitLab CI prohibitive. - Self-hosted CI / specialized hardware needs (GPU, specialized drivers). For new projects in 2026+: GitHub Actions / GitLab CI offer better managed-runner experiences. Jenkins shines in self-hosted + plugin-rich environments. ## How to use 1. Add a `Jenkinsfile` with a `pipeline { agent ...; stages { ... } }` block; choose `agent any`, a labelled node, or a Docker image for reproducibility (Steps 1-2). 2. Define `stage('Build')` / `stage('Test')` steps that run your install + test commands via `sh`. 3. Parallelize independent suites and fan across an OS × runtime matrix - [references/parallel-and-matrix.md](references/parallel-and-matrix.md). 4. Add a `post {}` block to publish JUnit XML, archive artifacts, and notify per outcome - [references/post-actions.md](references/post-actions.md). 5. Inject `environment