test(smoke): end-to-end smoke driving the real CLI against the containerized fake

This commit is contained in:
2026-08-29 16:28:32 -05:00
parent 9b08589092
commit 5feac3cec4
4 changed files with 197 additions and 6 deletions
+26
View File
@@ -0,0 +1,26 @@
// Command fakegitea boots the in-memory fake Gitea on a fixed address
// for the smoke run (see smoke/smoke.sh), seeded with the MOPAC repo the
// script drives. The real forge is never contacted.
package main
import (
"flag"
"log"
"net/http"
"os"
"git.knownelement.com/ukrrs/mopac-gitea-go/internal/fakegitea"
)
func main() {
addr := flag.String("addr", ":8602", "listen address")
flag.Parse()
key := os.Getenv("FAKE_KEY")
if key == "" {
key = "smoke-gitea-token-0123456789"
}
s := fakegitea.NewState(key, "ukrrs")
s.AddRepo("ukrrs", "MOPAC", "main", "main", "feat/quota")
log.Printf("fakegitea listening on %s", *addr)
log.Fatal(http.ListenAndServe(*addr, s.Handler()))
}