summaryrefslogtreecommitdiff
path: root/internal/hexaiaction/action_gotest.go
blob: db5354165e16657604ae2941a459e1dca02696c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package hexaiaction

import "context"

func init() {
	registerActionHandler(ActionGoTest, actionHandlerFunc(handleGoTestActionRequest))
}

func handleGoTestActionRequest(ctx context.Context, req actionRequest) (string, error) {
	return handleGoTestAction(ctx, req.parts, req.cfg, req.client)
}

func handleGoTestAction(ctx context.Context, parts InputParts, cfg actionConfig, client chatDoer) (string, error) {
	return runWithTimeout(ctx, timeout18s, func(cctx context.Context) (string, error) {
		return runGoTest(cctx, cfg, client, parts.Selection)
	})
}