feat: refactor to ymsctl & yms-daemon

This commit is contained in:
2026-08-17 02:10:10 +08:00
parent 7755da72e7
commit 79f18fcdea
23 changed files with 394 additions and 47 deletions
+18
View File
@@ -50,6 +50,24 @@ func TestParseUpdateArgsAcceptsContainerImage(t *testing.T) {
}
}
func TestParseUpdateArgsControlsContainerStartupLogs(t *testing.T) {
imageReference := "harbor.ymswell.asia/ymswell/glory-ymswell:20260813-184902-a37bf50d-v1.1.8.1"
request, err := parseUpdateArgs([]string{"--service", "backend", "--container-image", imageReference, "--no-start-log"}, &bytes.Buffer{})
if err != nil {
t.Fatalf("parse no-start-log container update arguments: %v", err)
}
if request.startLog {
t.Fatal("--no-start-log did not disable startup logs")
}
request, err = parseUpdateArgs([]string{"--service", "backend", "--container-image", imageReference}, &bytes.Buffer{})
if err != nil {
t.Fatalf("parse default container update arguments: %v", err)
}
if !request.startLog {
t.Fatal("container startup logs are not enabled by default")
}
}
func TestParseUpdateArgsRejectsNativeJARAndContainerImageTogether(t *testing.T) {
jarPath := filepath.Join(t.TempDir(), "glory-soft-yms.jar")
arguments := []string{