Where to Find Jenkins Test Files: Complete Guide to the jenkinsci/jenkins Repository
Jenkins test files are distributed across module-specific src/test/java and src/test/resources directories, with core tests in core/src/test/java, war tests in war/src/test/java, and integration resources in test/src/test/resources.
The jenkinsci/jenkins repository organizes its comprehensive test suite across multiple Maven modules. Whether you are debugging a failure, contributing a new feature, or exploring the codebase, understanding where Jenkins test files live is essential for effective development.
Core Test Directory Structure
Jenkins separates its test suites by component, following standard Maven conventions. Each module contains production code under src/main and corresponding tests under src/test.
Core Unit and Integration Tests
The foundational test suite for Jenkins core resides in the core module. These tests cover security, monitoring, UI symbols, and internal utilities.
- Java test classes:
core/src/test/javacontains test classes validating core functionality - Test fixtures:
core/src/test/resourcesholds XML configurations, YAML data, and mock objects used by core tests
War Executable Tests
Tests that validate the web application archive (WAR) distribution are located in the war module. These functional tests launch a temporary Jenkins instance to verify the built application behaves correctly.
- Test location:
war/src/test/javahouses executable tests that spin up a minimal Jenkins server
CLI Tests
Command-line interface functionality is tested separately in the cli module. These tests verify protocol handling and client operations.
- Test location:
cli/src/test/javacontains tests for the Jenkins command-line client
Plugin Test Resources
The dedicated test module provides harnesses and fixtures for plugin-specific integration testing.
- Test harnesses:
test/src/test/javacontains generic integration tests and UI automation - Resource fixtures:
test/src/test/resourcesstores sample plugin packages, update-center JSON files, and Groovy script fixtures used across the test suite
How to Run Jenkins Tests Locally
The root pom.xml orchestrates test execution using Maven. You can execute the entire suite or target specific modules.
Clone the repository and run all tests:
git clone https://github.com/jenkinsci/jenkins.git
cd jenkins
mvn clean test
Run only the core unit tests:
cd core
mvn test
Execute war-specific functional tests:
cd war
mvn test
Build Configuration
The top-level pom.xml aggregates all modules and configures the Maven Surefire plugin to execute tests discovered under each module's src/test/java directory. According to the jenkinsci/jenkins source code, this standard layout ensures consistent test discovery across core, war, cli, and plugin test components.
Summary
- Core tests reside in
core/src/test/javawith resources incore/src/test/resources - War tests are located in
war/src/test/javaand launch temporary Jenkins instances - CLI tests exist in
cli/src/test/javafor command-line client validation - Plugin integration tests use
test/src/test/javaandtest/src/test/resourcesfor harnesses and fixtures - Execute all tests with
mvn testfrom the repository root, or target specific modules by runningmvn testwithin individual directories
Frequently Asked Questions
Where are Jenkins core unit tests located?
Core unit tests are located in core/src/test/java according to the jenkinsci/jenkins source code structure. This directory contains Java test classes covering security, monitoring, and internal utilities, while supporting fixtures reside in core/src/test/resources.
How do I run only the Jenkins war tests?
Navigate to the war directory and execute mvn test. This command runs the executable tests in war/src/test/java that validate the web application by starting a temporary Jenkins instance.
What build tool manages Jenkins test execution?
The jenkinsci/jenkins repository uses Maven to orchestrate test execution. The root pom.xml configures the build lifecycle to automatically discover and run tests from each module's src/test/java directory when you execute mvn test.
Where are Jenkins plugin integration test fixtures stored?
Plugin integration test fixtures, including sample plugin packages and update-center JSON files, are stored in test/src/test/resources. This directory supports the generic test harnesses located in test/src/test/java used for plugin-related validation.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →