- research: searches SearXNG, reads the best pages through the reader, has the model list the server's variants, then checks every Docker image and Steam app it named for real before an admin sees it. - build: first boot of the variant's images (skipping ones that need root), a draft by the model, then the draft deployed with the node-agent's BootTest like CI does; crashes, error lines and saves outside /server go back to the model, three boots at most. - worker: polls the panel's builder queue (outbound only), runs research or build in a fresh clone, streams the output as the job log, and opens the result as a pull request from gbr-bot. - Dockerfile.builder, a workflow publishing gbr-builder:latest, compose and env files for the builder VM, and BUILDER.md. draft now keeps its conversation in a drafter, so build can send boot failures back to the same model session. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
42 lines
1.0 KiB
Go
42 lines
1.0 KiB
Go
package main
|
|
|
|
import "testing"
|
|
|
|
func TestPickPagesPrefersDocsAndOnePerSite(t *testing.T) {
|
|
hits := []searchHit{
|
|
{URL: "https://blog.example.com/valheim-server"},
|
|
{URL: "https://github.com/a/valheim-docker"},
|
|
{URL: "https://github.com/b/other"},
|
|
{URL: "https://hub.docker.com/r/x/valheim"},
|
|
{URL: "https://blog.example.com/valheim-server"},
|
|
}
|
|
got := pickPages(hits, 3)
|
|
if len(got) != 3 {
|
|
t.Fatalf("got %d pages", len(got))
|
|
}
|
|
if got[0].URL != "https://github.com/a/valheim-docker" || got[1].URL != "https://hub.docker.com/r/x/valheim" || got[2].URL != "https://blog.example.com/valheim-server" {
|
|
t.Errorf("order: %v", got)
|
|
}
|
|
}
|
|
|
|
func TestTrimToJSON(t *testing.T) {
|
|
if got := trimToJSON("Here you go:\n```json\n{\"a\": 1}\n```"); got != `{"a": 1}` {
|
|
t.Errorf("got %q", got)
|
|
}
|
|
}
|
|
|
|
func TestAppNameFromAppInfo(t *testing.T) {
|
|
out := `"896660"
|
|
{
|
|
"common"
|
|
{
|
|
"name" "Valheim Dedicated Server"
|
|
"type" "Tool"
|
|
}
|
|
}`
|
|
m := appName.FindStringSubmatch(out)
|
|
if m == nil || m[1] != "Valheim Dedicated Server" {
|
|
t.Errorf("got %v", m)
|
|
}
|
|
}
|