{"action":"created","issue":{"url":"https://api.github.com/repos/cortesi/devd/issues/28","labels_url":"https://api.github.com/repos/cortesi/devd/issues/28/labels{/name}","comments_url":"https://api.github.com/repos/cortesi/devd/issues/28/comments","events_url":"https://api.github.com/repos/cortesi/devd/issues/28/events","html_url":"https://github.com/cortesi/devd/issues/28","id":116853619,"number":28,"title":"Integrated self-test ?","user":{"login":"kad","id":41858,"avatar_url":"https://avatars.githubusercontent.com/u/41858?v=3","gravatar_id":"","url":"https://api.github.com/users/kad","html_url":"https://github.com/kad","followers_url":"https://api.github.com/users/kad/followers","following_url":"https://api.github.com/users/kad/following{/other_user}","gists_url":"https://api.github.com/users/kad/gists{/gist_id}","starred_url":"https://api.github.com/users/kad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kad/subscriptions","organizations_url":"https://api.github.com/users/kad/orgs","repos_url":"https://api.github.com/users/kad/repos","events_url":"https://api.github.com/users/kad/events{/privacy}","received_events_url":"https://api.github.com/users/kad/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-13T21:16:44Z","updated_at":"2015-11-13T21:27:41Z","closed_at":null,"body":"I'm planning to create formula for homebrew for devd. For that, it would be good if devd can be tested somehow. Currently it's not easily possible.\r\nMaybe it's can be added functionality that would perform HEAD request to itself and validate some headers and exit with result code ?\r\nOr something a bit more complex: start with directory parameter in test mode, try to request some file and validate it by also reading from filesystem ?\r\n\r\nOr maybe something else in your opinion can be used as simple test of devd ?"},"comment":{"url":"https://api.github.com/repos/cortesi/devd/issues/comments/156560896","html_url":"https://github.com/cortesi/devd/issues/28#issuecomment-156560896","issue_url":"https://api.github.com/repos/cortesi/devd/issues/28","id":156560896,"user":{"login":"cortesi","id":22544,"avatar_url":"https://avatars.githubusercontent.com/u/22544?v=3","gravatar_id":"","url":"https://api.github.com/users/cortesi","html_url":"https://github.com/cortesi","followers_url":"https://api.github.com/users/cortesi/followers","following_url":"https://api.github.com/users/cortesi/following{/other_user}","gists_url":"https://api.github.com/users/cortesi/gists{/gist_id}","starred_url":"https://api.github.com/users/cortesi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cortesi/subscriptions","organizations_url":"https://api.github.com/users/cortesi/orgs","repos_url":"https://api.github.com/users/cortesi/repos","events_url":"https://api.github.com/users/cortesi/events{/privacy}","received_events_url":"https://api.github.com/users/cortesi/received_events","type":"User","site_admin":false},"created_at":"2015-11-13T21:27:41Z","updated_at":"2015-11-13T21:27:41Z","body":"Hi Alexander - a brew formula would be great, so thanks for looking at this. I just a few moments ago committed a change to the build script that might make this easier - \"./build single\" goes through the dance of compiling the static assets, building the binary, and then removing the compiled asset source files again.\r\n\r\nRegarding the self-test. I see that the Caddy webserver does something very, very simple in its formula - [it just starts up the service, and then reads from the process stdout to check that it reports binding to an expected address](https://github.com/Homebrew/homebrew/blob/master/Library/Formula/caddy.rb#L70-L80). We can do this now with devd out of the box, as long as we don't over-specify the port (we select ours automatically). \r\n\r\nIf we feel this is not enough, I'd also support adding a special request location to the daemon (/_devd_status or something similar), that just returns \"OK\". We can then request that URL in the test script (we'd have to parse the actual port out of the stdout output). Initially the fact that we can respond at all is probably enough of a self-test, but eventually we can augment that with whatever we like. Whatever we do, I feel something like verifying the file read from disk would probably be overkill. \r\n\r\nMy feeling is that if the Caddy \"self-test\" is acceptable, we should just do that for now. What do you think?\r\n\r\n\r\n\r\n\r\n"}}