test(smoke): end-to-end smoke driving the real CLI against the containerized fake
This commit is contained in:
@@ -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()))
|
||||
}
|
||||
Reference in New Issue
Block a user