Add scripted testing
dmcassel opened this issue · comments
Add scripted tests that can be run after cloning mlsound. This is for the benefit of mlsound developers and is not intended to be included when someone runs "mlsound create".
Related to this is the need for a nice way of waiting for ML to restart - that's assuming that a test does something like "Create ML resources / verify them / remove them / verify they are removed", where the remove part may involve deleting an app server, thus forcing a restart. For waiting for a restart, I copied what Charles did in samplestack, but both him and Jim Fuller mentioned that something more robust ought to be used.
I have a ticket open for this in ml-app-deployer - marklogic/ml-app-deployer#42 - would be good to compare notes on how to properly do this. I started an impl that handled different kinds of exceptions and HTTP response codes, but it was getting trickier than I thought, so I stuck with the basic approach.
In the Admin UI, the Status view of a host shows an Online value, like "Host up since August 7, 2015 10:18:59 AM". That would work if we could get that through the Management API, but I don't see a way to access it. Closest I see is http://localhost:8002/manage/v2/hosts/macpro-2396?view=status&format=html, which has "online": true (gee, thanks).
unless I am mistaken, the following explains the idiom;
http://docs.marklogic.com/guide/admin-api/cluster#id_38205
myself (and QA, Wayne, Norm and others) have all written some variant of this... give me a shout if you need fuller explanation.
Thanks @xquery, that makes sense.