Skip to content

Commit 9c8f634

Browse files
committed
Updated tests to match all the new dockerfile options
1 parent 84d8c4b commit 9c8f634

File tree

3 files changed

+30
-14
lines changed

3 files changed

+30
-14
lines changed

pkg/agentfs/detection_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func TestDetectProjectType(t *testing.T) {
5252
t.Fatal(err)
5353
}
5454
},
55-
expected: ProjectTypePythonPip,
55+
expected: ProjectTypePythonPoetry,
5656
},
5757
{
5858
name: "Python Pipenv project with Pipfile.lock",
@@ -61,7 +61,7 @@ func TestDetectProjectType(t *testing.T) {
6161
t.Fatal(err)
6262
}
6363
},
64-
expected: ProjectTypePythonPip,
64+
expected: ProjectTypePythonPipenv,
6565
},
6666
{
6767
name: "Python PDM project with pdm.lock",
@@ -70,7 +70,7 @@ func TestDetectProjectType(t *testing.T) {
7070
t.Fatal(err)
7171
}
7272
},
73-
expected: ProjectTypePythonPip,
73+
expected: ProjectTypePythonPDM,
7474
},
7575
{
7676
name: "Python pip project with requirements.txt",
@@ -91,7 +91,7 @@ version = "0.1.0"`
9191
t.Fatal(err)
9292
}
9393
},
94-
expected: ProjectTypePythonPip,
94+
expected: ProjectTypePythonPoetry,
9595
},
9696
{
9797
name: "Python PDM project with pyproject.toml",
@@ -102,7 +102,7 @@ version = "2.0.0"`
102102
t.Fatal(err)
103103
}
104104
},
105-
expected: ProjectTypePythonPip,
105+
expected: ProjectTypePythonPDM,
106106
},
107107
{
108108
name: "Python Hatch project with pyproject.toml",
@@ -113,7 +113,7 @@ version = "1.0.0"`
113113
t.Fatal(err)
114114
}
115115
},
116-
expected: ProjectTypePythonPip,
116+
expected: ProjectTypePythonHatch,
117117
},
118118
{
119119
name: "Python UV project with tool.uv in pyproject.toml",
@@ -183,7 +183,7 @@ version = "0.1.0"`
183183
t.Fatal(err)
184184
}
185185
},
186-
expected: ProjectTypePythonPip,
186+
expected: ProjectTypePythonPoetry,
187187
},
188188
{
189189
name: "Unknown project type",

pkg/agentfs/docker_test.go

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,28 @@ import (
66

77
func TestLoadDockerFiles(t *testing.T) {
88
expectedFiles := []string{
9-
"examples/node.Dockerfile",
10-
"examples/node.dockerignore",
9+
"examples/node.npm.Dockerfile",
10+
"examples/node.npm.dockerignore",
11+
"examples/node.pnpm.Dockerfile",
12+
"examples/node.pnpm.dockerignore",
13+
"examples/node.yarn.Dockerfile",
14+
"examples/node.yarn.dockerignore",
15+
"examples/node.yarn-berry.Dockerfile",
16+
"examples/node.yarn-berry.dockerignore",
17+
"examples/node.bun.Dockerfile",
18+
"examples/node.bun.dockerignore",
1119
"examples/python.pip.Dockerfile",
1220
"examples/python.pip.dockerignore",
1321
"examples/python.uv.Dockerfile",
1422
"examples/python.uv.dockerignore",
23+
"examples/python.poetry.Dockerfile",
24+
"examples/python.poetry.dockerignore",
25+
"examples/python.pipenv.Dockerfile",
26+
"examples/python.pipenv.dockerignore",
27+
"examples/python.pdm.Dockerfile",
28+
"examples/python.pdm.dockerignore",
29+
"examples/python.hatch.Dockerfile",
30+
"examples/python.hatch.dockerignore",
1531
}
1632

1733
for _, file := range expectedFiles {

pkg/agentfs/sdk_version_check_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ dependencies = ["livekit-agents>=1.2.5,<2"]`,
7878
},
7979
{
8080
name: "Python Pipfile with valid version",
81-
projectType: ProjectTypePythonPip,
81+
projectType: ProjectTypePythonPipenv,
8282
setupFiles: map[string]string{
8383
"Pipfile": `[packages]
8484
livekit-agents = ">=1.0.0"`,
@@ -126,7 +126,7 @@ livekit-agents = ">=1.0.0"`,
126126
},
127127
{
128128
name: "Python poetry.lock with valid version",
129-
projectType: ProjectTypePythonPip,
129+
projectType: ProjectTypePythonPoetry,
130130
setupFiles: map[string]string{
131131
"poetry.lock": `[[package]]
132132
name = "livekit-agents"
@@ -287,9 +287,9 @@ func TestDetectProjectFiles(t *testing.T) {
287287
projectType ProjectType
288288
expected int // expected number of files
289289
}{
290-
{ProjectTypePythonPip, 3}, // requirements.txt, pyproject.toml, poetry.lock
291-
{ProjectTypePythonUV, 3}, // same as pip
292-
{ProjectTypeNodeNPM, 2}, // package.json, package-lock.json
290+
{ProjectTypePythonPip, 2}, // requirements.txt, pyproject.toml
291+
{ProjectTypePythonUV, 2}, // pyproject.toml, requirements.txt (uv.lock not in test files)
292+
{ProjectTypeNodeNPM, 2}, // package.json, package-lock.json
293293
}
294294

295295
for _, tt := range tests {

0 commit comments

Comments
 (0)