Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .dagger/debugger.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func (p *PipelineDagger) DebugUTIssues(
return fmt.Errorf("debug UT failed: %w", err)
}
if strings.TrimSpace(suggestionDiff) == "" {
return fmt.Errorf("no suggestions found")
return nil
}

fmt.Printf("Raw diff content:\n%s\n", suggestionDiff)
Expand Down
20 changes: 19 additions & 1 deletion .dagger/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,21 @@ func (p *PipelineDagger) Build(
return p.Frontend.Build()
}

func (p *PipelineDagger) RunTests(
ctx context.Context,
) (string, error) {
return p.Frontend.UnitTest(ctx)
}

func (p *PipelineDagger) RunTestsWithDebug(
ctx context.Context,
// The model to use to debug debug tests
// +optional
model string,
) (string, error) {
return p.DebugUT(ctx, model)
}

// Run and debug the unit tests
func (p *PipelineDagger) Check(
ctx context.Context,
Expand All @@ -54,7 +69,10 @@ func (p *PipelineDagger) Check(
model string,
) error {
err := p.DebugUTIssues(ctx, githubToken, commit, model)
return fmt.Errorf("Unit tests failed, attempting to debug %v", err)
if err != nil {
return fmt.Errorf("Unit tests failed, attempting to debug %v", err)
}
return nil
}

// Publish the built image to a container registry
Expand Down
5 changes: 4 additions & 1 deletion .dagger/prompts/fix_test.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@
- Be sure to always write your changes to the workspace
- Always run test after writing changes to the workspace
- If the test fails, run reset so you can try again with a clean workspace
- Do not done until the unit test pass.
- Do not done until the unit test pass.

## Pioritize:
- Make sure the change exist on the pull_request
2 changes: 1 addition & 1 deletion website/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const App = () => {
<ThemeProvider theme={createTheme()}>
<CssBaseline />
<Container maxWidth='lg'>
<Header title='Crawler System Testing 2' sections={sections} />
<Header title='Crawler System Testing 1' sections={sections} />
<main>
{mainFeaturedPost.map((post, idx) => (
<MainFeaturedPost key={idx} post={post} />
Expand Down
6 changes: 5 additions & 1 deletion website/src/App.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ import App from "./App";
test("renders Crawler System Testing header", () => {
render(<App />);
const headerElement = screen.getByRole("heading", {
name: /Crawler System Testing 3/i,
name: /Crawler System Testing 1/i,
});

if (headerElement) {
console.log("Test passed: Header element found");
}
expect(headerElement).toBeInTheDocument();
});