Fix Vitest suite and wire cloud/AWS dashboard API helpers.
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
Adds missing client methods, VPC seeder badges, hospice strain UI, and uiHelp drift keys so server/web builds and all 849 Vitest tests pass.
This commit is contained in:
@@ -1,3 +1,30 @@
|
||||
package api
|
||||
import ("testing"; fleetai "crypto-miner-server/internal/ai"; "crypto-miner-server/internal/db")
|
||||
func TestCloudVenueIngest(t *testing.T){ dbi,e:=db.New(t.TempDir()); if e!=nil{t.Fatal(e)}; t.Cleanup(func(){_=dbi.Close()}); h:=NewWSHub(dbi); h.ingestCloudVenueReport("a",fleetai.CloudVenueReport{InstanceType:"g4dn.xlarge",OrganizationalUnit:"ou/gpu"}); if len(h.cloudVenueSnapshot())!=1{t.Fatal()} }
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
fleetai "crypto-miner-server/internal/ai"
|
||||
"crypto-miner-server/internal/db"
|
||||
)
|
||||
|
||||
func TestCloudVenueIngest(t *testing.T) {
|
||||
dbi, e := db.New(t.TempDir())
|
||||
if e != nil {
|
||||
t.Fatal(e)
|
||||
}
|
||||
t.Cleanup(func() { _ = dbi.Close() })
|
||||
h := NewWSHub(dbi)
|
||||
h.ingestCloudVenueReport("a", fleetai.CloudVenueReport{InstanceType: "g4dn.xlarge", OrganizationalUnit: "ou/gpu"})
|
||||
if len(h.cloudVenueSnapshot()) != 1 {
|
||||
t.Fatal("expected venue snapshot")
|
||||
}
|
||||
}
|
||||
|
||||
func TestCloudVenueClassBatchSpot(t *testing.T) {
|
||||
if fleetai.InferCloudVenueClass(fleetai.CloudVenueReport{InstanceType: "c5.large"}) != fleetai.CloudVenueBatch {
|
||||
t.Fatal("expected batch class")
|
||||
}
|
||||
if fleetai.InferCloudVenueClass(fleetai.CloudVenueReport{InstanceType: "t3.spot"}) != fleetai.CloudVenueSpot {
|
||||
t.Fatal("expected spot class")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user