Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion scripts/fetch_tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -291,13 +291,23 @@ gettool_ginkgo() {
pushd "${clone_dir}" &>/dev/null

local test_binary="./bin/extended-platform-tests"
go build -o "${test_binary}" ./cmd/extended-platform-tests
make build

# Copy binary to centralized location
if [[ -f "${test_binary}" ]]; then
cp "${test_binary}" "${binary_path}"
chmod +x "${binary_path}"
echo "Binary installed to ${binary_path}"

# Copy handleresult.py to the tools directory
if [[ -f "${clone_dir}/pipeline/handleresult.py" ]] && [[ -f "${HANDLERESULT_SCRIPT}" ]]; then
cp "${clone_dir}/pipeline/handleresult.py" "${HANDLERESULT_SCRIPT}"
chmod +x "${HANDLERESULT_SCRIPT}"
echo "handleresult.py installed to ${HANDLERESULT_SCRIPT}"
else
echo "Warning: pipeline/handleresult.py not found in repository"
fi

popd &>/dev/null
else
echo "Error: Test binary not found after build"
Expand Down
1 change: 1 addition & 0 deletions test/bin/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export IMAGEDIR="${OUTPUTDIR}/test-images"

# Ginkgo test binary path
export GINKGO_TEST_BINARY="${OUTPUTDIR}/bin/extended-platform-tests"
export HANDLERESULT_SCRIPT="${OUTPUTDIR}/bin/handleresult.py"

# The storage pool base name for VMs.
# The actual pool names will be '${VM_POOL_BASENAME}-${SCENARIO}'.
Expand Down
39 changes: 38 additions & 1 deletion test/bin/scenario.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1139,7 +1139,7 @@ run_gingko_tests() {
local -r filter_pattern="$1"
echo "Applying filter: ${filter_pattern}"
if [[ "${filter_pattern}" == ~* ]]; then
sed -i "/${filter_pattern#~}/d" "${case_selected}"
sed -i "/${filter_pattern#\~}/d" "${case_selected}"
else
sed -i -n "/${filter_pattern}/p" "${case_selected}"
fi
Expand All @@ -1161,9 +1161,46 @@ run_gingko_tests() {
record_junit "${vmname}" "run_gingko_tests" "OK"
popd &>/dev/null

# Clean the JUnit XML files
echo "Cleaning JUnit XML files..."
cleanup_success=true

if [[ ! -f "${HANDLERESULT_SCRIPT}" ]]; then
echo "Warning: pipeline/handleresult.py not found. Skipping XML cleanup."
Comment thread
kasturinarra marked this conversation as resolved.
else
for junit_file in "${test_results_dir}"/junit_e2e_*.xml; do
if [[ -f "${junit_file}" ]]; then
filename=$(basename "${junit_file}")
echo "Processing: ${filename}"

# Create backup
cp "${junit_file}" "${junit_file}.backup"

# Clean the XML
temp_file="${junit_file}.tmp"
if python3 "${HANDLERESULT_SCRIPT}" -a replace -i "${junit_file}" -o "${temp_file}" 2>/dev/null; then
mv "${temp_file}" "${junit_file}"

echo "✓ Cleaned: ${filename}"
rm "${junit_file}.backup" # Remove backup on success
else
echo "✗ Failed to clean: ${filename} (restored from backup)"
mv "${junit_file}.backup" "${junit_file}" # Restore from backup
cleanup_success=false
fi
fi
done
fi

# Display results summary
echo "Gingko test execution completed"
echo "Results are available in: ${test_results_dir}"
if [[ "${cleanup_success}" == "true" ]]; then
echo "✓ JUnit XML files have been cleaned (Monitor test cases removed)"
else
echo "⚠ Some XML files could not be cleaned (originals preserved)"
fi

if [[ -f "${test_results_dir}/test-output.log" ]]; then
echo "Test output log: ${test_results_dir}/test-output.log"
fi
Expand Down