Add persistent job claim and file artifact reads
This commit is contained in:
@@ -676,6 +676,36 @@ func TestDeploymentFileExecutorUsesServerRoot(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestDeploymentFileExecutorListsNestedPathsFromServerRoot(t *testing.T) {
|
||||
workspaceRoot := t.TempDir()
|
||||
serverRoot := t.TempDir()
|
||||
if err := os.MkdirAll(filepath.Join(serverRoot, "SCUM", "Saved"), 0o700); err != nil {
|
||||
t.Fatalf("mkdir server root fixture: %v", err)
|
||||
}
|
||||
if err := os.WriteFile(filepath.Join(serverRoot, "SCUM", "Saved", "ServerSettings.ini"), []byte("[/Script/SCUM.ServerSettings]\n"), 0o600); err != nil {
|
||||
t.Fatalf("write server root fixture: %v", err)
|
||||
}
|
||||
executor, err := NewFileExecutor(workspaceRoot)
|
||||
if err != nil {
|
||||
t.Fatalf("new file executor: %v", err)
|
||||
}
|
||||
assignment := executionAssignment(protocol.RunCapabilityFilesList)
|
||||
assignment.TargetKey = "server-root"
|
||||
assignment.ExecutionInput.Deployment = &protocol.ServerDeploymentExecution{SchemaVersion: "1", Mode: "guided-install", ServerRoot: serverRoot, Revision: 7}
|
||||
assignment.ExecutionInput.Inputs = map[string]string{"path": "SCUM", "recursive": "true", "query": ""}
|
||||
result := executor.Execute(context.Background(), assignment)
|
||||
if result.State != lifecycleResultStateSucceeded || result.ExecutionResult.Kind != "file.list" {
|
||||
t.Fatalf("expected deployment root listing, got %+v", result)
|
||||
}
|
||||
var envelope fileListEnvelope
|
||||
if err := json.Unmarshal([]byte(result.ExecutionResult.Content), &envelope); err != nil {
|
||||
t.Fatalf("decode listing: %v", err)
|
||||
}
|
||||
if envelope.Path != "SCUM" || len(envelope.Entries) != 2 || envelope.Entries[0].RelativePath != "SCUM/Saved" || envelope.Entries[1].RelativePath != "SCUM/Saved/ServerSettings.ini" {
|
||||
t.Fatalf("expected deployment-root relative paths, got %+v", envelope)
|
||||
}
|
||||
}
|
||||
|
||||
func TestScopedFileExecutorCancellationLeavesTargetUnchanged(t *testing.T) {
|
||||
root := t.TempDir()
|
||||
executor, err := NewFileExecutor(root)
|
||||
|
||||
Reference in New Issue
Block a user