miguelrgonzalez / mlsound

NPM-based application deployment tool for MarkLogic
Other
8 stars 5 forks source link

Add scripted testing #6

Open dmcassel opened 9 years ago

dmcassel commented 9 years ago

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

rjrudin commented 9 years ago

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 - https://github.com/rjrudin/ml-app-deployer/issues/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.

dmcassel commented 9 years ago

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

xquery commented 9 years ago

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.

dmcassel commented 9 years ago

Thanks @xquery, that makes sense.