summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2024-01-10 16:30:10 +0200
committerLars Wirzenius <liw@liw.fi>2024-01-10 17:38:05 +0200
commit2cfafb8075bc829b4065e6059c9f9dd81a4662f4 (patch)
tree509b1b291cf02b9731b1cad2b762cb4e00fdcedf
parent1dad8cb66fbbc3c9aeb9d7092f5eadc796a2bcb3 (diff)
downloadradicle-native-ci-2cfafb8075bc829b4065e6059c9f9dd81a4662f4.tar.gz
tests: commit is missing
Signed-off-by: Lars Wirzenius <liw@liw.fi>
-rwxr-xr-xtest-suite16
1 files changed, 16 insertions, 0 deletions
diff --git a/test-suite b/test-suite
index 00aa661..2bf9d71 100755
--- a/test-suite
+++ b/test-suite
@@ -156,6 +156,22 @@ class Suite:
assert "clone" in error
assert rid[len("rad:") :] in error
+ def test_commit_does_not_exist(self):
+ git = self._create_git_repo("commit-missing")
+ self._create_valid_native_yaml(git, "echo hello world")
+ rid, _commit = self._get_repo_info(git)
+ commit = "0000000000000000000000000000000000000000"
+ trigger = Trigger(rid, commit)
+ ci = self._create_ci()
+ exit, resps, stderr = ci.run(trigger)
+
+ assert exit != 0
+ assert len(resps) == 2
+ self.assert_triggered(resps[0])
+ self.assert_error(resps[1])
+ error = resps[1]["result"]["error"]
+ assert commit in error
+
def test_native_yaml_has_no_shell(self):
exit, resps, stderr = self._test_case("no-shell", None)
assert exit != 0