Skip to content

Commit 4702bb7

Browse files
committed
pass path to checker
Signed-off-by: kpenfound <kyle@dagger.io>
1 parent 3a57b6a commit 4702bb7

File tree

5 files changed

+16
-7
lines changed

5 files changed

+16
-7
lines changed

.dagger/debugger.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ func (g *Greetings) DebugTests(
2323
ws := dag.Workspace(
2424
g.Source,
2525
g.Backend.AsWorkspaceCheckable(),
26+
".",
2627
)
2728
env := dag.Env().
2829
WithWorkspaceInput("workspace", ws, "workspace to read, write, and test code").
@@ -41,9 +42,10 @@ func (g *Greetings) DebugTests(
4142
ws := dag.Workspace(
4243
g.Source,
4344
g.Frontend.AsWorkspaceCheckable(),
45+
"website",
4446
)
4547
env := dag.Env().
46-
WithWorkspaceInput("workspace", ws, "workspace to read, write, and test code. Pass website subdirectory to checkDirectory").
48+
WithWorkspaceInput("workspace", ws, "workspace to read, write, and test code").
4749
WithWorkspaceOutput("fixed", "workspace with fixed tests")
4850
return dag.LLM(dagger.LLMOpts{Model: model}).
4951
WithEnv(env).

.dagger/develop.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ func (g *Greetings) Develop(
2424
g.Source,
2525
// FIXME: no great way to determine which checker without submodule or self calls
2626
g.Backend.AsWorkspaceCheckable(),
27+
".",
2728
)
2829

2930
env := dag.Env().
@@ -117,6 +118,7 @@ func (g *Greetings) DevelopFeedback(
117118
source,
118119
// FIXME: no great way to determine which checker without submodule or self calls
119120
g.Backend.AsWorkspaceCheckable(),
121+
".",
120122
)
121123

122124
env := dag.Env().

.dagger/review.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ func (g *Greetings) DevelopReview(
2828
source,
2929
// FIXME: no great way to determine which checker without submodule or self calls
3030
g.Backend.AsWorkspaceCheckable(),
31+
".",
3132
)
3233

3334
env := dag.Env().

.dagger/workspace/main.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ type Checkable interface {
1616

1717
// Place to do work and check it
1818
type Workspace struct {
19-
Work *dagger.Directory
19+
Work *dagger.Directory
20+
CheckDirectory string
2021
// +private
2122
Start *dagger.Directory
2223
// +private
@@ -28,11 +29,14 @@ func New(
2829
source *dagger.Directory,
2930
// Checker to use for testing
3031
checker Checkable,
32+
// Path to execute checker on
33+
checkDirectory string,
3134
) *Workspace {
3235
return &Workspace{
33-
Start: source,
34-
Work: source,
35-
Checker: checker,
36+
Start: source,
37+
Work: source,
38+
Checker: checker,
39+
CheckDirectory: checkDirectory,
3640
}
3741
}
3842

@@ -76,7 +80,7 @@ func (w *Workspace) Tree(ctx context.Context) (string, error) {
7680

7781
// Run the tests in the workspace
7882
func (w *Workspace) Check(ctx context.Context) (string, error) {
79-
return w.Checker.CheckDirectory(ctx, w.Work)
83+
return w.Checker.CheckDirectory(ctx, w.Work.Directory(w.CheckDirectory))
8084
}
8185

8286
// Show the changes made to the workspace so far in unified diff format

dagger.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "greetings",
3-
"engineVersion": "v0.18.12",
3+
"engineVersion": "v0.18.16",
44
"sdk": {
55
"source": "go"
66
},

0 commit comments

Comments
 (0)