Skip to content

Commit 5af066c

Browse files
authored
Bugfix: cmds 'provision' and 'run' should work from within the same directory (#922)
Signed-off-by: Matthias Büchse <[email protected]>
1 parent 187f26c commit 5af066c

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

Tests/scs-test-runner.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,22 @@ def build_check_command(self, scope, subject, output):
7979
return {'args': args}
8080

8181
def build_provision_command(self, subject):
82-
return {'args': [
83-
sys.executable, self.run_plugin_py, '--debug', 'create', subject,
84-
]}
82+
# This command will create the file `$subject/kubeconfig.yaml` relative to the current working dir.
83+
# The check script OTOH will expect `$subject/kubeconfig.yaml` relative to the location of the spec
84+
# file (scs-compatible-kaas.yaml). We reconcile these two realms by (tacitly) requiring that the
85+
# spec file be located in the same directory as this script (known as self.cwd).
86+
# This 'solution' leaves room for improvement (we could model the execution environment explicitly),
87+
# but for now, let's not overengineer.
88+
return {
89+
'args': [sys.executable, self.run_plugin_py, '--debug', 'create', subject],
90+
'cwd': self.cwd,
91+
}
8592

8693
def build_unprovision_command(self, subject):
87-
return {'args': [
88-
sys.executable, self.run_plugin_py, '--debug', 'delete', subject,
89-
]}
94+
return {
95+
'args': [sys.executable, self.run_plugin_py, '--debug', 'delete', subject],
96+
'cwd': self.cwd,
97+
}
9098

9199
def build_cleanup_command(self, subject):
92100
# TODO figure out when to supply --debug here (but keep separated from our --debug)

0 commit comments

Comments
 (0)