On Thu, Jan 28, 2016 at 9:17 PM, Ross Berteig <r...@cheshireeng.com> wrote:

> I'm ok with declaring the CLI as effectively having 's'. I just wanted
> confirmation that it was expected before I baked it into a test case that
> way.
>

i think we have to accept it, at least for the time being. (Wait... didn't
Palpatine say that?)


> Perhaps oddly, I don't have a problem with the CLI being able to exercise
> the login subcommand or the anonymous login handshake. That makes it easier
> to test those features, as long as they do work as expected with fossil
> http. Next on today's agenda is to pass auth tokens through that interface
> and verify that the caps do reflect what was provided to the user.
>

The reason the JSON bits do their own command/argument dispatching, rather
than use fossil's, is so that the http and CLI variants of commands could
be consolidated more more cleanly. The vast majority, if not all of them,
combine the cli/www variants into a single command, and the bootstrapping
process converts arguments (a b c) resp. (/a/b/c) to be equivalent.


> I've kicked the can on fully testing authentication down the road a bit
> since I need to use HTTP POST and none of my cases do that yet. In the mean
> time, I'm checking the capabilities field returned by /json/login and
> verifying that it includes the expected caps.
>

Actually... i've got some ancient code which tests this using a local
'fossil server' and the 'rhino' JS shell:

[stephan@host:~/cvs/fossil/fossil]$ fossil server
Listening for HTTP requests on TCP port 8080

then, from another console:

[stephan@host:~/cvs/fossil/fossil/ajax/i-test]$ which js
[stephan@host:~/cvs/fossil/fossil/ajax/i-test]$ which rhino
[stephan@host:~/cvs/fossil/fossil/ajax/i-test]$ sudo apt-get install rhino
...
Setting up librhino-java (1.7R4-2) ...
Setting up rhino (1.7R4-2) ...
update-alternatives: using /usr/bin/rhino to provide /usr/bin/js (js) in
auto mode

[stephan@host:~/cvs/fossil/fossil/ajax/i-test]$ rhino rhino-test.js
Running test #1: Get server version info.
SENDING REQUEST: AJAJ options={"method":"GET","url":"
http://localhost:8080/json/HAI
","asynchronous":false,"timeout":0,"fossilBinary":"fossil","propagateExceptions":false}
GOT RESPONSE: {
    "fossil": "2bd670ac3cfb1fbbabf857e093d5b945a284c9fe",
...        "capabilities": "gjor"
    }
}


several of those tests use the login info (but only for the anonymous user,
to avoid having to store the password in the tests).



> Maybe that can save you an add/commit.
>>
>
> That empty file (and several more just like it) are in fossil's own
> repository. My plan is to avoid like the plague any need to run the JSON
> tests in a checkout of any repository not created by and under the full
> control of a test case.
>

Aha - good idea.



-- 
----- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
"Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
those who insist on a perfect world, freedom will have to do." -- Bigby Wolf
_______________________________________________
fossil-dev mailing list
fossil-dev@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/fossil-dev

Reply via email to