Repository navigation
[wip] better tests for handling server failures - #676
Conversation
|
This is an attempt to test various failure scenarios so we can catch things like #675 before they happen. Ideally, this PR fails until #675 is merged in, but I don't think that's quite the case just yet. But before I dig in, is this on the right track? Do the tests look useful? I went with magic content strings because then it should be clear that the integration test is trying to trigger specific failure behavior on the server. The case statements are a lot more clear, despite the lines of copied code. If this approach works, we can replace |
old api doesnt have the error object on the json responses
seems to help keep the output of the parallel scripts consistent
|
While writing this, I expected all of the push tests with the batch api to pass, and the push tests with the legacy api to fail until #675 was merged. However, the batch api tests were failing too. Looks like the file was being skipped, but not treated as an error. 3671cc7 changes the batch response handler too look for an object error before looking for a link relation. |
|
So I merged #675 into this branch and pushed it up to a temporary branch so CI can run. It passed! My plan now is:
|
|
|
|
Added a DNS test to this PR. Still passes in the temp merge branch: github:a62e510...github:f9b7779 |
[wip] better tests for handling server failures
Since we first introduced the calc_oid() helper function to our shell test suite in commit 54601c6 of PR git-lfs#676, we have used the "printf" shell built-in command to pass the function's first parameter to a program which calculates the SHA-256 hash of its input. (Note that the specific program used for this purpose depends on the operating system.) However, because the calc_oid() function assigns its first parameter to be the "format" argument of the "printf" built-in command, if the parameter were to contain any backslash characters or format specifications like "%d", the hash value calculated from the argument's contents might not match the value we expect. In a subsequent commit in this PR we intend to revise several of our shell tests to make use of the calc_oid() function with dynamically-generated data of various sizes. This data should not contain any special formatting characters like "\" or "%". Nevertheless, we can guard against the possibility that such characters might be inadvertently introduced in the future by using "%s" as the "format" argument of the "printf" built-in command, and then passing the calc_oid() function's first parameter as the second argument of the "printf" command. This guarantees that the function's parameter will be interpolated in place of the "%s" format specification in a literal, unmodified form. We then update four of our shell tests that depend on the legacy behaviour of the calc_oid() function to convert the character sequence "\n" into an LF (linefeed) character. In each of these tests, we can simply use our calc_oid_file() helper function to determine the SHA-256 hash of a given file's contents, instead of passing a string which represents the contents of the file to the calc_oid() function.
No description provided.