Skip to content

Commit

Permalink
Add move_to_test case
Browse files Browse the repository at this point in the history
83b688006cb46de36008975bb2ad8f5906a838ae
  • Loading branch information
nivcertora committed Jan 21, 2025
1 parent 6b41d06 commit 7adac19
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
1 change: 1 addition & 0 deletions .git-private-commit
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ a23cf5548c99c48801df611bacc25521ec676ab1
0fd7b0f06285a029ddc5f1d0df2ec66e3eb6b774
fcf1d6713702ca6831a83cc515c24b7faab1fbd0
821a9e8a5e8f526c44e6b0d017e2d4f764d936d5
83b688006cb46de36008975bb2ad8f5906a838ae
41 changes: 41 additions & 0 deletions tests/move_to_tests_delete.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash

REPO_PATH="/Users/nivvaknin/CERTORA/cloud-rel-private"
BRANCH_PREFIX="move-to-tests-delete"
MAIN_BRANCH="main"
DATE=$(date +%Y%m%d%H%M%S)

# Navigate to the repository
cd $REPO_PATH || { echo "Repository not found at $REPO_PATH"; exit 1; }

# Ensure the repo is clean
git reset --hard
git clean -fd

# Create branch, move file, and push
branch_name="${BRANCH_PREFIX}-${DATE}"
file_outside="file_outside_${DATE}.txt"
file_inside="tests_delete/file_inside_${DATE}.txt"

echo "Creating branch: $branch_name"
git checkout -b $branch_name

echo "Adding file outside tests_delete: $file_outside"
echo "This file will be moved into tests_delete." > $file_outside
git add $file_outside
git commit -m "Add file outside tests_delete"

echo "Moving file into tests_delete"
mkdir -p $(dirname $file_inside)
git mv $file_outside $file_inside
git commit -m "Move file into tests_delete"

echo "Pushing branch: $branch_name"
git push origin $branch_name

# Open a PR and merge it
echo "Opening a PR for branch: $branch_name"
gh pr create --base $MAIN_BRANCH --head $branch_name --title "Move file into tests_delete" --body "This PR tests moving a file into tests_delete."

echo "Merging the PR..."
gh pr merge --squash --delete-branch

0 comments on commit 7adac19

Please sign in to comment.