Testing PXF
PXF uses multiple testing layers to ensure quality.
Unit Tests
Java unit tests are located alongside the source code in each module's src/test/ directory.
# Run all unit tests via Gradle
cd server
./gradlew test
# Run tests for a specific module
./gradlew :pxf-hdfs:test
./gradlew :pxf-jdbc:test
Go CLI tests use the Ginkgo framework:
cd cli
ginkgo -r
Integration Tests (automation/)
The automation/ directory contains Java-based integration tests that run PXF against real data sources (HDFS, Hive, HBase, JDBC, etc.).
# Run automation tests (requires running Cloudberry + PXF + data services)
cd automation
make TEST=<test-class>
Key test directories:
automation/src/test/java/org/apache/cloudberry/pxf/automation/features/— feature testsautomation/src/test/java/org/apache/cloudberry/pxf/automation/smoke/— smoke tests
Regression Tests (regression/)
End-to-end tests using PostgreSQL's pg_regress framework:
cd regression
make installcheck
CI Environment
PXF CI uses Docker Compose with two containers:
| Container | Purpose |
|---|---|
singlecluster | Hadoop ecosystem (HDFS, Hive, HBase) |
pxf-cbdb-dev | Cloudberry + PXF + test runner |
CI configuration: .github/workflows/pxf-ci.yml
See CI/CD for detailed CI documentation.
Writing New Tests
When adding a new feature or fixing a bug:
- Unit tests — add to the relevant module under
server/<module>/src/test/ - Integration tests — add to
automation/src/test/java/if the feature requires end-to-end validation - Regression tests — add to
regression/for SQL-level validation