修复发布构建本机路径泄漏并补齐产物检查

This commit is contained in:
xuans committed 2026-09-20 02:01:06 +08:00
1 parent ba6c6d13e5
commit a21240109a
13 files changed
+436 -28

No files matched your search

+1 -6
View File
@@ -5,17 +5,12 @@ import (
"os"
"path/filepath"
"regexp"
"runtime"
"strings"
"testing"
)
func TestLinuxInstallerPolicy(t *testing.T) {
_, sourceFile, _, ok := runtime.Caller(0)
if !ok {
t.Fatal("无法定位测试源文件")
}
installerPath := filepath.Join(filepath.Dir(sourceFile), "..", "..", "..", "deploy", "install-linux.sh")
installerPath := filepath.Join("..", "..", "..", "deploy", "install-linux.sh")
data, err := os.ReadFile(installerPath)
if err != nil {
t.Fatalf("读取 Linux 安装器失败:%v", err)
+1 -5
View File
@@ -12,11 +12,7 @@ import (
)
func TestScertAdminSystemdUnitKeepsManualOnlyPolicy(t *testing.T) {
_, sourceFile, _, ok := runtime.Caller(0)
if !ok {
t.Fatal("无法定位测试源文件")
}
unitPath := filepath.Join(filepath.Dir(sourceFile), "..", "..", "..", "deploy", "systemd", "Scert-admin.service")
unitPath := filepath.Join("..", "..", "..", "deploy", "systemd", "Scert-admin.service")
data, err := os.ReadFile(unitPath)
if err != nil {
t.Fatalf("读取 Scert-admin systemd unit 失败:%v", err)
+1 -6
View File
@@ -3,17 +3,12 @@ package admin
import (
"os"
"path/filepath"
"runtime"
"strings"
"testing"
)
func TestScertSystemdUnitPolicy(t *testing.T) {
_, sourceFile, _, ok := runtime.Caller(0)
if !ok {
t.Fatal("无法定位测试源文件")
}
unitPath := filepath.Join(filepath.Dir(sourceFile), "..", "..", "..", "deploy", "systemd", "Scert.service")
unitPath := filepath.Join("..", "..", "..", "deploy", "systemd", "Scert.service")
data, err := os.ReadFile(unitPath)
if err != nil {
t.Fatalf("读取 Scert systemd unit 失败:%v", err)