This is an automated email from the ASF dual-hosted git repository. yjhjstz pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/cloudberry.git
commit 021d378d1fbcfdf2f969dd64bd112f67aea23268 Author: Jianghua Yang <[email protected]> AuthorDate: Wed Mar 18 07:45:52 2026 +0800 Fix PostgresNode.pm for TAP tests on CBDB Two fixes: - Use TestLib::slurp_file instead of PostgreSQL::Test::Utils::slurp_file in adjust_conf(). PostgresNode.pm only imports TestLib, not PostgreSQL::Test::Utils, so the latter is undefined and causes t/101_restore_point_and_startup_pause to fail. - Replace cp with install -m 644 in enable_archiving() archive_command. coreutils 8.32 (Rocky 8, Ubuntu 22.04) uses copy_file_range() in cp which crashes on Docker overlayfs. install does not use copy_file_range(), avoiding the crash. Also add ic-recovery test suite to rocky8 and deb CI pipelines. --- .github/workflows/build-cloudberry-rocky8.yml | 4 +++ .../automation/cloudberry/scripts/parse-results.pl | 31 ++++++++++++++++++---- src/test/perl/PostgresNode.pm | 4 +-- 3 files changed, 32 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-cloudberry-rocky8.yml b/.github/workflows/build-cloudberry-rocky8.yml index 2abf88060e3..e0936c725c8 100644 --- a/.github/workflows/build-cloudberry-rocky8.yml +++ b/.github/workflows/build-cloudberry-rocky8.yml @@ -339,6 +339,10 @@ jobs: }, {"test":"ic-cbdb-parallel", "make_configs":["src/test/regress:installcheck-cbdb-parallel"] + }, + {"test":"ic-recovery", + "make_configs":["src/test/recovery:installcheck"], + "enable_core_check":false } ] }' diff --git a/devops/build/automation/cloudberry/scripts/parse-results.pl b/devops/build/automation/cloudberry/scripts/parse-results.pl index d09085d5fb9..2c754bcae9d 100755 --- a/devops/build/automation/cloudberry/scripts/parse-results.pl +++ b/devops/build/automation/cloudberry/scripts/parse-results.pl @@ -110,7 +110,7 @@ my @failed_test_list = (); my @ignored_test_list = (); while (<$fh>) { - # Match the summary lines + # Match the summary lines (pg_regress format) if (/All (\d+) tests passed\./) { $status = 'passed'; $total_tests = $1; @@ -132,8 +132,22 @@ while (<$fh>) { $status = 'failed'; $failed_tests = $1 - $3; $ignored_tests = $3; - $total_tests = $2; - $passed_tests = $2 - $1; + + # TAP/prove summary format: "Files=N, Tests=N, ..." + } elsif (/^Files=\d+, Tests=(\d+),/) { + $total_tests = $1; + + # TAP/prove result: "Result: PASS" or "Result: FAIL" + } elsif (/^Result: PASS/) { + $status = 'passed'; + $passed_tests = $total_tests; + $failed_tests = 0; + } elsif (/^Result: FAIL/) { + $status = 'failed'; + + # TAP individual test failure: " t/xxx.pl (Wstat: ...)" + } elsif (/^\s+(t\/\S+\.pl)\s+\(Wstat:/) { + push @failed_test_list, $1; } # Capture failed tests @@ -150,8 +164,15 @@ while (<$fh>) { # Close the log file close $fh; -# Validate failed test count matches found test names -if ($status eq 'failed' && scalar(@failed_test_list) != $failed_tests) { +# For TAP format, derive failed/passed counts from collected test names +if ($status eq 'failed' && $failed_tests == 0 && scalar(@failed_test_list) > 0) { + $failed_tests = scalar(@failed_test_list); + $passed_tests = $total_tests - $failed_tests if $total_tests > 0; +} + +# Validate failed test count matches found test names (pg_regress format only) +if ($status eq 'failed' && $failed_tests > 0 && scalar(@failed_test_list) > 0 + && scalar(@failed_test_list) != $failed_tests) { print "Error: Found $failed_tests failed tests in summary but found " . scalar(@failed_test_list) . " failed test names\n"; print "Failed test names found:\n"; foreach my $test (@failed_test_list) { diff --git a/src/test/perl/PostgresNode.pm b/src/test/perl/PostgresNode.pm index 241ed8d49e8..e3010870f35 100644 --- a/src/test/perl/PostgresNode.pm +++ b/src/test/perl/PostgresNode.pm @@ -632,7 +632,7 @@ sub adjust_conf my $conffile = $self->data_dir . '/' . $filename; - my $contents = PostgreSQL::Test::Utils::slurp_file($conffile); + my $contents = TestLib::slurp_file($conffile); my @lines = split(/\n/, $contents); my @result; my $eq = $skip_equals ? '' : '= '; @@ -1220,7 +1220,7 @@ sub enable_archiving my $copy_command = $TestLib::windows_os ? qq{copy "%p" "$path\\\\%f"} - : qq{cp "%p" "$path/%f"}; + : qq{install -m 644 "%p" "$path/%f"}; # Enable archive_mode and archive_command on node $self->append_conf( --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
