Return-Path: X-Original-To: apmail-couchdb-dev-archive@www.apache.org Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B2F687DA7 for ; Tue, 9 Aug 2011 15:18:41 +0000 (UTC) Received: (qmail 20927 invoked by uid 500); 9 Aug 2011 15:18:41 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 20630 invoked by uid 500); 9 Aug 2011 15:18:40 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 20610 invoked by uid 99); 9 Aug 2011 15:18:40 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Aug 2011 15:18:40 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of paul.joseph.davis@gmail.com designates 209.85.220.180 as permitted sender) Received: from [209.85.220.180] (HELO mail-vx0-f180.google.com) (209.85.220.180) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Aug 2011 15:18:34 +0000 Received: by vxh15 with SMTP id 15so115360vxh.11 for ; Tue, 09 Aug 2011 08:18:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; bh=YTQjvB8CrQp6jjsaw5q3cEURndJByu5feoGGgzgiMBQ=; b=m/uLDNDL9AflY0MyX3gJTpR6ebRh2S4VPT8P3Q/E/vb7dUwytvt/vURjw+OgC4hOAK CZ578KFC34O2fHt5+wBtucKAvQ6nXXPmmfKgb23anBaJqE8hXSV8KkPSbWimEVYV+k59 rUyhROJfLZ+DeCp5ODQoADjVgVWmkTTPPa5dg= Received: by 10.52.65.194 with SMTP id z2mr7353166vds.76.1312903093201; Tue, 09 Aug 2011 08:18:13 -0700 (PDT) MIME-Version: 1.0 Received: by 10.52.167.135 with HTTP; Tue, 9 Aug 2011 08:17:32 -0700 (PDT) In-Reply-To: <434F9286-FBB6-419E-A585-4E091C10F5B8@telavox.se> References: <434F9286-FBB6-419E-A585-4E091C10F5B8@telavox.se> From: Paul Davis Date: Tue, 9 Aug 2011 10:17:32 -0500 Message-ID: Subject: Re: Futon Test Suite To: dev@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org On Tue, Aug 9, 2011 at 4:11 AM, Jens Rantil wrote: > Hi, > > Does JS engine come bundled with HTTP request implementation or is that b= rowser specific? If they do, you could execute the browser tests by running= them through a JavaScript engine directly? That way you can preserve the J= avaScript code, still run the tests and skip your favorite browser. > > My five cents, > > /Jens > > Sent from my cellphone > This is precisely how our current JS CLI test runner works. There's a directory ./test/javascript/ in the tarballs and in SVN that contains the code to turn CouchJS into a minimal JS environment with a fake XHR class. The idea currently floating in my head involves abandoning the "pretend to be a browser" approach and is more focused on creating a useful HTTP testing environment in JS and then refactoring our test code to use that instead. > On 9 aug 2011, at 10:49, "Paul Davis" wrote= : > >> On Tue, Aug 9, 2011 at 2:40 AM, Robert Dionne >> wrote: >>>> >>>> >>>> Also, I've been thinking more and more about beefing up the JavaScript >>>> test suite runner and moving more of our browser tests over to >>>> dedicated code in those tests. If anyone's interested in hacking on >>>> some C and JavaScript against an HTTP API, let me know. >>> >>> >>> Paul, >>> >>> =A0Jan and I talked about this a few times and I started a branch[1] al= ong that idea. So far all I did was make a copy of the then current Futon t= ests into >>> test/javascript/test =A0and started looking at the small handful that f= ail. >>> >>> =A0 The browser tests are great (any test is good) but they have too ma= ny browser =A0dependent quirks, or at least I assume that because of the pl= easant surprise >>> one gets when they all run. So I think the goal of these runner tests w= ould be some sort of official HTTP API suite that's part of "make check". W= ould you agree? >>> If so I'm happy to take this on. >>> >>> =A0 Also I've found eunit to be helpful in BigCouch and wondering how h= ard it would be to support eunit in couchdb. Having tests in the modules is= very good for not >>> only testing but also to help with reading and understanding what the c= ode does. >>> >>> Bob >>> >>> >>> [1] https://github.com/bdionne/couchdb/tree/cli-tests >>> >>> >> >> Bob, >> >> Exactly what I was thinking. By having our test suite have as little >> code between the socket and the the test as possible we can ensure >> that the tests are testing CouchDB and not some random change in the >> behavior of our favorite web browser. I would definitely expect these >> tests to be part of make check and hence part of the release >> procedure. >> >> My current half formed thoughts are to basically split our test suite >> into two halves. Tests that are in Erlang and are testing internals, >> and tests that go through the HTTP interface. I love me some Erlang, >> but I've not been think of an elegant way to make it easy to run lots >> of HTTP tests. >> >> As to eunit, I'm not sure. I'm really not a huge fan of it, especially >> mixing implementation and test code. I know rebar can separate them, >> so its at least possible to get around that. I'd like to have a >> unified environment for Erlang tests though. And TAP at seems like >> it'd be easier to interface with non-Erlang tooling if we ever get >> around to build matrices and what not. But I'm not opposed to it on >> religious grounds if that's what people want to contribute. >