From a99dec50075b63d3b6d5fc0af82979be7a589814 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Wed, 10 Jan 2024 15:49:41 +0200 Subject: [PATCH] tests: config file missing Signed-off-by: Lars Wirzenius --- test-suite | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) 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