Options:
- # Session Start: Thu Aug 08 00:00:01 2013
- # Session Ident: #testing
- # [00:01] * Joins: tobie (tobie@public.cloak)
- # [00:02] * Quits: zcorpan (~zcorpan@public.cloak) (Client closed connection)
- # [00:14] <jgraham> I guess it also means that you can't put a delay in to the headers
- # [00:14] <jgraham> So you can't do
- # [00:14] <jgraham> Content-Type: text/html
- # [00:14] <jgraham> [sleep 2s]
- # [00:15] <jgraham> Content-Type: text/plain
- # [00:15] <jgraham> Does anyone care about that?
- # [00:15] <jgraham> I think if they do we probably need to start from scratch
- # [00:16] * jgraham feels he might be talking to himself
- # [00:17] * Quits: tobie (tobie@public.cloak)
- # [00:18] * Joins: tobie (tobie@public.cloak)
- # [00:26] * Quits: tobie (tobie@public.cloak)
- # [01:13] * Joins: zcorpan (~zcorpan@public.cloak)
- # [01:20] * Quits: zcorpan (~zcorpan@public.cloak) (Ping timeout: 180 seconds)
- #
- # Session Start: Thu Aug 08 10:06:47 2013
- # Session Ident: #testing
- # [10:06] * Now talking in #testing
- # [10:11] * Quits: tobie (tobie@public.cloak)
- # [10:28] * heycam is now known as heycam|away
- # [10:38] * Quits: glenn_ (~gadams@public.cloak) (Client closed connection)
- # [11:00] <gsnedders> Releasing tests shouldn't be this hard. Problems: fourth level directories; bottom level directories referring to @id of specific algorithms.
- # [11:03] <darobin> jgraham: I have no idea how those Python things are architected, but can't you get at the socket from the http server instance?
- # [11:04] <darobin> I haven't checked this through, but for instance in Node the ultra basic HTTP server exposes a connection field which I believe you can just highjack and write to
- # [11:08] <gsnedders> darobin: With WSGI, no, you get a far higher-level request object.
- # [11:09] <darobin> gsnedders: I was thinking of the SimplerHTTPServer (?) thing
- # [11:09] <darobin> I reckon I should look myself, I've survived reading Python docs before :)
- # [11:10] <gsnedders> SimpleHTTPServer.
- # [11:10] <gsnedders> http.server in Py3.
- # [11:10] <gsnedders> darobin: That gives raw access to the socket, yes.
- # [11:11] <darobin> that might do the trick, assuming it doesn't forcefully try to make a response for you
- # [11:11] <gsnedders> No, it doesn't.
- # [11:11] <darobin> and even then I'm sure we can subclass it
- # [11:11] <gsnedders> Somewhere I have something…
- # [11:11] <darobin> so that might look like a solution to the issues that jgraham was having during the night
- # [11:12] <gsnedders> http://hg.gsnedders.com/http-parsing/file/bbab4a6298d7/tests/response/response.py
- # [11:12] <gsnedders> This basically just sends an .asis (sp?) file down
- # [11:12] <gsnedders> Python 2 only, but could easily be changed.
- # [11:13] <darobin> gsnedders: that looks pretty good to me
- # [11:13] <darobin> hahaha
- # [11:14] <darobin> if self.request_version == 'HTTP/0.9': self.send_error(505, "HTTP Version Not Supported")
- # [11:14] <darobin> I don't think HTTP 0.9 had 505 as a response code :)
- # [11:14] <darobin> not that it matters of course
- # [11:14] <gsnedders> No, it didn't. :)
- # [11:14] <gsnedders> (But it's perfectly normal to send HTTP/1.0 responses to HTTP/0.9 requests, seemingly!)
- # [11:14] <darobin> well it's HTTP, anything pretty much fucking goes really
- # [11:15] <gsnedders> Except if you're IIS 7+. Then you're really strict.
- # [11:15] <darobin> it's part of what makes it truly wonderful that the web works at all
- # [11:15] <darobin> heh
- # [11:15] <gsnedders> Server's can get away with being a lot more strict.
- # [11:15] <gsnedders> No diversity of clients, really.
- # [11:15] <gsnedders> And no really broken ones.
- # [11:16] <darobin> oooh, that really depends
- # [11:16] <darobin> for browsers, sure
- # [11:16] <darobin> but once you start serving stuff for consumption by other clients (typically, a simple JSON API) you get really surprising stuff
- # [11:17] <darobin> e.g. a fixed a bug a few weeks ago where a client was sending a content-type for a request with an empty body — it confused the hell out of the server
- # [11:17] <gsnedders> In my experience you never got stuff remotely as weird as what you got from servers.
- # [11:17] <gsnedders> Yeah, that's not bizzare at all.
- # [11:17] <darobin> I reckon that's true
- # [11:18] <darobin> the problem with servers is that they're often built of many parts that can interact strangely
- # [11:20] <gsnedders> CGI scripts esp.
- # [11:20] <gsnedders> The headers they send are pretty much untouched.
- # [12:19] * Joins: abarsto (~abarsto@public.cloak)
- # [12:19] * abarsto is now known as ArtB
- # [13:23] * Joins: darobin_ (rberjon@public.cloak)
- # [13:26] * heycam|away is now known as heycam
- # [13:28] * heycam is now known as heycam|away
- # [13:28] * Quits: darobin (rberjon@public.cloak) (Ping timeout: 180 seconds)
- # [13:43] * Joins: bhill1 (~Brad@public.cloak)
- # [13:48] * Quits: bhill (~Brad@public.cloak) (Ping timeout: 180 seconds)
- # [13:53] * Joins: dom (dom@public.cloak)
- # [14:28] * Joins: AutomatedTester (~AutomatedTester@public.cloak)
- # [14:34] * darobin_ is now known as darobin
- # [16:24] <jgraham> Yes, I think just subclassing BaseHTTPServer and implementing something that has the exact behaviour we want should be fine
- # [16:31] <jgraham> My idea so far is to allow serving normal files, with matching .headers files to add or remove custom headers (I'm not sure if only exact matches should be considered, or we should also walk up the tree), .asis files that are sent as is (possibly with the option to disable the standard headers that the server would send) and .py files which allow (through some undetermined API) you to set status headers and body simply in common cases but also allow yo[CUT]
- # [16:31] <jgraham> ... pause in the response after writing part of the status line
- # [16:34] <gsnedders> paste.httpserver uses BaseHTTPServer, no? So it might be simplest to just use WSGI for .py files?
- # [16:35] <jgraham> WSGI still doesn't give you the ability to not send expected headers
- # [16:35] <jgraham> Or to fiddle with the timing of things before the headers
- # [16:35] <jgraham> s/headers/body/
- # [16:36] <gsnedders> And so is wsgiref.simple_server.
- # [16:36] <gsnedders> I thought we were allowing asis to do that? Or you want pauses as well as expected headers?
- # [16:37] * gsnedders is unconvinced he actually understands all the requirements here
- # [16:37] <gsnedders> (And he's probably missed some others)
- # [16:37] <jgraham> Well, it seems like if pauses are useful in the body they are useful in the headers too
- # [16:37] <jgraham> I'm not sure I know all the requirements
- # [16:38] <jgraham> But I had the original idea that "full control over the bytes and timing of the response" was a requirement
- # [16:38] <gsnedders> Because I'm pretty sure for most tests using Python you don't want to have to worry about that much detail
- # [16:39] <jgraham> That's obviously possible if you just expose the socket, but it's not a nice API for the common case
- # [16:39] <jgraham> Exactly
- # [16:39] <gsnedders> Most tests using Python you'll just want, "okay, send these headers, and here's the body". I worry that we're going to end up with something overcomplex for the common case.
- # [16:39] <jgraham> I don't think so
- # [16:40] <jgraham> I am very aware that the common case should be as simple as possible
- # [16:41] <gsnedders> Do we really want to come up with an entirely custom API?
- # [16:41] <jgraham> It's not clear that it has to be "entirely custom"
- # [16:42] <jgraham> For example, a good API might be "write a function that returns a string or an iterable or a function or a Response object"
- # [16:43] <jgraham> If you return a string or an iterable all the headers are taken care of (I guess you need to provide Content-type and status somehow)
- # [16:44] * Quits: AutomatedTester (~AutomatedTester@public.cloak) (Client closed connection)
- # [16:44] * Quits: ArtB (~abarsto@public.cloak) (Client closed connection)
- # [16:45] <jgraham> If you return a response object you can set some options to turn off default headers, or provide a function that will write headers, or whatever
- # [16:45] <jgraham> That isn't a full proposal and I see holes
- # [16:46] <jgraham> But the idea is that there can be a graduated level of difficulty from "server does almost everything" to "server does almost nothing"
- # [16:46] <gsnedders> BTW, do you know why WSGI/Web3 uses a list for headers?
- # [16:47] <jgraham> As opposed to a dict?
- # [16:47] <gsnedders> Yeah.
- # [16:47] <jgraham> Not really. Maybe to preserve order?
- # [16:48] <gsnedders> I dunno. Maybe the fact that de-facto (though not de-jure) Content-Type: foo/bar\r\nContent-Type: bar/foo cannot be compressed into one heade.r
- # [16:53] * Joins: AutomatedTester (~AutomatedTester@public.cloak)
- # [16:54] <darobin> I reckon that a good way of listing the requirements is to go through all the PHP we have and see what it does
- # [16:55] <darobin> what I've looked at is mostly straightforward
- # [17:04] <gsnedders> jgraham: My proposal would be something along the lines of staying as close to WSGI as possible, I think, so a wrapped for WSGI would be trivial.
- # [17:07] <gsnedders> Make the raw socket available for writing to, otherwise provide a sendResponseLine(code, message) and a sendHeader(name, value), as well as sendBody(data)
- # [17:07] <gsnedders> And they all write immediately (can we force it to flush to the socket?), so you can interweve sleeps.
- # [17:16] <jgraham> darobin: Certianly I have seen uses of PHP for test writing that were not straightforward
- # [17:17] <darobin> let's collect and see
- # [17:17] <darobin> note that I said "mostly" :)
- # [17:17] <jgraham> And there are tests that have gone unwritten because they were not possible to implement in PHP
- # [17:17] <jgraham> Or not easy at least
- # [17:17] <jgraham> Those are the ones that we don't know about
- # [17:17] <jgraham> s/don't/can't/
- # [17:18] <darobin> yeah, sure, I'm not saying it'll give 100% of requirements
- # [17:18] <darobin> but it should give a good idea
- # [17:18] <jgraham> gsnedders: Yeah, I will hopfully get to write some code for this in the next couple of days (not sure how busy I am with other things), so I will start and see what feels natural
- # [17:20] * Quits: Lachy (~Lachy@public.cloak) ("Computer has gone to sleep.")
- # [17:20] <gsnedders> Cool. Will have a look… at some point.
- # [17:21] * Quits: zcorpan (~zcorpan@public.cloak) (Client closed connection)
- # [18:09] * Quits: dom (dom@public.cloak) ("")
- # [18:09] * Joins: abarsto (~abarsto@public.cloak)
- # [18:09] * abarsto is now known as ArtB
- # [18:26] * Joins: Lachy (~Lachy@public.cloak)
- # [18:26] * Quits: AutomatedTester (~AutomatedTester@public.cloak) (Client closed connection)
- # [18:27] * Joins: AutomatedTester (~AutomatedTester@public.cloak)
- # [18:29] * Joins: rhauck (~Adium@public.cloak)
- # [18:29] * Quits: rhauck (~Adium@public.cloak) ("Leaving.")
- # [18:30] * Joins: rhauck (~Adium@public.cloak)
- # [18:32] * Joins: zcorpan (~zcorpan@public.cloak)
- # [18:32] * Quits: rhauck (~Adium@public.cloak) ("Leaving.")
- # [18:39] * Quits: zcorpan (~zcorpan@public.cloak) (Ping timeout: 180 seconds)
- # [19:23] <jgraham> Writing code is fun
- # [19:33] <jgraham> He says as he responds to some email
- # [19:38] * Joins: tobie (tobie@public.cloak)
- # [19:47] * Joins: jhammel (~jhammel@public.cloak)
- # [19:53] * Joins: zcorpan (~zcorpan@public.cloak)
- # [20:04] * Joins: rhauck (~Adium@public.cloak)
- # [21:18] * Quits: tobie (tobie@public.cloak)
- # [21:21] * Joins: tobie (tobie@public.cloak)
- # [21:51] * Quits: jhammel (~jhammel@public.cloak) (Ping timeout: 180 seconds)
- # [21:55] * Joins: jhammel (~jhammel@public.cloak)
- # [22:20] * heycam|away is now known as heycam
- # [22:34] * Quits: tobie (tobie@public.cloak)
- # [22:43] * Joins: gitbot (~gitbot@public.cloak)
- # [22:43] -gitbot:#testing- [web-platform-tests] AFBarstow opened pull request #269: README.md for the WebSocket API test suite (master...master) https://github.com/w3c/web-platform-tests/pull/269
- # [22:43] * Parts: gitbot (~gitbot@public.cloak) (gitbot)
- # [22:44] * Quits: Ms2ger (~Ms2ger@public.cloak) ("nn")
- # [22:48] * Joins: gitbot (~gitbot@public.cloak)
- # [22:48] -gitbot:#testing- [web-platform-tests] AFBarstow synchronize pull request #269: README.md for the WebSocket API test suite (master...master) https://github.com/w3c/web-platform-tests/pull/269
- # [22:48] * Parts: gitbot (~gitbot@public.cloak) (gitbot)
- # [22:53] * Joins: gitbot (~gitbot@public.cloak)
- # [22:53] -gitbot:#testing- [web-platform-tests] plehegar synchronize pull request #181: Submissions/navigationtiming (master...submissions/navigationtiming) https://github.com/w3c/web-platform-tests/pull/181
- # [22:53] * Parts: gitbot (~gitbot@public.cloak) (gitbot)
- # [22:58] * Joins: gitbot (~gitbot@public.cloak)
- # [22:58] -gitbot:#testing- [web-platform-tests] plehegar closed pull request #269: README.md for the WebSocket API test suite (master...master) https://github.com/w3c/web-platform-tests/pull/269
- # [22:58] * Parts: gitbot (~gitbot@public.cloak) (gitbot)
- # [22:58] * Joins: gitbot (~gitbot@public.cloak)
- # [22:58] -gitbot:#testing- [web-platform-tests] plehegar pushed 3 new commits to master: https://github.com/w3c/web-platform-tests/compare/6c699833e0ff...78613c1c4c2d
- # [22:58] -gitbot:#testing- web-platform-tests/master b848ad3 Arthur Barstow: README.md for the WebSocket API test suite
- # [22:58] -gitbot:#testing- web-platform-tests/master 5024ad5 Arthur Barstow: Fix typo in URL of the Editor Draft
- # [22:58] -gitbot:#testing- web-platform-tests/master 78613c1 Philippe Le Hegaret: Merge pull request #269 from AFBarstow/master...
- # [22:58] * Parts: gitbot (~gitbot@public.cloak) (gitbot)
- # [23:07] * Joins: rhauck1 (~Adium@public.cloak)
- # [23:08] * Quits: Lachy (~Lachy@public.cloak) ("Computer has gone to sleep.")
- # [23:09] * Joins: rhauck2 (~Adium@public.cloak)
- # [23:09] * Quits: rhauck1 (~Adium@public.cloak) (Client closed connection)
- # [23:10] * Joins: gitbot (~gitbot@public.cloak)
- # [23:10] -gitbot:#testing- [web-platform-tests] AFBarstow opened pull request #270: README.md for the HTML5 Web Messaging test suite (master...master) https://github.com/w3c/web-platform-tests/pull/270
- # [23:10] * Parts: gitbot (~gitbot@public.cloak) (gitbot)
- # [23:14] * Quits: rhauck (~Adium@public.cloak) (Ping timeout: 180 seconds)
- # [23:17] * Quits: AutomatedTester (~AutomatedTester@public.cloak) (Client closed connection)
- # [23:27] * Joins: Lachy (~Lachy@public.cloak)
- # [23:37] * Quits: ArtB (~abarsto@public.cloak) ("Leaving.")
- # [23:40] * Quits: jhammel (~jhammel@public.cloak) (Ping timeout: 180 seconds)
- # [23:45] * Joins: jhammel (~jhammel@public.cloak)
- # [23:50] * Quits: rhauck2 (~Adium@public.cloak) ("Leaving.")
- # [23:50] * Joins: rhauck (~Adium@public.cloak)
- # [23:51] * heycam is now known as heycam|away
- # [23:53] * Quits: zcorpan (~zcorpan@public.cloak) (Client closed connection)
- # [23:53] * Joins: rhauck1 (~Adium@public.cloak)
- # [23:54] * Quits: rhauck (~Adium@public.cloak) (Client closed connection)
- # [23:59] * Joins: tobie (tobie@public.cloak)
- # Session Close: Fri Aug 09 00:00:00 2013
The end :)