Fix data fields, Add test

- Fix subdomain variable expected as number by count in data fields
- Add test case for subdomain=false
pull/286/head
Sebastian 10 months ago
parent e10903c1f1
commit 6a28f52a2c

@ -88,4 +88,26 @@ describe("filebrowser", async () => {
"📝 Logs at /tmp/filebrowser.log",
]);
});
it("runs with subdomain=false", async () => {
const state = await runTerraformApply(import.meta.dir, {
agent_id: "foo",
subdomain: false,
});
const output = await executeScriptInContainer(state, "alpine");
expect(output.exitCode).toBe(0);
expect(output.stdout).toEqual([
"\u001B[0;1mInstalling filebrowser ",
"",
"🥳 Installation complete! ",
"",
"👷 Starting filebrowser in background... ",
"",
"📂 Serving /root at http://localhost:13339 ",
"",
"Running 'filebrowser --noauth --root /root --port 13339' ",
"",
"📝 Logs at /tmp/filebrowser.log",
]);
});
});

@ -14,13 +14,9 @@ variable "agent_id" {
description = "The ID of a Coder agent."
}
data "coder_workspace" "me" {
count = var.subdomain
}
data "coder_workspace" "me" {}
data "coder_workspace_owner" "me" {
count = var.subdomain
}
data "coder_workspace_owner" "me" {}
variable "agent_name" {
type = string

Loading…
Cancel
Save