Hey Riak users, I often get asked how you can test the functions you feed into your MapReduce jobs. Up until last week, I hadn't truly felt the pain of being unable to test my map and reduce functions, when I tried to add click-tracking and statistics aggregation to my riak-url-shortener.
Thanks to help from Larry Karnowski (@karnowski), I dove into building a test harness today. I initially tried Jasmine, which has a very nice in-browser mode, but it assumed too much about having the BOM available. I ended up trying out a port of QuickCheck to Javascript (http://bitbucket.org/darrint/qc.js/) and so far I like the results. The declarative, functional orientation of QC is a good fit for testing your map and reduce functions, especially since they run in relative isolation. Without further ado, here's my first pass at the harness: http://github.com/seancribbs/riak-qc.js http://bitbucket.org/seancribbs/riak-qc.js (may go away) You'll need a standalone version of Spidermonkey (1.8rc1 or later) to run your tests. Once you have SM installed and the project cloned, try "js builtins_qc.js" from the terminal. Caveat emptor -- this is only one day's work! Nevertheless, try it out and give me feedback or send pull-requests. Sean Cribbs <s...@basho.com> Developer Advocate Basho Technologies, Inc. http://basho.com/ _______________________________________________ riak-users mailing list riak-users@lists.basho.com http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com