Add basic test
This commit is contained in:
parent
252d08ccec
commit
ef2727f392
@ -28,6 +28,21 @@ describe("dotfiles", async () => {
|
|||||||
expect(state.outputs.dotfiles_uri.value).toBe(default_dotfiles_uri);
|
expect(state.outputs.dotfiles_uri.value).toBe(default_dotfiles_uri);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("command uses bash for fish shell compatibility", async () => {
|
||||||
|
const state = await runTerraformApply(import.meta.dir, {
|
||||||
|
agent_id: "foo",
|
||||||
|
manual_update: "true",
|
||||||
|
dotfiles_uri: "https://github.com/test/dotfiles",
|
||||||
|
});
|
||||||
|
|
||||||
|
const app = state.resources.find(
|
||||||
|
(r) => r.type === "coder_app" && r.name === "dotfiles"
|
||||||
|
);
|
||||||
|
|
||||||
|
expect(app).toBeDefined();
|
||||||
|
expect(app?.instances[0]?.attributes?.command).toContain("/bin/bash -c");
|
||||||
|
});
|
||||||
|
|
||||||
it("set custom order for coder_parameter", async () => {
|
it("set custom order for coder_parameter", async () => {
|
||||||
const order = 99;
|
const order = 99;
|
||||||
const state = await runTerraformApply(import.meta.dir, {
|
const state = await runTerraformApply(import.meta.dir, {
|
||||||
|
|||||||
@ -99,7 +99,7 @@ resource "coder_app" "dotfiles" {
|
|||||||
icon = "/icon/dotfiles.svg"
|
icon = "/icon/dotfiles.svg"
|
||||||
order = var.order
|
order = var.order
|
||||||
group = var.group
|
group = var.group
|
||||||
command = "/usr/bin/env bash -c ${shellquote(templatefile("${path.module}/run.sh", {
|
command = "/bin/bash -c ${jsonencode(templatefile("${path.module}/run.sh", {
|
||||||
DOTFILES_URI : local.dotfiles_uri,
|
DOTFILES_URI : local.dotfiles_uri,
|
||||||
DOTFILES_USER : local.user
|
DOTFILES_USER : local.user
|
||||||
}))}"
|
}))}"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user