Running Tests in Apache Ambari
Run commands from the repository root with JDK 17, Maven 3.9.x, the supported CPython build environment, and Node 22/npm when UI tests are included.
Java Tests
Run Server Java tests and reactor dependencies:
mvn -am test -pl ambari-server -DskipPythonTests -DskipAdminWebTests=true -DskipUiBuild=true -Drat.skip
Run one existing class, allowing reactor dependencies that do not contain that class:
mvn -am test -pl ambari-server -DskipPythonTests -Dtest=AmbariServerTest -Dsurefire.failIfNoSpecifiedTests=false -DskipAdminWebTests=true -DskipUiBuild=true -Drat.skip
Python Tests
The Agent and Server Maven executions invoke their respective src/test/python/unitTests.py runners. The default mask is [Tt]est*.py, covering both supported filename styles. Run the selected product module without excluding Python tests:
mvn -am test -pl ambari-agent -DskipSurefireTests -DskipAdminWebTests=true -DskipUiBuild=true -Drat.skip
mvn -am test -pl ambari-server -DskipSurefireTests -DskipAdminWebTests=true -DskipUiBuild=true -Drat.skip
For an existing Agent file, add -Dpython.test.mask=TestCommandStatusDict.py to the Agent command. Use an actual filename or supported glob for the selected runner; zero discovered tests is an error, not a passing suite. These executions test Ambari product Python code, separately from the packaged cp39 ABI and the website test suite.
React And Website Checks
The ambari-web/latest package has its own npm scripts. Run these from that directory with its Node/npm toolchain:
npm ci
npm test
npm run build
In the separate website repository, yarn test:i18n checks translated document structure and yarn test:e2e runs website browser checks. Website checks do not validate Ambari Server or Agent behavior.
Integration Tests
The functional-test module is ambari-funtest. Its Maven configuration defines Surefire/Failsafe execution; prepare its database/container/service prerequisites before running:
mvn -am verify -pl ambari-funtest -DskipFunctionalTests=false -DskipPythonTests -DskipAdminWebTests=true -DskipUiBuild=true -Drat.skip
Reports And Parameters
-am builds dependencies, -pl selects projects, -DskipPythonTests skips the Python executions, -DskipSurefireTests skips configured Java Surefire tests, and -Drat.skip skips Apache RAT. Functional and UI test switches have their own scopes. Record every skip; do not substitute an undeclared skipJavaTests property or a nonexistent integration profile. See Unit Test Reports.
The command contracts come from the pinned Agent POM, Server POM, and functional-test POM.