Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 69EB199CA for ; Mon, 19 Mar 2012 18:49:18 +0000 (UTC) Received: (qmail 4794 invoked by uid 500); 19 Mar 2012 18:49:16 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 4749 invoked by uid 500); 19 Mar 2012 18:49:16 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 4740 invoked by uid 99); 19 Mar 2012 18:49:16 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Mar 2012 18:49:16 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [128.18.84.132] (HELO brightmail-internal3.sri.com) (128.18.84.132) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Mar 2012 18:49:08 +0000 X-AuditID: 80125484-b7f816d0000063d3-d4-4f677f8d753c Received: from exchange-hub03.SRI.COM (exchange-hub03.SRI.COM [128.18.23.155]) (using TLS with cipher AES128-SHA (AES128-SHA/128 bits)) (Client did not present a certificate) by brightmail-internal3.sri.com (SRI Internal SMTP Gateway) with SMTP id DA.B1.25555.D8F776F4; Mon, 19 Mar 2012 11:48:45 -0700 (PDT) Received: from EXCHANGE-DB09.SRI.COM ([fe80::8950:6060:901d:1bc0]) by exchange-hub03.SRI.COM ([fe80::8c0e:cf22:fef8:cb20%15]) with mapi id 14.01.0218.012; Mon, 19 Mar 2012 11:48:27 -0700 From: Jim Klo To: "user@couchdb.apache.org" Subject: Command Line Design Doc Testing Thread-Topic: Command Line Design Doc Testing Thread-Index: AQHNBgDeIN4WmIIDI0idYHVRuSPizw== Date: Mon, 19 Mar 2012 18:48:26 +0000 Message-ID: <4DD2BD81-330C-4186-BD84-C559D4459BB0@sri.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-originating-ip: [192.12.16.192] Content-Type: multipart/signed; boundary="Apple-Mail-105--459077995"; protocol="application/pkcs7-signature"; micalg=sha1 MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrOIsWRmVeSWpSXmKPExsXSICQ+W7e3Pt3fYNlTE4vOPXvZHBg9Nn44 zhjAGMVlk5Kak1mWWqRvl8CVcevNCpaCScUV186/YW5gbM7oYuTkkBAwkXi85DIzhC0mceHe erYuRi4OIYGdTBLXVu2FcvYxStz/cIMJpIpNQF7i8PYHQB0cHCIC5hKHLuaChIUFNCQ2rv8H NkhEQFdi8bFbTBC2nsSjlzfYQGwWAVWJszeOsIO08gpYSVz8GwsSZgTa+/3UGrByZgFxiVtP 5jNB3CMi8fDiaTYIW1Ti5eN/rBC2osTdU5uh6qslNk1eCBbnFRCUODnzCcsERqFZSEbNQlI2 C0kZRNxTon1DCyuErS2xbOFr5llA1zEL6EhMXsiIKgxhfzx/BGqkqcTrox+haqwlZvw6yAZh K0pM6X7IvoCRexWjTFJRZnpGSW5iZo4uLNKM9YqLMvWS83M3MYKjL6RlB+OKXYaHGAU4GJV4 eDfFpPsLsSaWFVfmHmKU4GBWEuF1up7mL8SbklhZlVqUH19UmpNafIhRmoNFSZw3zJjfX0gg PbEkNTs1tSC1CCbLxMEp1cCYqbxaw3JZxM4z7T7frkiuXvqfse2qWHf4QomstPkTroSEnF3F duiB1hw5UYlfbA3KZqsZPmROmO5Rmhe4d2Khme5u2xMNW89feL7oro4ll8OJfM6X76dfblUQ 3+RdtFL9uX23+ZLJvsdZVlxUu8T51OzhDevttzcI5LHaX7au/32r8WqYT/kvJZbijERDLeai 4kQAiaQ0jLoCAAA= X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail-105--459077995 Content-Type: multipart/alternative; boundary=Apple-Mail-104--459078034 --Apple-Mail-104--459078034 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Paul Davis suggested I ping the dev list to let you know of a = process/framework I've cobbled together for unit testing design = documents, and just to aid in flat out debugging when using the CouchApp = python script.. Essentially I've pulled together some pieces of CouchDB's main.js, = jsUnity (http://jsunity.com), some Mock Objects and convenience = functionality that I've rolled myself, Spidermonkey, and an extra = command for CouchApp. My motivation? Sick of the roundtripping from = editor, to couch, to curl, to indexing, to log files, and back with no = real way to use a debugger with breakpoints. I considered using Node.js = however I needed E4X support - so that meant Spidermonkey or Rhino. (BTW = if anyone knows of a schema aware XML parser that works in Spidermonkey = that's better than E4X, I'm all ears). Since Spidermonkey is already = used by CouchDB - seemed like the logical choice, but I'm sure this = could probably work with Rhino too. I also wanted to be able to = eventually get this working within our CI environment which uses Jenkins = - so command line use was pretty important. So our general environment - we use CouchApp to deploy design docs (and = using !code and !json macros), as well as have a python business layer. = I leveraged the codebase already there for converting a file system into = a design doc then load it into spidermonkey and run a testsuite against = it. This ended up making it very easy to add breakpoints and such in = your scripts as well as quickly regression test a change you might make = in some shared library. It's still pretty raw - but it currently works for our needs; = https://github.com/jimklo/LearningRegistry/blob/data-services-proto/data_s= ervices/lib/test-common.js is the common test code = https://github.com/jimklo/LearningRegistry/blob/data-services-proto/data_s= ervices/lib/jsunity-0.6.js is just the current version of jsUnity = https://github.com/jimklo/LearningRegistry/blob/data-services-proto/data_s= ervices/standards-alignment-lr-paradata/tests/test-alignment.js are some = test cases using this framework = https://github.com/jimklo/LearningRegistry/blob/data-services-proto/data_s= ervices/standards-alignment-dct-conformsTo/tests/test-alignment.js = another set of test cases, that use maps containing E4X. And then for running the tests with CouchApp: = https://github.com/jimklo/LearningRegistry/blob/data-services-proto/LR/lr/= couchapp/exec_tests.py is the extension command to configure it to = work you'll need to add the following to your .couchapprc = https://github.com/jimklo/LearningRegistry/blob/data-services-proto/data_s= ervices/standards-alignment-lr-paradata/.couchapprc At some point, I'll probably pull all the pieces out into their own = project to make it easier for others to incorporate. I still need a better mock interface for the request object passed into = list/show/filters. That probably won't happen until I get a better idea = of what I need to use from that perspective. Any questions, comments, criticism please feel free to shoot them my = way...=20 Thanks, - Jim Jim Klo Senior Software Engineer Center for Software Engineering SRI International --Apple-Mail-104--459078034 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii Paul = Davis suggested I ping the dev list to let you know of a = process/framework I've cobbled together for unit testing design = documents, and just to aid in flat out debugging when using the CouchApp = python script..

