You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by "Stephen Prater (JIRA)" <ji...@apache.org> on 2010/06/28 19:45:51 UTC

[jira] Created: (COUCHDB-813) No View Server test for error in map function

No View Server test for error in map function
---------------------------------------------

                 Key: COUCHDB-813
                 URL: https://issues.apache.org/jira/browse/COUCHDB-813
             Project: CouchDB
          Issue Type: Bug
          Components: Test Suite
    Affects Versions: 0.11
            Reporter: Stephen Prater
            Priority: Minor
             Fix For: 0.11.1


There is no r-spec test for how a view server should behave if an error is thrown in the map function.  The JS server returns empty if map terminates abnormally so, I've codified that behavior in an rspec test.

  it "should return empty if map terminates abnormally" do
    @qs.reset!
    @qs.run(["add_fun", functions["error-in-map"]]).should == true
    @qs.run(["add_fun", functions["emit-once"]]).should == true
    rows = @qs.run(["map_doc", {:a => "b"}])
    rows[0].should == []
    rows[1].should == [["baz","b"]]
  end

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (COUCHDB-813) No View Server test for error in map function

Posted by "Paul Joseph Davis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-813?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul Joseph Davis updated COUCHDB-813:
--------------------------------------

    Skill Level: New Contributors Level (Easy)

> No View Server test for error in map function
> ---------------------------------------------
>
>                 Key: COUCHDB-813
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-813
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Test Suite
>    Affects Versions: 0.11
>            Reporter: Stephen Prater
>            Priority: Minor
>             Fix For: 0.11.3
>
>
> There is no r-spec test for how a view server should behave if an error is thrown in the map function.  The JS server returns empty if map terminates abnormally so, I've codified that behavior in an rspec test.
>   it "should return empty if map terminates abnormally" do
>     @qs.reset!
>     @qs.run(["add_fun", functions["error-in-map"]]).should == true
>     @qs.run(["add_fun", functions["emit-once"]]).should == true
>     rows = @qs.run(["map_doc", {:a => "b"}])
>     rows[0].should == []
>     rows[1].should == [["baz","b"]]
>   end

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (COUCHDB-813) No View Server test for error in map function

Posted by "Noah Slater (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-813?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Noah Slater updated COUCHDB-813:
--------------------------------

    Fix Version/s: 0.11.3
                       (was: 0.11.2)

> No View Server test for error in map function
> ---------------------------------------------
>
>                 Key: COUCHDB-813
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-813
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Test Suite
>    Affects Versions: 0.11
>            Reporter: Stephen Prater
>            Priority: Minor
>             Fix For: 0.11.3
>
>
> There is no r-spec test for how a view server should behave if an error is thrown in the map function.  The JS server returns empty if map terminates abnormally so, I've codified that behavior in an rspec test.
>   it "should return empty if map terminates abnormally" do
>     @qs.reset!
>     @qs.run(["add_fun", functions["error-in-map"]]).should == true
>     @qs.run(["add_fun", functions["emit-once"]]).should == true
>     rows = @qs.run(["map_doc", {:a => "b"}])
>     rows[0].should == []
>     rows[1].should == [["baz","b"]]
>   end

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (COUCHDB-813) No View Server test for error in map function

Posted by "Noah Slater (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-813?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Noah Slater updated COUCHDB-813:
--------------------------------

    Fix Version/s: 0.11.2
                       (was: 0.11.1)

> No View Server test for error in map function
> ---------------------------------------------
>
>                 Key: COUCHDB-813
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-813
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Test Suite
>    Affects Versions: 0.11
>            Reporter: Stephen Prater
>            Priority: Minor
>             Fix For: 0.11.2
>
>
> There is no r-spec test for how a view server should behave if an error is thrown in the map function.  The JS server returns empty if map terminates abnormally so, I've codified that behavior in an rspec test.
>   it "should return empty if map terminates abnormally" do
>     @qs.reset!
>     @qs.run(["add_fun", functions["error-in-map"]]).should == true
>     @qs.run(["add_fun", functions["emit-once"]]).should == true
>     rows = @qs.run(["map_doc", {:a => "b"}])
>     rows[0].should == []
>     rows[1].should == [["baz","b"]]
>   end

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-813) No View Server test for error in map function

Posted by "Stephen Prater (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-813?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12888446#action_12888446 ] 

Stephen Prater commented on COUCHDB-813:
----------------------------------------

BTW, here's the JS map function "error-in-map"

function(doc) {
       emit(x,doc)
}

> No View Server test for error in map function
> ---------------------------------------------
>
>                 Key: COUCHDB-813
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-813
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Test Suite
>    Affects Versions: 0.11
>            Reporter: Stephen Prater
>            Priority: Minor
>             Fix For: 0.11.2
>
>
> There is no r-spec test for how a view server should behave if an error is thrown in the map function.  The JS server returns empty if map terminates abnormally so, I've codified that behavior in an rspec test.
>   it "should return empty if map terminates abnormally" do
>     @qs.reset!
>     @qs.run(["add_fun", functions["error-in-map"]]).should == true
>     @qs.run(["add_fun", functions["emit-once"]]).should == true
>     rows = @qs.run(["map_doc", {:a => "b"}])
>     rows[0].should == []
>     rows[1].should == [["baz","b"]]
>   end

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.