webapps.mason.*: new docs and tests

locals-and-roots
Björn Lindqvist 2016-03-31 00:18:20 +02:00
parent 92b43ce108
commit 6a127dc46c
6 changed files with 52 additions and 2 deletions

View File

@ -0,0 +1,6 @@
USING: help.markup help.syntax ;
IN: webapps.mason.backend
HELP: builder
{ $class-description "The db table that keeps track of the build status of all build machines." }
{ $see-also all-builders } ;

View File

@ -1,5 +1,5 @@
USING: continuations db io.directories io.files.temp tools.test
webapps.mason.backend webapps.utils ;
USING: accessors calendar continuations db io.directories
io.files.temp kernel tools.test webapps.mason.backend webapps.utils ;
IN: webapps.mason.backend.tests
[ "mason-test.db" temp-file delete-file ] ignore-errors
@ -17,3 +17,8 @@ IN: webapps.mason.backend.tests
] with-transaction
] with-db
] unit-test
{ f f } [
builder new now >>heartbeat-timestamp
[ broken? ] [ crashed? ] bi
] unit-test

View File

@ -0,0 +1,6 @@
USING: tools.test xml.writer ;
IN: webapps.mason.downloads
{ "<p>No machines.</p>" } [
{ } builder-list xml>string
] unit-test

View File

@ -0,0 +1,6 @@
USING: furnace.actions help.markup help.syntax ;
IN: webapps.mason.status-update
HELP: <status-update-action>
{ $values { "action" action } }
{ $description "The mason server receives updates from the build machines on this url." } ;

View File

@ -0,0 +1,15 @@
USING: db db.sqlite io.files.temp tools.test webapps.mason.backend
webapps.mason.status-update ;
IN: webapps.mason.status-update.tests
! find-builder
{
T{ builder { host-name "hej" } { os "os" } { cpu "cpu" } }
} [
"mason-test.db" temp-file <sqlite-db> [
[
init-mason-db
"hej" "os" "cpu" find-builder
] with-transaction
] with-db
] unit-test

View File

@ -0,0 +1,12 @@
USING: accessors kernel namespaces present tools.test urls
webapps.mason.backend webapps.mason.utils ;
IN: webapps.mason.utils.tests
{
"http://builds.factorcode.org/report?os=the-os&cpu=the-cpu"
} [
URL" /" url set
builder new "the-os" >>os "the-cpu" >>cpu report-url
present
] unit-test