Replace Notarius bundle promotion with rename
This commit is contained in:
@@ -36,31 +36,6 @@ func TestWorkspaceModesOverrideRestrictiveUmask(t *testing.T) {
|
||||
assertWorkspaceFileMode(t, file)
|
||||
}
|
||||
|
||||
func TestPromoteDirectoryUsesWorkspaceModesUnderRestrictiveUmask(t *testing.T) {
|
||||
root := t.TempDir()
|
||||
src := filepath.Join(root, "source")
|
||||
if err := os.MkdirAll(filepath.Join(src, "nested"), 0o755); err != nil {
|
||||
t.Fatalf("MkdirAll(source) error = %v", err)
|
||||
}
|
||||
if err := os.WriteFile(filepath.Join(src, "nested", "result.json"), []byte("result"), 0o600); err != nil {
|
||||
t.Fatalf("WriteFile(source) error = %v", err)
|
||||
}
|
||||
|
||||
destinationParent := filepath.Join(root, "workspace", "artifacts", "notarius")
|
||||
if err := EnsureWorkspaceDirectory(destinationParent); err != nil {
|
||||
t.Fatalf("EnsureWorkspaceDirectory(destination parent) error = %v", err)
|
||||
}
|
||||
restoreUmask := syscall.Umask(0o077)
|
||||
t.Cleanup(func() { syscall.Umask(restoreUmask) })
|
||||
destination := filepath.Join(destinationParent, "run-1")
|
||||
if err := PromoteDirectory(src, destination); err != nil {
|
||||
t.Fatalf("PromoteDirectory() error = %v", err)
|
||||
}
|
||||
assertWorkspaceDirectoryMode(t, destination)
|
||||
assertWorkspaceDirectoryMode(t, filepath.Join(destination, "nested"))
|
||||
assertWorkspaceFileMode(t, filepath.Join(destination, "nested", "result.json"))
|
||||
}
|
||||
|
||||
func assertWorkspaceDirectoryMode(t *testing.T, path string) {
|
||||
t.Helper()
|
||||
info, err := os.Stat(path)
|
||||
|
||||
Reference in New Issue
Block a user