-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test-gvfs-prococol, t5799: tests for gvfs-helper #220
test-gvfs-prococol, t5799: tests for gvfs-helper #220
Conversation
Mayhem mode sounds so much more fun than "chaos". |
@jeffhostetler I'm sure you're on top of this, but your builds seem to be failing because |
That's not actually the problem, the problem is that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot really comment on the GVFS-related internals, of course, so I just left a couple of generic comments ;-)
actual_nr=$(( $(wc -l <"$OIDS_FILE") )) | ||
if test $actual_nr -lt $1 | ||
then | ||
echo "get_list_of_oids: insufficient data. Need $1 OIDs." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... >&2
;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dscho where do these messages appear (whether they come out on 1 or 2) ?
that is, where are stdout and stderr mapped to for each of these script functions and the test_expect functions ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By default, all output is suppressed. When running the test scripts with the -v
(or --verbose
) option, the output is no longer suppressed. The only difference, then, between stdout
and stderr
is the buffering: messages sent to stderr
appear earlier (which matters when running with -x
because then stdout
might mislead the reader into believing that a different command produced that output).
As a rule, error messages should go to stderr
.
Not a big deal, though. A lot of test scripts in Git's test suite get this wrong.
WRT the test cleanup failures: Tricky, there's a t/helper/.gitignore file. Pushing a fix for that. |
Create t/helper/test-gvfs-protocol.c and t/t5799-gvfs-helper.sh to test gvfs-helper. Create t/helper/test-gvfs-protocol.c as a stand-alone web server that speaks the GVFS Protocol [1] and serves loose objects and packfiles to clients. It is borrows heavily from the code in daemon.c. It includes a "mayhem" mode to cause various network and HTTP errors to test the retry/recovery ability of gvfs-helper. Create t/t5799-gvfs-helper.sh to test gvfs-helper. [1] https://github.com/microsoft/VFSForGit/blob/master/Protocol.md Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
gvfs-helper prints a "loose <oid>" or "packfile <name>" messages after they are received to help invokers update their in-memory caches. Move the code to accumulate these messages in the result_list into the install_* functions rather than waiting until the end. POST requests containing 1 object may return a loose object or a packfile depending on whether the object is a commit or non-commit. Delaying the message generation just complicated the caller. Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Earlier versions of the test always returned a packfile in response to a POST. Now we look at the number of objects in the POST request. If > 1, always send a packfile. If = 1 and it is a commit, send a packfile. Otherwise, send a loose object. This is to better model the behavior of the GVFS server/protocol which treats commits differently. Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
38c5e53
to
7706794
Compare
@derrickstolee I rebased this branch on the current tip so that it includes your fix for POST and commits. Added a few fixes for that and included unit tests to confirm that we properly receive either packfiles or a loose object when requesting a single object. |
Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
I've addressed the "wc -l" and "grep -c" suggestions. I'm going to leave the stderr redirect for another day. |
Sounds good! |
test-gvfs-prococol, t5799: tests for gvfs-helper
test-gvfs-prococol, t5799: tests for gvfs-helper
This PR is based on 2.24.0 and replaces PR #216
which was based on 2.23.0.
Create t/helper/test-gvfs-protocol.c and t/t5799-gvfs-helper.sh
to test gvfs-helper.
Create t/helper/test-gvfs-protocol.c as a stand-alone web server that
speaks the GVFS Protocol [1] and serves loose objects and packfiles
to clients. It is borrows heavily from the code in daemon.c.
It includes a "mayhem" mode to cause various network and HTTP errors
to test the retry/recovery ability of gvfs-helper.
Create t/t5799-gvfs-helper.sh to test gvfs-helper.