File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
images/docker-stacks-foundation
tests/docker-stacks-foundation Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -86,9 +86,11 @@ def source(path: PosixPath):
86
86
87
87
if not hooks_directory .exists ():
88
88
print (f"Directory { hooks_directory } does not exist" )
89
+ sys .exit (1 )
89
90
90
91
if not hooks_directory .is_dir ():
91
92
print (f"{ hooks_directory } is not a directory" )
93
+ sys .exit (1 )
92
94
93
95
print (f"Running hooks in: { hooks_directory } as { os .getuid ()} gid: { os .getgid ()} " )
94
96
@@ -104,9 +106,7 @@ def source(path: PosixPath):
104
106
f"{ f } has failed with return code { run .returncode } , continuing execution"
105
107
)
106
108
else :
107
- print (f"Ignoring non-executable file { f } " )
109
+ print (f"Ignoring non-executable: { f } " )
108
110
109
111
110
112
print (f"Done running hooks in: { hooks_directory } " )
111
-
112
- print (os .environ ['HELLO' ])
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ def test_run_hooks_missing_dir(container: TrackedContainer) -> None:
44
44
"source /usr/local/bin/run-hooks.sh /tmp/missing-dir/" ,
45
45
],
46
46
)
47
- assert "Directory /tmp/missing-dir/ doesn't exist or is not a directory " in logs
47
+ assert "Directory /tmp/missing-dir does not exist " in logs
48
48
49
49
50
50
def test_run_hooks_dir_is_file (container : TrackedContainer ) -> None :
@@ -58,7 +58,7 @@ def test_run_hooks_dir_is_file(container: TrackedContainer) -> None:
58
58
"touch /tmp/some-file && source /usr/local/bin/run-hooks.sh /tmp/some-file" ,
59
59
],
60
60
)
61
- assert "Directory /tmp/some-file doesn't exist or is not a directory" in logs
61
+ assert "/tmp/some-file is not a directory" in logs
62
62
63
63
64
64
def test_run_hooks_empty_dir (container : TrackedContainer ) -> None :
@@ -91,7 +91,7 @@ def test_run_hooks_with_files(container: TrackedContainer) -> None:
91
91
command = ["bash" , "-c" , command ],
92
92
)
93
93
assert "Executable python file was successfully" in logs
94
- assert "Ignoring non-executable: /home/jovyan/data-copy// non_executable.py" in logs
94
+ assert "Ignoring non-executable: /home/jovyan/data-copy/non_executable.py" in logs
95
95
assert "SOME_VAR is 123" in logs
96
96
97
97
You can’t perform that action at this time.
0 commit comments