Open nespera opened 8 years ago
You can clone Roxy, and run ml self-test
without doing init first. But it also works when you did init. Self-test relies on the properties inside deploy/test/data/ml7-properties/ (and sibling folders for other versions). It should run completely headless though, and not ask for any user/password..
On master with 8.0.3 running locally I get 4 test failures on a fresh clone, while on dev I also get the test asking me for admin user/password. So I assumed that something needed to be configured.
Finished tests in 22.407606s, 0.7140 tests/s, 1.8744 assertions/s.
1) Error:
test_0002_should_bootstrap_a_changed_config_file(ServerConfig::bootstrap):
Net::HTTPServerException: 401 "Unauthorized"
/home/chris/Projects/marklogic-roxy/deploy/lib/MLClient.rb:111:in `go'
/home/chris/Projects/marklogic-roxy/deploy/lib/server_config.rb:1892:in `get_sid'
/home/chris/Projects/marklogic-roxy/deploy/lib/server_config.rb:1985:in `execute_query_7'
/home/chris/Projects/marklogic-roxy/deploy/lib/server_config.rb:509:in `execute_query'
/home/chris/Projects/marklogic-roxy/deploy/test/test_server_config.rb:74:in `block (3 levels) in <top (required)>'
2) Error:
test_0002_should_bootstrap_a_changed_config_file(ServerConfig::bootstrap):
Net::HTTPServerException: 401 "Unauthorized"
/home/chris/Projects/marklogic-roxy/deploy/lib/MLClient.rb:111:in `go'
/home/chris/Projects/marklogic-roxy/deploy/lib/server_config.rb:1892:in `get_sid'
/home/chris/Projects/marklogic-roxy/deploy/lib/server_config.rb:1985:in `execute_query_7'
/home/chris/Projects/marklogic-roxy/deploy/lib/server_config.rb:509:in `execute_query'
/home/chris/Projects/marklogic-roxy/deploy/lib/server_config.rb:848:in `wipe'
/home/chris/Projects/marklogic-roxy/deploy/test/test_server_config.rb:104:in `block (3 levels) in <top (required)>'
3) Error:
test_0001_should_bootstrap_successfully_twice_consecutively(ServerConfig::bootstrap):
Net::HTTPServerException: 401 "Unauthorized"
/home/chris/Projects/marklogic-roxy/deploy/lib/MLClient.rb:111:in `go'
/home/chris/Projects/marklogic-roxy/deploy/lib/server_config.rb:1892:in `get_sid'
/home/chris/Projects/marklogic-roxy/deploy/lib/server_config.rb:1985:in `execute_query_7'
/home/chris/Projects/marklogic-roxy/deploy/lib/server_config.rb:509:in `execute_query'
/home/chris/Projects/marklogic-roxy/deploy/test/test_server_config.rb:74:in `block (3 levels) in <top (required)>'
4) Error:
test_0001_should_bootstrap_successfully_twice_consecutively(ServerConfig::bootstrap):
Net::HTTPServerException: 401 "Unauthorized"
/home/chris/Projects/marklogic-roxy/deploy/lib/MLClient.rb:111:in `go'
/home/chris/Projects/marklogic-roxy/deploy/lib/server_config.rb:1892:in `get_sid'
/home/chris/Projects/marklogic-roxy/deploy/lib/server_config.rb:1985:in `execute_query_7'
/home/chris/Projects/marklogic-roxy/deploy/lib/server_config.rb:509:in `execute_query'
/home/chris/Projects/marklogic-roxy/deploy/lib/server_config.rb:848:in `wipe'
/home/chris/Projects/marklogic-roxy/deploy/test/test_server_config.rb:104:in `block (3 levels) in <top (required)>'
5) Failure:
test_0001_should_prompt_the_user_for_credentials(ServerConfig::test_credentials) [/home/chris/Projects/marklogic-roxy/deploy/test/test_server_config.rb:180]:
Expected: "bob"
Actual: "chris"
16 tests, 42 assertions, 1 failures, 4 errors, 0 skips
Self-test by default runs against localhost and expects being able to access using admin/admin. You can change local-server by adding a local.properties within deploy/test/data/ml7-properties/ or within the folder matching your server version.
Unfortunately the current test code checks user/pass values of the properties, expecting them to match admin/admin. I have addressed that in PR #805..
I agree though, we could spend a few more words on this too in https://github.com/marklogic/roxy/blob/master/CONTRIBUTING.md..
The documentation just says you need to run
ml self-test
, but it's not clear how much of roxy needs setting up for this to work. Do I need to runml init
and edit build.properties? Anything else?Additionally, there's an interactive test that asks for username/password and apparently expects these to be bob/smith in order to pass.