From 14e4f9447ca85613ec6cdfa553464b02a3d62fab Mon Sep 17 00:00:00 2001 From: Vratko Polak Date: Tue, 3 Dec 2024 13:22:24 +0100 Subject: [PATCH] fix(bisect): Adjust bash script for Ubuntu 24.04 Newer git versions gives: error: cannot delete branch 'earliest' used by worktree if branches involved in bisect are to be deleted before bisect ends. + Remove comment about reliably deleting branches after failure, as having them may be useful for debugging (and does not matter in CI). + Move branch cleanup to the start, and allow it to fail in CI. Change-Id: Iebee5be5e10ae2f4de8218f70952c66b16b2a030 Signed-off-by: Vratko Polak --- resources/libraries/bash/entry/bisect.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/resources/libraries/bash/entry/bisect.sh b/resources/libraries/bash/entry/bisect.sh index d5cb1d51ba..78375960a4 100644 --- a/resources/libraries/bash/entry/bisect.sh +++ b/resources/libraries/bash/entry/bisect.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Copyright (c) 2023 Cisco and/or its affiliates. +# Copyright (c) 2024 Cisco and/or its affiliates. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: @@ -104,6 +104,9 @@ get_test_tag_string || die # Unfortunately, git bisect only works at the top of the repo. cd "${VPP_DIR}" || die +# Local cleanup, expected to fail in CI. +git branch -D "earliest" "middle" "latest" || true + # Save the current commit. git checkout -b "latest" # Save the lower bound commit. @@ -150,7 +153,6 @@ git describe || die build_vpp_ubuntu "EARLIEST" || die set_aside_build_artifacts "earliest" || die git checkout "middle" || die "Failed to checkout middle commit." -git branch -D "earliest" "latest" || die "Failed to remove branches." # Done with repo manipulation for now, testing commences. initialize_csit_dirs "earliest" "middle" "latest" || die set_perpatch_dut || die @@ -181,8 +183,5 @@ untrap_and_unreserve_testbed || die # See function documentation for the logic in the loop. main_bisect_loop || die -# In worst case, the middle branch is still checked out. -# TODO: Is there a way to ensure "middle" branch is always deleted? -git branch -D "middle" || true # Delete symlinks to prevent duplicate archiving. rm -vrf "csit_early" "csit_late" "csit_mid" -- 2.16.6