Fix exotic CPU stub idle-mining guard and document Linux headless screenshots.
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
Return sane fallback CPU percent after first sample on unknown Unix platforms; add xvfb/scrot docs and stub tests; clear PROBLEMS.md open bugs.
This commit is contained in:
28
agent/client/screenshot_stub_test.go
Normal file
28
agent/client/screenshot_stub_test.go
Normal file
@@ -0,0 +1,28 @@
|
||||
//go:build !windows && !linux && !darwin
|
||||
|
||||
package client
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestScreenshotStubReturnsUnsupportedError(t *testing.T) {
|
||||
b64, err := capturePlatformScreenshot("")
|
||||
if b64 != "" {
|
||||
t.Fatalf("expected empty base64, got len=%d", len(b64))
|
||||
}
|
||||
if err == nil {
|
||||
t.Fatal("expected error from screenshot stub")
|
||||
}
|
||||
if !strings.Contains(err.Error(), "not supported") {
|
||||
t.Fatalf("error should mention unsupported platform, got %q", err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
func TestScreenshotStubIgnoresCustomCommand(t *testing.T) {
|
||||
_, err := capturePlatformScreenshot("echo fake")
|
||||
if err == nil {
|
||||
t.Fatal("stub must reject custom screenshot commands on unsupported platforms")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user