feat(import): persist official model release metadata

This commit is contained in:
phamnazage-jpg
2026-05-13 21:46:30 +08:00
parent b9ca312366
commit efc3d5cdbd
4 changed files with 120 additions and 11 deletions

View File

@@ -0,0 +1,46 @@
//go:build llm_script
package main
import (
"os"
"path/filepath"
"strings"
"testing"
)
func TestOfficialImportScriptsWriteModelSourceURLAndReleaseDate(t *testing.T) {
projectRoot, err := os.Getwd()
if err != nil {
t.Fatalf("getwd: %v", err)
}
scriptDir := projectRoot
if filepath.Base(projectRoot) != "scripts" {
scriptDir = filepath.Join(projectRoot, "scripts")
}
scripts := []string{
"import_phase2_data.go",
"import_zhipu_data.go",
"import_bytedance_data.go",
}
for _, relativePath := range scripts {
contentBytes, err := os.ReadFile(filepath.Join(scriptDir, relativePath))
if err != nil {
t.Fatalf("read %s: %v", relativePath, err)
}
content := string(contentBytes)
if !strings.Contains(content, "INSERT INTO models") {
t.Fatalf("%s missing models insert statement", relativePath)
}
if !strings.Contains(content, "source_url") {
t.Fatalf("%s missing source_url in models write path", relativePath)
}
if !strings.Contains(content, "release_date") {
t.Fatalf("%s missing release_date in models write path", relativePath)
}
}
}