Skip to content

Commit cf3d098

Browse files
author
Anthony Sterling
authored
Merge pull request #5 from actions/remove-master-from-tests
Remove references to master from tests
2 parents 61c2f4a + 71a43cf commit cf3d098

File tree

2 files changed

+53
-53
lines changed

2 files changed

+53
-53
lines changed

script/test-build

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -21,34 +21,34 @@ trap "after_suite" SIGINT
2121

2222
function test_pull() {
2323
# Pull new repo
24-
setup_src "org/repo:heads/master:a5984bb887dd2fcdc2892cd906d6f004844d1142"
24+
setup_src "org/repo:heads/main:a5984bb887dd2fcdc2892cd906d6f004844d1142"
2525
setup_cache
2626
pull --repo-name "org/repo" "pulling new repo"
27-
assert_cache_sha "org/repo" "heads/master" "a5984bb887dd2fcdc2892cd906d6f004844d1142" "pulling new repo org/repo"
27+
assert_cache_sha "org/repo" "heads/main" "a5984bb887dd2fcdc2892cd906d6f004844d1142" "pulling new repo org/repo"
2828

2929
echo "all pull tests passed successfully"
3030
}
3131

3232
function test_push() {
33-
# Push with a new change to master
34-
setup_cache "org/repo:heads/master:e9009d51dd6da2c363d1d14779c53dd27fcb0c52"
35-
setup_dest "org/repo:heads/master:a5984bb887dd2fcdc2892cd906d6f004844d1142"
33+
# Push with a new change to main
34+
setup_cache "org/repo:heads/main:e9009d51dd6da2c363d1d14779c53dd27fcb0c52"
35+
setup_dest "org/repo:heads/main:a5984bb887dd2fcdc2892cd906d6f004844d1142"
3636

37-
push "pushing new commit to master"
38-
assert_dest_sha "org/repo" "heads/master" "e9009d51dd6da2c363d1d14779c53dd27fcb0c52" "updating org/repo:heads/master to new commit"
37+
push "pushing new commit to main"
38+
assert_dest_sha "org/repo" "heads/main" "e9009d51dd6da2c363d1d14779c53dd27fcb0c52" "updating org/repo:heads/main to new commit"
3939

4040
# Push a non-linear change
41-
setup_cache "org/repo:heads/master:a5984bb887dd2fcdc2892cd906d6f004844d1142"
42-
setup_dest "org/repo:heads/master:e9009d51dd6da2c363d1d14779c53dd27fcb0c52"
41+
setup_cache "org/repo:heads/main:a5984bb887dd2fcdc2892cd906d6f004844d1142"
42+
setup_dest "org/repo:heads/main:e9009d51dd6da2c363d1d14779c53dd27fcb0c52"
4343

44-
push "pushing to an old commit to master"
45-
assert_dest_sha "org/repo" "heads/master" "a5984bb887dd2fcdc2892cd906d6f004844d1142" "updating heads/master to an old commit"
44+
push "pushing to an old commit to main"
45+
assert_dest_sha "org/repo" "heads/main" "a5984bb887dd2fcdc2892cd906d6f004844d1142" "updating heads/main to an old commit"
4646

47-
# Push with no changes to master
48-
setup_cache "org/repo:heads/master:a5984bb887dd2fcdc2892cd906d6f004844d1142"
49-
setup_dest "org/repo:heads/master:a5984bb887dd2fcdc2892cd906d6f004844d1142"
50-
push "pushing no changes to master"
51-
assert_dest_sha "org/repo" "heads/master" "a5984bb887dd2fcdc2892cd906d6f004844d1142" "leaving org/repo:heads/master at existing commit"
47+
# Push with no changes to main
48+
setup_cache "org/repo:heads/main:a5984bb887dd2fcdc2892cd906d6f004844d1142"
49+
setup_dest "org/repo:heads/main:a5984bb887dd2fcdc2892cd906d6f004844d1142"
50+
push "pushing no changes to main"
51+
assert_dest_sha "org/repo" "heads/main" "a5984bb887dd2fcdc2892cd906d6f004844d1142" "leaving org/repo:heads/main at existing commit"
5252

5353
# Push multiple branches
5454
setup_cache "org/repo:heads/change:e9009d51dd6da2c363d1d14779c53dd27fcb0c52" \
@@ -61,86 +61,86 @@ function test_push() {
6161
assert_dest_sha "org/repo" "heads/nochange" "a5984bb887dd2fcdc2892cd906d6f004844d1142" "leaving org/repo:heads/nochange at existing commit"
6262

6363
# Pushing multiple branches and tags
64-
setup_cache "org/repo:heads/master:e9009d51dd6da2c363d1d14779c53dd27fcb0c52" \
64+
setup_cache "org/repo:heads/main:e9009d51dd6da2c363d1d14779c53dd27fcb0c52" \
6565
"org/repo:tags/v1:e9009d51dd6da2c363d1d14779c53dd27fcb0c52"
66-
setup_dest "org/repo:heads/master:a5984bb887dd2fcdc2892cd906d6f004844d1142" \
66+
setup_dest "org/repo:heads/main:a5984bb887dd2fcdc2892cd906d6f004844d1142" \
6767
"org/repo:tags/v1:a5984bb887dd2fcdc2892cd906d6f004844d1142"
6868

6969
push "pushing multiple branches and tags"
70-
assert_dest_sha "org/repo" "heads/master" "e9009d51dd6da2c363d1d14779c53dd27fcb0c52" "updating org/repo:heads/master to new commit"
70+
assert_dest_sha "org/repo" "heads/main" "e9009d51dd6da2c363d1d14779c53dd27fcb0c52" "updating org/repo:heads/main to new commit"
7171
assert_dest_sha "org/repo" "tags/v1" "e9009d51dd6da2c363d1d14779c53dd27fcb0c52" "updating org/repo:tags/v1 to new commit"
7272

7373
# Pushing multiple repositories
74-
setup_cache "org1/repo1:heads/master:e9009d51dd6da2c363d1d14779c53dd27fcb0c52" \
75-
"org1/repo2:heads/master:e9009d51dd6da2c363d1d14779c53dd27fcb0c52" \
74+
setup_cache "org1/repo1:heads/main:e9009d51dd6da2c363d1d14779c53dd27fcb0c52" \
75+
"org1/repo2:heads/main:e9009d51dd6da2c363d1d14779c53dd27fcb0c52" \
7676
"org1/repo2:tags/v1:e9009d51dd6da2c363d1d14779c53dd27fcb0c52" \
77-
"org2/repo1:heads/master:e9009d51dd6da2c363d1d14779c53dd27fcb0c52"
78-
setup_dest "org1/repo1:heads/master:a5984bb887dd2fcdc2892cd906d6f004844d1142" \
79-
"org1/repo2:heads/master:a5984bb887dd2fcdc2892cd906d6f004844d1142" \
77+
"org2/repo1:heads/main:e9009d51dd6da2c363d1d14779c53dd27fcb0c52"
78+
setup_dest "org1/repo1:heads/main:a5984bb887dd2fcdc2892cd906d6f004844d1142" \
79+
"org1/repo2:heads/main:a5984bb887dd2fcdc2892cd906d6f004844d1142" \
8080
"org1/repo2:tags/v1:a5984bb887dd2fcdc2892cd906d6f004844d1142" \
81-
"org2/repo1:heads/master:a5984bb887dd2fcdc2892cd906d6f004844d1142"
81+
"org2/repo1:heads/main:a5984bb887dd2fcdc2892cd906d6f004844d1142"
8282

8383
push "pushing multiple repositories"
84-
assert_dest_sha "org1/repo1" "heads/master" "e9009d51dd6da2c363d1d14779c53dd27fcb0c52" "updating org1/repo1:heads/master to new commit"
85-
assert_dest_sha "org1/repo2" "heads/master" "e9009d51dd6da2c363d1d14779c53dd27fcb0c52" "updating org1/repo2:heads/master to new commit"
84+
assert_dest_sha "org1/repo1" "heads/main" "e9009d51dd6da2c363d1d14779c53dd27fcb0c52" "updating org1/repo1:heads/main to new commit"
85+
assert_dest_sha "org1/repo2" "heads/main" "e9009d51dd6da2c363d1d14779c53dd27fcb0c52" "updating org1/repo2:heads/main to new commit"
8686
assert_dest_sha "org1/repo2" "tags/v1" "e9009d51dd6da2c363d1d14779c53dd27fcb0c52" "updating org1/repo2:tags/v1 to new commit"
87-
assert_dest_sha "org2/repo1" "heads/master" "e9009d51dd6da2c363d1d14779c53dd27fcb0c52" "updating org2/repo1:tags/v1 to new commit"
87+
assert_dest_sha "org2/repo1" "heads/main" "e9009d51dd6da2c363d1d14779c53dd27fcb0c52" "updating org2/repo1:tags/v1 to new commit"
8888

8989
echo "all push tests passed successfully"
9090
}
9191

9292
function test_sync() {
9393
# Sync no change without cached
94-
setup_src "org/repo:heads/master:a5984bb887dd2fcdc2892cd906d6f004844d1142"
94+
setup_src "org/repo:heads/main:a5984bb887dd2fcdc2892cd906d6f004844d1142"
9595
setup_cache
96-
setup_dest "org/repo:heads/master:a5984bb887dd2fcdc2892cd906d6f004844d1142"
96+
setup_dest "org/repo:heads/main:a5984bb887dd2fcdc2892cd906d6f004844d1142"
9797
sync --repo-name "org/repo" "syncing a new commit in an uncached repo"
98-
assert_dest_sha "org/repo" "heads/master" "a5984bb887dd2fcdc2892cd906d6f004844d1142" "syncing no changes without cache"
98+
assert_dest_sha "org/repo" "heads/main" "a5984bb887dd2fcdc2892cd906d6f004844d1142" "syncing no changes without cache"
9999

100100
# Sync a new commit without cache
101-
setup_src "org/repo:heads/master:e9009d51dd6da2c363d1d14779c53dd27fcb0c52"
101+
setup_src "org/repo:heads/main:e9009d51dd6da2c363d1d14779c53dd27fcb0c52"
102102
setup_cache
103-
setup_dest "org/repo:heads/master:a5984bb887dd2fcdc2892cd906d6f004844d1142"
103+
setup_dest "org/repo:heads/main:a5984bb887dd2fcdc2892cd906d6f004844d1142"
104104
sync --repo-name "org/repo" "syncing a new commit in an uncached repo"
105-
assert_dest_sha "org/repo" "heads/master" "e9009d51dd6da2c363d1d14779c53dd27fcb0c52" "syncing a new commit without cache"
105+
assert_dest_sha "org/repo" "heads/main" "e9009d51dd6da2c363d1d14779c53dd27fcb0c52" "syncing a new commit without cache"
106106

107107
# Sync no change with uncached
108-
setup_src "org/repo:heads/master:a5984bb887dd2fcdc2892cd906d6f004844d1142"
109-
setup_cache "org/repo:heads/master:a5984bb887dd2fcdc2892cd906d6f004844d1142"
110-
setup_dest "org/repo:heads/master:a5984bb887dd2fcdc2892cd906d6f004844d1142"
108+
setup_src "org/repo:heads/main:a5984bb887dd2fcdc2892cd906d6f004844d1142"
109+
setup_cache "org/repo:heads/main:a5984bb887dd2fcdc2892cd906d6f004844d1142"
110+
setup_dest "org/repo:heads/main:a5984bb887dd2fcdc2892cd906d6f004844d1142"
111111
sync --repo-name "org/repo" "syncing a new commit in an uncached repo"
112-
assert_dest_sha "org/repo" "heads/master" "a5984bb887dd2fcdc2892cd906d6f004844d1142" "syncing no changes with cache"
112+
assert_dest_sha "org/repo" "heads/main" "a5984bb887dd2fcdc2892cd906d6f004844d1142" "syncing no changes with cache"
113113

114114
# Sync a new commit with cache
115-
setup_src "org/repo:heads/master:e9009d51dd6da2c363d1d14779c53dd27fcb0c52"
116-
setup_cache "org/repo:heads/master:a5984bb887dd2fcdc2892cd906d6f004844d1142"
117-
setup_dest "org/repo:heads/master:a5984bb887dd2fcdc2892cd906d6f004844d1142"
115+
setup_src "org/repo:heads/main:e9009d51dd6da2c363d1d14779c53dd27fcb0c52"
116+
setup_cache "org/repo:heads/main:a5984bb887dd2fcdc2892cd906d6f004844d1142"
117+
setup_dest "org/repo:heads/main:a5984bb887dd2fcdc2892cd906d6f004844d1142"
118118
sync --repo-name "org/repo" "syncing a new commit in an uncached repo"
119-
assert_dest_sha "org/repo" "heads/master" "e9009d51dd6da2c363d1d14779c53dd27fcb0c52" "syncing a new commit with cache"
119+
assert_dest_sha "org/repo" "heads/main" "e9009d51dd6da2c363d1d14779c53dd27fcb0c52" "syncing a new commit with cache"
120120

121121
# Sync a non-linear change without cache
122-
setup_src "org/repo:heads/master:a5984bb887dd2fcdc2892cd906d6f004844d1142"
122+
setup_src "org/repo:heads/main:a5984bb887dd2fcdc2892cd906d6f004844d1142"
123123
setup_cache
124-
setup_dest "org/repo:heads/master:e9009d51dd6da2c363d1d14779c53dd27fcb0c52"
124+
setup_dest "org/repo:heads/main:e9009d51dd6da2c363d1d14779c53dd27fcb0c52"
125125

126126
sync --repo-name "org/repo" "syncing an old commit in an uncached repo"
127-
assert_dest_sha "org/repo" "heads/master" "a5984bb887dd2fcdc2892cd906d6f004844d1142" "syncing heads/master to an old commit without cache"
127+
assert_dest_sha "org/repo" "heads/main" "a5984bb887dd2fcdc2892cd906d6f004844d1142" "syncing heads/main to an old commit without cache"
128128

129129
# Sync a non-linear change with cache
130-
setup_src "org/repo:heads/master:a5984bb887dd2fcdc2892cd906d6f004844d1142"
131-
setup_cache "org/repo:heads/master:e9009d51dd6da2c363d1d14779c53dd27fcb0c52"
132-
setup_dest "org/repo:heads/master:e9009d51dd6da2c363d1d14779c53dd27fcb0c52"
130+
setup_src "org/repo:heads/main:a5984bb887dd2fcdc2892cd906d6f004844d1142"
131+
setup_cache "org/repo:heads/main:e9009d51dd6da2c363d1d14779c53dd27fcb0c52"
132+
setup_dest "org/repo:heads/main:e9009d51dd6da2c363d1d14779c53dd27fcb0c52"
133133

134134
sync --repo-name "org/repo" "syncing an old commit in an cached repo"
135-
assert_dest_sha "org/repo" "heads/master" "a5984bb887dd2fcdc2892cd906d6f004844d1142" "syncing heads/master to an old commit with cache"
135+
assert_dest_sha "org/repo" "heads/main" "a5984bb887dd2fcdc2892cd906d6f004844d1142" "syncing heads/main to an old commit with cache"
136136

137137
# Sync to a different repo
138-
setup_src "org/repo:heads/master:e9009d51dd6da2c363d1d14779c53dd27fcb0c52"
138+
setup_src "org/repo:heads/main:e9009d51dd6da2c363d1d14779c53dd27fcb0c52"
139139
setup_cache
140-
setup_dest "org2/repo2:heads/master:a5984bb887dd2fcdc2892cd906d6f004844d1142"
140+
setup_dest "org2/repo2:heads/main:a5984bb887dd2fcdc2892cd906d6f004844d1142"
141141

142142
sync --repo-name "org/repo:org2/repo2" "syncing org/repo aliased to org2/repo2"
143-
assert_dest_sha "org2/repo2" "heads/master" "e9009d51dd6da2c363d1d14779c53dd27fcb0c52" "syncing org/repo aliased to org2/repo2"
143+
assert_dest_sha "org2/repo2" "heads/main" "e9009d51dd6da2c363d1d14779c53dd27fcb0c52" "syncing org/repo aliased to org2/repo2"
144144

145145
echo "all sync tests passed successfully"
146146
}

test/fixtures/repo.git/HEAD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ref: refs/heads/master
1+
ref: refs/heads/main

0 commit comments

Comments
 (0)