Radish alpha
r
rad:z3qg5TKmN83afz2fj9z3fQjU8vaYE
Radicle CI adapter for native CI
Radicle
Git
tests: config file missing
Lars Wirzenius committed 2 years ago
commit a99dec50075b63d3b6d5fc0af82979be7a589814
parent ca657db
1 file changed +21 -0
modified 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