Yes, use TAP::Harness::JUnit
to format the test result.
JUNIT_OUTPUT_FILE=/tmp/circleci-test-results/all_database_tests_results.xml pg_prove -U ubuntu -d $DB database/test/all_database_tests.sql --verbose --harness TAP::Harness::JUnit
JUNIT_OUTPUT_FILE
tell pg_prove where the test result file name and path;
--harness TAP::Harness::JUnit
tell pg_prove which format of result to output.
Before you install TAP::Harness::JUnit
, you might need to install XML::Simple
by command sudo cpan XML::Simple
and Test::Deep
.
the full example is below:
git clone https://github.com/jlavallee/tap-harness-junit.git
git clone https://github.com/rjbs/Test-Deep.git
sudo cpan TAP::Parser::SourceHandler::pgTAP # Install pg_prove
psql -U ubuntu -d $DB -c "CREATE EXTENSION IF NOT EXISTS pgtap;" #Create pgtap extension;
sudo cpan XML::Simple #Install XML::Simple
cd Test-Deep && perl Makefile.PL && sudo make && sudo make test && sudo make install
cd tap-harness-junit && perl Build.PL && sudo ./Build && sudo ./Build install
JUNIT_OUTPUT_FILE=/tmp/circleci-test-results/all_database_tests_results.xml pg_prove -U ubuntu -d $DB database/test/all_database_tests.sql --verbose --harness TAP::Harness::JUnit