Return-Path: X-Original-To: apmail-cordova-dev-archive@www.apache.org Delivered-To: apmail-cordova-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 18F6D105EA for ; Thu, 7 Nov 2013 19:58:14 +0000 (UTC) Received: (qmail 3359 invoked by uid 500); 7 Nov 2013 19:58:13 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 3337 invoked by uid 500); 7 Nov 2013 19:58:13 -0000 Mailing-List: contact dev-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list dev@cordova.apache.org Received: (qmail 3329 invoked by uid 99); 7 Nov 2013 19:58:13 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Nov 2013 19:58:13 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of anis.kadri@gmail.com designates 209.85.192.171 as permitted sender) Received: from [209.85.192.171] (HELO mail-pd0-f171.google.com) (209.85.192.171) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Nov 2013 19:58:09 +0000 Received: by mail-pd0-f171.google.com with SMTP id w10so1062520pde.30 for ; Thu, 07 Nov 2013 11:57:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=iITBMu2fyzAvvodkNnKdOU9D44Z3/6SFYrb4STk83Ms=; b=jpHjmh4qEr2Pn9qWCfMSUgpBIg0U4SLhADS518MkHnhqLAMjTYjdp9O7VtywFquBNE WrQfKzq3CszLwUvCGwCiye6pVi5XJN5WzFjdX8LWQxar0shqEVRu8kfRm91uo0mTy+kK Lz3Wc3lEvnluTs7hIn9vP5o17W3lDaYR4abvFyB0U1vmVrAv+pQHrok2Ayf3cP5QBpzm Rt8bGrvxORkDb7gbAk/96xzh/8CFYUqApw5vmRMhUoThVWqLyoO1alcMWN8bEWNtGM2c zxmIDA5VQc2Sr9ihrG3qT9iFdkF5TvCXUq5M3E0gf6yN77Q3m0sB7Hi+4HNZnQh8oqzk 28Tw== MIME-Version: 1.0 X-Received: by 10.68.129.99 with SMTP id nv3mr11056250pbb.40.1383854269159; Thu, 07 Nov 2013 11:57:49 -0800 (PST) Received: by 10.66.26.112 with HTTP; Thu, 7 Nov 2013 11:57:49 -0800 (PST) In-Reply-To: References: <299C48FD-159B-4A4F-9877-F2AF6105714C@gmail.com> Date: Thu, 7 Nov 2013 11:57:49 -0800 Message-ID: Subject: Re: Refactoring the CLI tests From: Anis KADRI To: "dev@cordova.apache.org" Cc: Michal Mocny Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org The reason why every FS call is mocked is speed but speed is subjective in my opinion. Given the features of CLI, my opinion is that anything < 1 minute is acceptable. When I run tests, I am not actively watching them execute. I think the only calls that should be mocked are network calls because you should be able to run tests offline. I think we should convert (trash?) existing tests back to what they were instead of adding more end-to-end tests. We should also pay more attention de Windows. On Thu, Nov 7, 2013 at 10:31 AM, Braden Shepherdson wrote: > Alright, Mark and I have discussed this further, and we will be beginning > the effort with some end-to-end tests that will supplement the existing > tests. > > To some extent this is duplicating things that go on in the CI, since it > checks out various plugins using the tools. But we think it's still a > worthwhile effort since it will make it much easier to catch any problems > at commit time. > > The main pain point in the existing tests that we'll want to fix is their > fragility. The worst offenders here are the platform parsers, especially > wp7+8. So Steve, if you're looking for ways to help, I'd suggest looking at > those (wp in particular, but all of them). These are some of the worst, > most vacuous tests we have. They're not providing sample inputs and > checking the outputs, they are checking that the right functions get > called. I propose that they should be operating on a real, checked-in, > example project, in the spec/fixtures directory. The tests should run the > parsers, and make sure all the files are in the right places and have the > right contents. > > Braden > > > On Thu, Nov 7, 2013 at 1:02 PM, Steve Gill wrote: > >> I don't think we should scrap the current tests. I am totally in favor of >> having new end to end tests. We need to catch regressions better. >> >> Braden, let me know how I can help. >> >> >> >> > On Nov 7, 2013, at 9:02 AM, Michal Mocny wrote: >> > >> > Discussing locally with Braden.. these tests seem to be testing internal >> > details instead of expected functionality. Its quite common for valid >> > patches to break the tests and invalid patches to leave the tests >> passing. >> > There have been several occurrences recently where things landed even >> > though "cordova create" or "plugin add" were hosed, which seems fairly >> > fundamental to keep working ;) >> > >> > >> >> On Thu, Nov 7, 2013 at 11:57 AM, Michal Mocny >> wrote: >> >> >> >> +1 to testing end-to-end, but I thought thats what BuildBot/Medic does? >> >> Likely we want to ship those end-to-end test scripts so users can test >> >> changes locally, but I think the tests are are inside CLI now are meant >> to >> >> be unit tests, which yes, have very limited usefulness in isolation, but >> >> perhaps shouldn't be entirely replaced? If they really are useless (not >> >> sure) then they should be fixed/removed. >> >> >> >> >> >> On Thu, Nov 7, 2013 at 11:40 AM, Braden Shepherdson < >> braden@chromium.org>wrote: >> >> >> >>> The CLI tests are bad. I propose making them better. >> >>> >> >>> The tests are bad for two reasons: >> >>> 1. They're fragile because the tests depend on exactly the right >> functions >> >>> being called, sometimes in the right order. >> >>> 2. They don't test what we really want, which is that projects get >> created >> >>> and all the files are in the right places. >> >>> >> >>> I propose letting the tests actually run filesystem and related calls, >> >>> instead of always mocking them out. In the simplest form, that means >> >>> running them on the real filesystem. If that's too slow, we can >> >>> investigate >> >>> other alternatives, like using a ramdisk, or using that emulated fs >> that >> >>> runs everything in RAM inside Node. >> >>> >> >>> Mark and I are planning to work on this, starting with the CLI tests. >> The >> >>> Plugman tests are better in this regard, but could probably stand to be >> >>> really called as well. >> >>> >> >>> Any thoughts or objections? >> >>> >> >>> Braden >> >> >> >> >>