diff options
author | Vratko Polak <vrpolak@cisco.com> | 2024-12-03 13:22:24 +0100 |
---|---|---|
committer | Vratko Polak <vrpolak@cisco.com> | 2024-12-03 12:33:05 +0000 |
commit | 7022a1451be7cc76df0a362351f130de52cb6eae (patch) | |
tree | 366580c92e6c5bb7514d05249b29b8245ba36d1a /resources | |
parent | 5f2e66d0c62a3c563b14cdabbd3d7c13ae1181d0 (diff) |
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 <vrpolak@cisco.com>
(cherry picked from commit 14e4f9447ca85613ec6cdfa553464b02a3d62fab)
Diffstat (limited to 'resources')
-rw-r--r-- | resources/libraries/bash/entry/bisect.sh | 9 |
1 files 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" |