started test, standardized git not installed message

pull/47/head
Stephen Kirby 2 years ago
parent f7c5c46a21
commit ca1d4547cb

@ -0,0 +1,37 @@
import { describe, expect, it } from "bun:test";
import {
executeScriptInContainer,
runTerraformApply,
runTerraformInit,
testRequiredVariables,
} from "../test";
describe("git-config", async () => {
await runTerraformInit(import.meta.dir);
testRequiredVariables(import.meta.dir, {
agent_id: "foo",
});
it("fails without git", async () => {
const state = await runTerraformApply(import.meta.dir, {
agent_id: "foo",
});
const output = await executeScriptInContainer(state, "alpine");
expect(output.exitCode).toBe(1);
expect(output.stdout).toEqual(["Git is not installed!"]);
});
// it("runs with git", async () => {
// const state = await runTerraformApply(import.meta.dir, {
// agent_id: "foo",
// url: "fake-url",
// });
// const output = await executeScriptInContainer(state, "alpine/git");
// expect(output.exitCode).toBe(128);
// expect(output.stdout).toEqual([
// "Creating directory ~/fake-url...",
// "Cloning fake-url to ~/fake-url...",
// ]);
// });
});

@ -5,7 +5,7 @@ printf "$${BOLD}Checking git-config!\n"
# Check if git is installed
command -v git >/dev/null 2>&1 || {
echo "git is not installed! Install git to sync username and email.\n"
echo "Git is not installed!"
exit 1
}

Loading…
Cancel
Save