summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2024-01-10 15:49:41 +0200
committerLars Wirzenius <liw@liw.fi>2024-01-10 17:38:05 +0200
commita99dec50075b63d3b6d5fc0af82979be7a589814 (patch)
treea6223a971450cdce641ba779b81453ec63872c8d
parentca657dbf9add107e7a456a1d8ddc54a6c1792300 (diff)
downloadradicle-native-ci-a99dec50075b63d3b6d5fc0af82979be7a589814.tar.gz
tests: config file missing
Signed-off-by: Lars Wirzenius <liw@liw.fi>
-rwxr-xr-xtest-suite21
1 files changed, 21 insertions, 0 deletions
diff --git a/test-suite b/test-suite
index 68b501d..1ecbcc3 100755
--- a/test-suite
+++ b/test-suite
@@ -114,6 +114,27 @@ class Suite:
assert len(resps) == 0
assert "RADICLE_NATIVE_CI" in stderr
+ def test_config_missing(self):
+ git = Git(os.path.join(self.tmp, "config-missing"))
+ git.init()
+ git.write("README.md", "README")
+ native = NativeYaml("echo hello world")
+ debug(f"native.yaml: {native.yaml()}")
+ git.write(".radicle/native.yaml", native.yaml())
+ git.commit("first commit")
+ commit = git.head()
+ self.rad.init(git)
+ rid = self.rad.rid(git)
+ trigger = Trigger(rid, commit)
+ cfg2 = Config("no-config-file")
+ ci = NativeCI(self.rad, cfg2)
+ exit, resps, stderr = ci.run(trigger)
+ debug(f"exit: {exit}")
+ debug(f"responses: {resps}")
+ assert exit != 0
+ assert len(resps) == 0
+ assert "no-config-file" in stderr
+
def test_command_fails(self):
exit, resps, stderr = self._test_case("cmd-fails", "false")
assert exit != 0