MCPcopy Create free account
hub / github.com/github/gh-aw / TestValidateEngineMCPToolTimeout

Function TestValidateEngineMCPToolTimeout

pkg/workflow/engine_validation_test.go:739–856  ·  view source on GitHub ↗

TestValidateEngineMCPToolTimeout tests the validateEngineMCPToolTimeout function.

(t *testing.T)

Source from the content-addressed store, hash-verified

737
738// TestValidateEngineMCPToolTimeout tests the validateEngineMCPToolTimeout function.
739func TestValidateEngineMCPToolTimeout(t *testing.T) {
740 tests := []struct {
741 name string
742 workflow *WorkflowData
743 expectError bool
744 errorSubstr string
745 }{
746 {
747 name: "nil workflow data",
748 workflow: nil,
749 expectError: false,
750 },
751 {
752 name: "nil engine config",
753 workflow: &WorkflowData{},
754 expectError: false,
755 },
756 {
757 name: "empty tool timeout - no error",
758 workflow: &WorkflowData{
759 EngineConfig: &EngineConfig{ID: "copilot"},
760 },
761 expectError: false,
762 },
763 {
764 name: "valid duration 2m",
765 workflow: &WorkflowData{
766 EngineConfig: &EngineConfig{ID: "copilot", MCPToolTimeout: "2m"},
767 },
768 expectError: false,
769 },
770 {
771 name: "valid duration 30s",
772 workflow: &WorkflowData{
773 EngineConfig: &EngineConfig{ID: "copilot", MCPToolTimeout: "30s"},
774 },
775 expectError: false,
776 },
777 {
778 name: "valid duration 10s (minimum)",
779 workflow: &WorkflowData{
780 EngineConfig: &EngineConfig{ID: "copilot", MCPToolTimeout: "10s"},
781 },
782 expectError: false,
783 },
784 {
785 name: "valid duration 600s (maximum)",
786 workflow: &WorkflowData{
787 EngineConfig: &EngineConfig{ID: "copilot", MCPToolTimeout: "600s"},
788 },
789 expectError: false,
790 },
791 {
792 name: "valid duration 10m (maximum)",
793 workflow: &WorkflowData{
794 EngineConfig: &EngineConfig{ID: "copilot", MCPToolTimeout: "10m"},
795 },
796 expectError: false,

Callers

nothing calls this directly

Calls 4

NewCompilerFunction · 0.85
RunMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected