From: Junio C Hamano <gitster@pobox.com>
To: Jakub Narebski <jnareb@gmail.com>
Cc: git@vger.kernel.org, Guillaume Seguin <guillaume@segu.in>
Subject: Re: [PATCH] gitweb: Try harder in parse_tag; perhaps it was given ambiguous name
Date: Wed, 05 Dec 2007 13:14:23 -0800 [thread overview]
Message-ID: <7vmysoondc.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <200712052202.27111.jnareb@gmail.com> (Jakub Narebski's message of "Wed, 5 Dec 2007 22:02:26 +0100")
Jakub Narebski <jnareb@gmail.com> writes:
> Well, actually that is even better idea. We can go for one of the three
> levels of HTTP status checking:
>
> 1. Check if we got "Status: 200 OK" when we expect it, and not have it
> when we expect other HTTP status, e.g. when requesting nonexistent
> file. The above code is enough for that.
>
> 2. We can check if we got expected status number, for example 200 for
> when we expect no error, or 404 when object is not found, or 403
> if there is no such object etc. I was thinking about using this version
> the need to check not full first line, but fragment of it.
>
> 3. We can check full first line, for example
> Status: 200 OK
> Status: 403 Forbidden
> Status: 404 Not Found
> Status: 400 Bad Request
> but this might tie gitweb test too tightly with minute details of
> gitweb output. The above code is good for that too.
>
> What do you think, which route we should go in test?
4. We should check for what we expect in the parts of gitweb output we
care about. E.g.
* If we are making sure it refuses to serve incorrect request
(e.g. no such repository), we should check for the status, which is
what we care about (we may not care about how the actual error
message is stated).
* Otherwise (and I suspect this is "most of the tests"), we obviously
expect to have "200 OK", and check for that;
BUT IN ADDITION
* If we want to make sure that a specific aspect of the output was
buggy and a patch fixed it (e.g. an href used a short refname
without having refs/heads or refs/tags prefixed, causing
ambiguity), we also should check that part of output in generated
HTML, not just the HTTP status header.
prev parent reply other threads:[~2007-12-05 21:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-01 1:45 [PATCH] gitweb: disambiguate heads and tags withs the same name Jakub Narebski
2007-12-01 1:47 ` [PATCH] gitweb: Try harder in parse_tag; perhaps it was given ambiguous name Jakub Narebski
2007-12-01 3:06 ` Jakub Narebski
2007-12-05 7:01 ` Junio C Hamano
2007-12-05 10:13 ` Jakub Narebski
2007-12-05 19:46 ` Junio C Hamano
2007-12-05 21:02 ` Jakub Narebski
2007-12-05 21:14 ` Junio C Hamano [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vmysoondc.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=guillaume@segu.in \
--cc=jnareb@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).