Optimize rendering, fix Android app extraction, and remove Cloudflare token leak
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
This commit is contained in:
@@ -85,6 +85,23 @@ func TestFindAgentSourceDir(t *testing.T) {
|
||||
|
||||
func TestFindWebRoot(t *testing.T) {
|
||||
dir := findWebRoot()
|
||||
var tempCreated string
|
||||
if dir == "" {
|
||||
_ = os.MkdirAll("webroot", 0755)
|
||||
tempFile := filepath.Join("webroot", "index.html")
|
||||
if err := os.WriteFile(tempFile, []byte("dummy"), 0644); err == nil {
|
||||
tempCreated = tempFile
|
||||
}
|
||||
dir = findWebRoot()
|
||||
}
|
||||
|
||||
if tempCreated != "" {
|
||||
t.Cleanup(func() {
|
||||
_ = os.Remove(tempCreated)
|
||||
_ = os.Remove(filepath.Dir(tempCreated))
|
||||
})
|
||||
}
|
||||
|
||||
if dir == "" {
|
||||
t.Fatal("findWebRoot returned empty string")
|
||||
}
|
||||
@@ -94,6 +111,7 @@ func TestFindWebRoot(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
func TestServerConfigProviderPublicURL(t *testing.T) {
|
||||
cfg := DefaultConfig()
|
||||
cfg.Server.PublicURL = "https://forge.example"
|
||||
|
||||
Reference in New Issue
Block a user