feat: add object storage and points leaderboard

This commit is contained in:
richjohnrambo
2026-10-18 18:11:34 +08:00
parent bce5edfaf5
commit b79b781f15
24 changed files with 359 additions and 212 deletions
+26
View File
@@ -19,3 +19,29 @@ func TestConfigRejectsOtherDatabase(t *testing.T) {
t.Fatal("expected non-olons_admin database to be rejected")
}
}
func TestApplyUploadSystemConfig(t *testing.T) {
cfg := UploadConfig{Driver: "local", Region: "us-east-1"}
ApplyUploadSystemConfig(&cfg, map[string]string{
"uploadDrive": "minio",
"uploadMinioAccessKey": "access",
"uploadMinioSecretKey": "secret",
"uploadMinioEndpoint": "minio.example.com",
"uploadMinioUseSSL": "1",
"uploadMinioPath": "images/",
"uploadMinioBucket": "bucket",
"uploadMinioDomain": "https://cdn.example.com",
})
if err := ValidateUpload(cfg); err != nil {
t.Fatal(err)
}
if cfg.Driver != "minio" || !cfg.Secure || cfg.Bucket != "bucket" || cfg.Path != "images/" {
t.Fatalf("unexpected upload config: %+v", cfg)
}
}
func TestValidateUploadRejectsIncompleteMinio(t *testing.T) {
if err := ValidateUpload(UploadConfig{Driver: "minio"}); err == nil {
t.Fatal("expected incomplete minio config to be rejected")
}
}