Skip to content

Commit 0af7e2c

Browse files
committed
t: rename existing/missing/bad object push tests
Our t/t-pre-push.sh and t/t-push-failures-local.sh test scripts include a number of tests which validate the behaviour of the "git lfs pre-push" and "git push" commands when Git LFS objects are present, missing, or corrupt. While these tests are largely similar in their implementation, they vary in a number of formatting and implementation details unrelated to the specifics of the different conditions they simulate. These variations are artifacts of the evolution of our test suite over time; for example, the tests in the t/t-push-failures-local.sh script were refactored and collected from several earlier tests in commit 4d52e08 of PR git-lfs#3109, and the original versions of the tests in the t/t-pre-push.sh script were added incrementally in PRs git-lfs#447, git-lfs#2199, and git-lfs#2574. In a subsequent commit in this PR we expect to update the Git LFS client to remove some non-functional code which attempts to recreate missing Git LFS objects during push operations. In many cases this change will cause the client to report missing objects in an earlier stage of push operations than it does now. We also expect to reword the error message the client will output in such cases. Before we make these changes, we first revise the related tests in our test suite so they are as simple and similar as possible. This will ensure that when we update the Git LFS client we can clearly identify the changes that we need to make in our tests to accommodate the client's new behaviour. In previous commits in this PR we have revised and reformatted these tests to increase their consistency with each other. One additional adjustment we make now to further increase this consistency, and to provide greater clarity as to each test's purpose, is to rename both the tests and test repositories they create and clone. Note that since these tests typically only create a single missing or corrupt object, we now use the singular word "object" rather than "objects" in the test and repository names.
1 parent 388ee50 commit 0af7e2c

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

t/t-pre-push.sh

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -241,11 +241,11 @@ begin_test "pre-push 307 redirects"
241241
)
242242
end_test
243243

244-
begin_test "pre-push with existing file"
244+
begin_test "pre-push with existing object"
245245
(
246246
set -e
247247

248-
reponame="pre-push-existing-file"
248+
reponame="pre-push-existing-object"
249249
setup_remote_repo "$reponame"
250250
clone_repo "$reponame" "$reponame"
251251

@@ -270,11 +270,11 @@ begin_test "pre-push with existing file"
270270
)
271271
end_test
272272

273-
begin_test "pre-push with existing pointer"
273+
begin_test "pre-push with existing object (untracked)"
274274
(
275275
set -e
276276

277-
reponame="pre-push-existing-pointer"
277+
reponame="pre-push-existing-object-untracked"
278278
setup_remote_repo "$reponame"
279279
clone_repo "$reponame" "$reponame"
280280

@@ -295,11 +295,11 @@ begin_test "pre-push with existing pointer"
295295
)
296296
end_test
297297

298-
begin_test "pre-push with missing pointer not on server"
298+
begin_test "pre-push reject missing object"
299299
(
300300
set -e
301301

302-
reponame="pre-push-missing-pointer"
302+
reponame="pre-push-reject-missing-object"
303303
setup_remote_repo "$reponame"
304304
clone_repo "$reponame" "$reponame"
305305

@@ -326,13 +326,13 @@ begin_test "pre-push with missing pointer not on server"
326326
)
327327
end_test
328328

329-
begin_test "pre-push with missing pointer which is on server"
329+
begin_test "pre-push allow missing object (found on server)"
330330
(
331331
# should permit push if files missing locally but are on server, shouldn't
332332
# require client to have every file (prune)
333333
set -e
334334

335-
reponame="pre-push-missing-but-on-server"
335+
reponame="pre-push-allow-missing-object-found-on-server"
336336
setup_remote_repo "$reponame"
337337
clone_repo "$reponame" "$reponame"
338338

@@ -367,11 +367,11 @@ begin_test "pre-push with missing pointer which is on server"
367367
)
368368
end_test
369369

370-
begin_test "pre-push with missing and present pointers (lfs.allowincompletepush true)"
370+
begin_test "pre-push allow missing object (lfs.allowincompletepush true)"
371371
(
372372
set -e
373373

374-
reponame="pre-push-missing-and-present"
374+
reponame="pre-push-allow-missing-object"
375375
setup_remote_repo "$reponame"
376376
clone_repo "$reponame" "$reponame"
377377

@@ -414,11 +414,11 @@ begin_test "pre-push with missing and present pointers (lfs.allowincompletepush
414414
)
415415
end_test
416416

417-
begin_test "pre-push reject missing pointers (lfs.allowincompletepush default)"
417+
begin_test "pre-push reject missing object (lfs.allowincompletepush default)"
418418
(
419419
set -e
420420

421-
reponame="pre-push-reject-missing-and-present"
421+
reponame="pre-push-reject-missing-object-default"
422422
setup_remote_repo "$reponame"
423423
clone_repo "$reponame" "$reponame"
424424

t/t-push-failures-local.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
. "$(dirname "$0")/testlib.sh"
44

5-
begin_test "push with missing objects (lfs.allowincompletepush true)"
5+
begin_test "push allow missing object (lfs.allowincompletepush true)"
66
(
77
set -e
88

9-
reponame="push-with-missing-objects"
9+
reponame="push-allow-missing-object"
1010
setup_remote_repo "$reponame"
1111
clone_repo "$reponame" "$reponame"
1212

@@ -46,11 +46,11 @@ begin_test "push with missing objects (lfs.allowincompletepush true)"
4646
)
4747
end_test
4848

49-
begin_test "push reject missing objects (lfs.allowincompletepush false)"
49+
begin_test "push reject missing object (lfs.allowincompletepush false)"
5050
(
5151
set -e
5252

53-
reponame="push-reject-missing-objects"
53+
reponame="push-reject-missing-object"
5454
setup_remote_repo "$reponame"
5555
clone_repo "$reponame" "$reponame"
5656

@@ -89,11 +89,11 @@ begin_test "push reject missing objects (lfs.allowincompletepush false)"
8989
)
9090
end_test
9191

92-
begin_test "push reject missing objects (lfs.allowincompletepush default)"
92+
begin_test "push reject missing object (lfs.allowincompletepush default)"
9393
(
9494
set -e
9595

96-
reponame="push-missing-objects"
96+
reponame="push-reject-missing-object-default"
9797
setup_remote_repo "$reponame"
9898
clone_repo "$reponame" "$reponame"
9999

@@ -128,11 +128,11 @@ begin_test "push reject missing objects (lfs.allowincompletepush default)"
128128
)
129129
end_test
130130

131-
begin_test "push reject corrupt objects (lfs.allowincompletepush default)"
131+
begin_test "push reject corrupt object (lfs.allowincompletepush default)"
132132
(
133133
set -e
134134

135-
reponame="push-corrupt-objects"
135+
reponame="push-reject-corrupt-object"
136136
setup_remote_repo "$reponame"
137137
clone_repo "$reponame" "$reponame"
138138

0 commit comments

Comments
 (0)