Skip to content

Commit

Permalink
chore: revert any git changes as quick as possible
Browse files Browse the repository at this point in the history
Otherwise, manual revert is necessary if the test script has to be executed again after a failure.
  • Loading branch information
vvagaytsev committed Mar 29, 2023
1 parent 06c45df commit 8b26d7b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scripts/test-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ test_release() {
echo "→ Respond to the prompts to see if the create command works"
echo ""
${garden_release} create module
revert_git_changes

cd ..
cd vote
Expand All @@ -100,6 +101,7 @@ test_release() {
echo ""
echo "→ Stopping sync for vote app"
${garden_release} sync stop vote
revert_git_changes

echo ""
echo "→ Running 'garden serve' in disabled-configs project (the test script will continue after 1 minute)."
Expand All @@ -118,7 +120,7 @@ test_release() {
echo "Done!"
}

cleanup() {
revert_git_changes() {
echo ""
echo "Reverting git changes"
git checkout .
Expand All @@ -127,4 +129,5 @@ cleanup() {

download_release
test_release
cleanup
# to ensure that any possible intermediate changes would be reverted too
revert_git_changes

0 comments on commit 8b26d7b

Please sign in to comment.