You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our t/t-push-failures-local.sh test script includes a number of tests
which validate the behaviour of the "git push" command when Git LFS
objects are 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.
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.
A pair of tests in the t/t-push-failures-local.sh script, specifically
the "push reject missing objects (lfs.allowincompletepush default)" and
"push reject corrupt objects (lfs.allowincompletepush default)" tests,
perform a number of additional assertions beyond those performed by
the other tests in the same script.
These extra assertions first check that the tests' initial setup code
has successfully created object files in the local Git LFS object
storage directories, and then that the delete_local_object() and
corrupt_local_object() test helper functions successfully delete or
truncate one of the object files.
However, these assertions are unnecessary, as the conditions they
check are fully validated by the remainder of the tests' actions.
For instance, we check the output of the "git push" command to confirm
that one specific object is missing or corrupt, and then at the end
of the tests we assert that only the remaining object has been
pushed to the remote server. This final condition would not be
possible if that object had not been successfully created in the
first place.
Therefore, in order to align these two tests with the other related
tests we simply remove the unnecessary assertion statements. We can
then also remove the setup code which initializes the variables
that store the Git LFS object sizes, because these values were only
used in the assertion calls.
0 commit comments