Essentially I've pulled together some = pieces of CouchDB's main.js,  jsUnity (http://jsunity.com), some Mock Objects =  and convenience functionality that I've rolled myself, = Spidermonkey, and an extra command for CouchApp.  My motivation? = Sick of the roundtripping from editor, to couch, to curl, to indexing, = to log files, and back with no real way to use a debugger with = breakpoints.  I considered using Node.js however I needed E4X = support - so that meant Spidermonkey or Rhino. (BTW if anyone knows of a = schema aware XML parser that works in Spidermonkey that's better than = E4X, I'm all ears). Since Spidermonkey is already used by CouchDB - = seemed like the logical choice, but I'm sure this could probably work = with Rhino too.  I also wanted to be able to eventually get this = working within our CI environment which uses Jenkins - so command line = use was pretty important.

So our general = environment - we use CouchApp to deploy design docs (and using !code and = !json macros), as well as have a python business layer.  I = leveraged the codebase already there for converting a file system into a = design doc then  load it into spidermonkey and run a testsuite = against it.  This ended up making it very easy to add breakpoints = and such in your scripts as well as quickly regression test a change you = might make in some shared library.

It's still = pretty raw - but it currently works for our needs;

At = some point, I'll probably pull all the pieces out into their own project = to make it easier for others to incorporate.

I = still need a better mock interface for the request object passed = into list/show/filters. That probably won't happen until I get a better = idea of what I need to use from that = perspective.

Any questions, comments, criticism = please feel free to shoot them my = way... 

Thanks,

- = Jim

Senior Software = Engineer
Center for Software = Engineering
SRI = International

= --Apple-Mail-104--459078034-- --Apple-Mail-105--459077995 Content-Disposition: attachment; filename="smime.p7s" Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIJ/zCCBO0w ggRWoAMCAQICEBX3i1OyIZLyYjv7fwx/UYkwDQYJKoZIhvcNAQEFBQAwgdgxCzAJBgNVBAYTAlVT MRowGAYDVQQKExFTUkkgSW50ZXJuYXRpb25hbDEfMB0GA1UECxMWVmVyaVNpZ24gVHJ1c3QgTmV0 d29yazE7MDkGA1UECxMyVGVybXMgb2YgdXNlIGF0IGh0dHBzOi8vd3d3LnZlcmlzaWduLmNvbS9y cGEgKGMpMDIxMDAuBgNVBAsTJ0NsYXNzIDIgT25TaXRlIEluZGl2aWR1YWwgU3Vic2NyaWJlciBD QTEdMBsGA1UEAxMUU1JJIEludGVybmF0aW9uYWwgQ0EwHhcNMTIwMTAzMDAwMDAwWhcNMTMwMTAy MjM1OTU5WjCBwjEaMBgGA1UEChQRU1JJIEludGVybmF0aW9uYWwxKDAmBgNVBAsUH0luZm9ybWF0 aW9uIFRlY2hub2xvZ3kgU2VydmljZXMxRjBEBgNVBAsTPXd3dy52ZXJpc2lnbi5jb20vcmVwb3Np dG9yeS9DUFMgSW5jb3JwLiBieSBSZWYuLExJQUIuTFREKGMpOTkxEjAQBgNVBAMTCUphbWVzIEts bzEeMBwGCSqGSIb3DQEJARYPamltLmtsb0BzcmkuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A MIIBCgKCAQEA2utx7vCP7eb6FitPXlP4Oo4fm2Bsx/lz7X7rHvqZRFdNkLtZjmppsofuWMRdrIMj xCW0lCQb2mvKwA/VSKvoyd4MBSIDYT/jVMz7OeCzNk0VhGKRwqXBlkvlirqhKOo4O24RU6C33c5p il3TDla/YwVbkFmKqGWNKnSddhUKpRVfQW3xJfbzjALWyx0OpLpxLmns6wrnKr6aYMWHOXZmCQ7J jwLWosKJgjlhLJOI+ZSK0JcrK7u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