Skip to content

Commit 358f47b

Browse files
fix: resolve failing filebrowser tests (#173)
## Description - Increase timeouts for tests so that they reliably succeed. - Remove filebrowser admin user creation since noauth is set - Remove duplicate log declaration in coder_script --- ## Type of Change - [ ] New module - [X] Bug fix - [ ] Feature/enhancement - [ ] Documentation - [ ] Other --- ## Module Information <!-- Delete this section if not applicable --> **Path:** `registry/[namespace]/modules/filebrowser` **New version:** `v1.1.1` **Breaking change:** [ ] Yes [X] No --- ## Testing & Validation - [X] Tests pass (`bun test`) - [X] Code formatted (`bun run fmt`) - [X] Changes tested locally --- ## Related (https://github.com/coder/registry/actions/runs/15975017391/job/45055105439?pr=160)
1 parent 121328f commit 358f47b

File tree

4 files changed

+14
-13
lines changed

4 files changed

+14
-13
lines changed

registry/coder/modules/filebrowser/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ A file browser for your workspace.
1515
module "filebrowser" {
1616
count = data.coder_workspace.me.start_count
1717
source = "registry.coder.com/coder/filebrowser/coder"
18-
version = "1.1.0"
18+
version = "1.1.1"
1919
agent_id = coder_agent.example.id
2020
}
2121
```
@@ -30,7 +30,7 @@ module "filebrowser" {
3030
module "filebrowser" {
3131
count = data.coder_workspace.me.start_count
3232
source = "registry.coder.com/coder/filebrowser/coder"
33-
version = "1.1.0"
33+
version = "1.1.1"
3434
agent_id = coder_agent.example.id
3535
folder = "/home/coder/project"
3636
}
@@ -42,7 +42,7 @@ module "filebrowser" {
4242
module "filebrowser" {
4343
count = data.coder_workspace.me.start_count
4444
source = "registry.coder.com/coder/filebrowser/coder"
45-
version = "1.1.0"
45+
version = "1.1.1"
4646
agent_id = coder_agent.example.id
4747
database_path = ".config/filebrowser.db"
4848
}
@@ -54,7 +54,7 @@ module "filebrowser" {
5454
module "filebrowser" {
5555
count = data.coder_workspace.me.start_count
5656
source = "registry.coder.com/coder/filebrowser/coder"
57-
version = "1.1.0"
57+
version = "1.1.1"
5858
agent_id = coder_agent.example.id
5959
agent_name = "main"
6060
subdomain = false

registry/coder/modules/filebrowser/main.test.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,36 +55,37 @@ describe("filebrowser", async () => {
5555
);
5656

5757
testBaseLine(output);
58-
});
58+
}, 15000);
5959

6060
it("runs with database_path var", async () => {
6161
const state = await runTerraformApply(import.meta.dir, {
6262
agent_id: "foo",
6363
database_path: ".config/filebrowser.db",
6464
});
6565

66-
const output = await await executeScriptInContainer(
66+
const output = await executeScriptInContainer(
6767
state,
6868
"alpine/curl",
6969
"sh",
7070
"apk add bash",
7171
);
7272

7373
testBaseLine(output);
74-
});
74+
}, 15000);
7575

7676
it("runs with folder var", async () => {
7777
const state = await runTerraformApply(import.meta.dir, {
7878
agent_id: "foo",
7979
folder: "/home/coder/project",
8080
});
81-
const output = await await executeScriptInContainer(
81+
const output = await executeScriptInContainer(
8282
state,
8383
"alpine/curl",
8484
"sh",
8585
"apk add bash",
8686
);
87-
});
87+
88+
}, 15000);
8889

8990
it("runs with subdomain=false", async () => {
9091
const state = await runTerraformApply(import.meta.dir, {
@@ -93,13 +94,13 @@ describe("filebrowser", async () => {
9394
subdomain: false,
9495
});
9596

96-
const output = await await executeScriptInContainer(
97+
const output = await executeScriptInContainer(
9798
state,
9899
"alpine/curl",
99100
"sh",
100101
"apk add bash",
101102
);
102103

103104
testBaseLine(output);
104-
});
105+
}, 15000);
105106
});

registry/coder/modules/filebrowser/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ resource "coder_script" "filebrowser" {
9797
LOG_PATH : var.log_path,
9898
PORT : var.port,
9999
FOLDER : var.folder,
100-
LOG_PATH : var.log_path,
101100
DB_PATH : var.database_path,
102101
SUBDOMAIN : var.subdomain,
103102
SERVER_BASE_PATH : local.server_base_path
@@ -128,3 +127,4 @@ locals {
128127
url = "http://localhost:${var.port}${local.server_base_path}"
129128
healthcheck_url = "http://localhost:${var.port}${local.server_base_path}/health"
130129
}
130+

registry/coder/modules/filebrowser/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export FB_DATABASE="${DB_PATH}"
2525
# Check if filebrowser db exists
2626
if [[ ! -f "${DB_PATH}" ]]; then
2727
filebrowser config init 2>&1 | tee -a ${LOG_PATH}
28-
filebrowser users add admin "" --perm.admin=true --viewMode=mosaic 2>&1 | tee -a ${LOG_PATH}
28+
filebrowser users add admin "coderPASSWORD" --perm.admin=true --viewMode=mosaic 2>&1 | tee -a ${LOG_PATH}
2929
fi
3030

3131
filebrowser config set --baseurl=${SERVER_BASE_PATH} --port=${PORT} --auth.method=noauth --root=$ROOT_DIR 2>&1 | tee -a ${LOG_PATH}

0 commit comments

Comments
 (0)