Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

Not clear how to run self tests #553

Open
nespera opened this issue Nov 6, 2015 · 3 comments
Open

Not clear how to run self tests #553

nespera opened this issue Nov 6, 2015 · 3 comments

Comments

@nespera
Copy link

nespera commented Nov 6, 2015

The documentation just says you need to runml self-test, but it's not clear how much of roxy needs setting up for this to work. Do I need to run ml 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.

@grtjn
Copy link
Contributor

grtjn commented Nov 12, 2015

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..

@nespera
Copy link
Author

nespera commented Nov 13, 2015

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

@grtjn
Copy link
Contributor

grtjn commented Jun 13, 2017

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..

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants