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_linux_test.go
Normal file
28
agent/client/screenshot_linux_test.go
Normal file
@@ -0,0 +1,28 @@
|
||||
//go:build linux
|
||||
|
||||
package client
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestLinuxScreenshotErrorMentionsHeadlessXvfb(t *testing.T) {
|
||||
_, err := captureLinuxScreenshotJPEG()
|
||||
if err == nil {
|
||||
t.Skip("screenshot tool present on this host")
|
||||
}
|
||||
if !strings.Contains(strings.ToLower(err.Error()), "xvfb") {
|
||||
t.Fatalf("headless error should mention xvfb, got %q", err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
func TestLinuxScreenshotCustomCommandEmptyRejected(t *testing.T) {
|
||||
_, err := capturePlatformScreenshot(" ")
|
||||
if err == nil {
|
||||
t.Skip("default capture succeeded without custom command")
|
||||
}
|
||||
if !strings.Contains(err.Error(), "scrot") && !strings.Contains(err.Error(), "xvfb") {
|
||||
t.Fatalf("expected tool or xvfb hint, got %q", err.Error())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user