51a1a6aa82
continuous-integration/drone/push Build is passing
- Updated comments and logging messages in the worker and related files to replace "daily-run" with "auto run" for clarity and consistency. - Adjusted the `WorkerConfig` struct to reflect the new terminology in configuration settings. - Renamed functions and test cases to align with the updated terminology, enhancing code readability and maintainability. This change improves the clarity of the AI pipeline's functionality within the tender management system.
31 lines
981 B
Go
31 lines
981 B
Go
package company
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"tm/pkg/ai_summarizer"
|
|
)
|
|
|
|
func TestIsPipelineRunInProgress(t *testing.T) {
|
|
tests := []struct {
|
|
name string
|
|
report *ai_summarizer.PipelineReportResponse
|
|
want bool
|
|
}{
|
|
{name: "nil report", report: nil, want: true},
|
|
{name: "empty status", report: &ai_summarizer.PipelineReportResponse{}, want: true},
|
|
{name: "running", report: &ai_summarizer.PipelineReportResponse{Status: "running"}, want: true},
|
|
{name: "in progress", report: &ai_summarizer.PipelineReportResponse{Status: "in_progress"}, want: true},
|
|
{name: "completed", report: &ai_summarizer.PipelineReportResponse{Status: "completed"}, want: false},
|
|
{name: "failed", report: &ai_summarizer.PipelineReportResponse{Status: "failed"}, want: false},
|
|
}
|
|
|
|
for _, tt := range tests {
|
|
t.Run(tt.name, func(t *testing.T) {
|
|
if got := isPipelineRunInProgress(tt.report); got != tt.want {
|
|
t.Fatalf("isPipelineRunInProgress() = %v, want %v", got, tt.want)
|
|
}
|
|
})
|
|
}
|
|
}
|