Skip to content

Commit 13f4a7e

Browse files
committed
test: ✅ update test script from t-squared updates
1 parent f31cbec commit 13f4a7e

1 file changed

Lines changed: 10 additions & 15 deletions

File tree

test-template.sh

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
# Needs two arguments:
3+
# Needs these arguments:
44
#
55
# 1. is_seedcase_project: true or false
66
# 2. hosting_provider: e.g., "github", "gitlab", etc.
@@ -16,17 +16,16 @@ if [ -z "$is_seedcase_project" ] || [ -z "$hosting_provider" ]; then
1616
fi
1717

1818
# Set up variables and functions for the test -----
19-
test_name="test-package-$hosting_provider"
20-
test_dir="$(pwd)/_temp/$is_seedcase_project/$test_name"
19+
test_name="$is_seedcase_project-$hosting_provider"
20+
test_dir="$(pwd)/_temp/auto/$test_name"
2121
template_dir="$(pwd)"
2222

2323
# Needs three arguments:
2424
#
2525
# 1. Template directory
2626
# 2. Destination directory
27-
# 3. VCS ref (commit, branch, tag, etc.)
2827
copy () {
29-
# `-r HEAD` means to copy from the current HEAD, including uncommitted changes
28+
# '-r HEAD' means use the HEAD, including uncommitted changes.
3029
uvx copier copy $1 $2 \
3130
-r HEAD \
3231
--defaults \
@@ -38,9 +37,7 @@ copy () {
3837
--data author_email="first.last@example.com" \
3938
--data review_team="@first-last/developers" \
4039
--data github_board_number=22 \
41-
--overwrite \
42-
--skip-tasks \
43-
--trust
40+
--overwrite
4441
}
4542

4643
# Pre-test setup -----
@@ -60,7 +57,7 @@ echo "Testing copy for new projects when: 'is_seedcase_project'='$is_seedcase_pr
6057
git commit --quiet -m "test: initial copy" &&
6158
# Check that recopy works -----
6259
echo "Testing recopy when: 'is_seedcase_project'='$$is_seedcase_project', 'hosting_provider'='$hosting_provider' -----------" &&
63-
rm .cz.toml &&
60+
rm .gitignore &&
6461
git add . &&
6562
git commit --quiet -m "test: preparing to recopy from the template" &&
6663
uvx copier recopy \
@@ -69,12 +66,10 @@ echo "Testing copy for new projects when: 'is_seedcase_project'='$is_seedcase_pr
6966
--overwrite \
7067
--skip-tasks \
7168
--trust &&
72-
# Check that copying onto an existing package works -----
69+
# Check that copying onto an existing project works -----
7370
echo "Testing copy in existing projects when: 'is_seedcase_project'='$is_seedcase_project', 'hosting_provider'='$hosting_provider' -----------" &&
74-
rm .cz.toml .copier-answers.yml &&
71+
rm .gitignore .copier-answers.yml &&
7572
git add . &&
76-
git commit --quiet -m "test: preparing to copy onto an existing package" &&
77-
copy $template_dir $test_dir #&&
78-
# Checks and builds -----
79-
# just run-all
73+
git commit --quiet -m "test: preparing to copy onto an existing project" &&
74+
copy $template_dir $test_dir
8075
)

0 commit comments

Comments
 (0)