Skip to content

Commit 40b81f4

Browse files
authored
test: ✅ use HEAD, including uncommitted changes, when testing (#185)
# Description This allows us to test it with uncommitted changes. This PR needs a quick review. ## Checklist - [x] Ran `just run-all`
1 parent 6592fd9 commit 40b81f4

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

test-template.sh

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,16 @@ fi
1919
test_name="test-package-$hosting_provider"
2020
test_dir="$(pwd)/_temp/$is_seedcase_project/$test_name"
2121
template_dir="$(pwd)"
22-
# Use the latest commit for the template
23-
commit=$(git rev-parse HEAD)
2422

2523
# Needs three arguments:
2624
#
2725
# 1. Template directory
2826
# 2. Destination directory
2927
# 3. VCS ref (commit, branch, tag, etc.)
3028
copy () {
31-
# vcs-ref means the current commit/head, not a tag.
29+
# `-r HEAD` means to copy from the current HEAD, including uncommitted changes
3230
uvx copier copy $1 $2 \
33-
--vcs-ref=$3 \
31+
-r HEAD \
3432
--defaults \
3533
--data is_seedcase_project=$is_seedcase_project \
3634
--data github_user="first-last" \
@@ -56,7 +54,7 @@ mkdir -p $test_dir
5654
echo "Testing copy for new projects when: 'is_seedcase_project'='$is_seedcase_project', 'hosting_provider'='$hosting_provider' -----------"
5755
(
5856
cd $test_dir &&
59-
copy $template_dir $test_dir $commit &&
57+
copy $template_dir $test_dir &&
6058
git init -b main &&
6159
git add . &&
6260
git commit --quiet -m "test: initial copy" &&
@@ -66,7 +64,7 @@ echo "Testing copy for new projects when: 'is_seedcase_project'='$is_seedcase_pr
6664
git add . &&
6765
git commit --quiet -m "test: preparing to recopy from the template" &&
6866
uvx copier recopy \
69-
--vcs-ref=$commit \
67+
-r HEAD \
7068
--defaults \
7169
--overwrite \
7270
--skip-tasks \
@@ -76,7 +74,7 @@ echo "Testing copy for new projects when: 'is_seedcase_project'='$is_seedcase_pr
7674
rm .cz.toml .copier-answers.yml &&
7775
git add . &&
7876
git commit --quiet -m "test: preparing to copy onto an existing package" &&
79-
copy $template_dir $test_dir $commit #&&
77+
copy $template_dir $test_dir #&&
8078
# Checks and builds -----
8179
# just run-all
8280
)

0 commit comments

Comments
 (0)