package tasks_test

import (
	"devops/agent/tasks"
	taskdebug "devops/agent/tasks/task_debug"
	"devops/agent/test"
	"testing"
)

// Task的日志独立处理
func TestTaskDebugRunner(t *testing.T) {
	taskDebugRunner := tasks.GetTaskRunner(taskdebug.TASK_NAME)

	req := tasks.NewRunTaskRequest("task-03", taskdebug.TASK_NAME)
	req.SetInputParams("PARAM_1", "PARAM_1_VALUE")
	req.SetInputParams("PARAM_2", "PARAM_2_VALUE")

	taskResp, err := taskDebugRunner.Run(t.Context(), req)
	if err != nil {
		t.Fatalf("failed to run task: %v", err)
	}
	t.Log(taskResp)
}

func init() {
	test.Setup()
}
