Skip to content

Commit

Permalink
git reset before checkout in scripts
Browse files Browse the repository at this point in the history
This is a temporary fix for allowing
`git checkout` to work in our perf presubmit
scripts which fail because of earlier `chmod +x`
calls which make those shell scripts modified and
that fails the next `git checkout` calls.

This is a temporary fix, which will be removed in next change
which will remove chmod calls from all script files.
  • Loading branch information
gargnitingoogle committed Nov 1, 2023
1 parent 87f7f41 commit 704056e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions perfmetrics/scripts/presubmit_test/pr_perf_test/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ if [[ "$perfTestStr" == *"$EXECUTE_PERF_TEST_LABEL"* ]];
then
# Executing perf tests for master branch
install_requirements
git reset --hard
git checkout master
# Store results
touch result.txt
Expand All @@ -97,6 +98,7 @@ then

# Executing perf tests for PR branch
echo checkout PR branch
git reset --hard
git checkout pr/$KOKORO_GITHUB_PULL_REQUEST_NUMBER
echo Mounting gcs bucket from pr branch and execute tests
execute_perf_test
Expand All @@ -110,6 +112,7 @@ fi
if [[ "$integrationTestsStr" == *"$EXECUTE_INTEGRATION_TEST_LABEL"* ]];
then
echo checkout PR branch
git reset --hard
git checkout pr/$KOKORO_GITHUB_PULL_REQUEST_NUMBER

echo "Running e2e tests...."
Expand Down

0 comments on commit 704056e

Please sign in to comment.