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

Function TestValidateEngineMCPSessionTimeout

pkg/workflow/engine_validation_test.go:635–736  ·  view source on GitHub ↗

TestValidateEngineMCPSessionTimeout tests the validateEngineMCPSessionTimeout function.

(t *testing.T)

Source from the content-addressed store, hash-verified

633
634// TestValidateEngineMCPSessionTimeout tests the validateEngineMCPSessionTimeout function.
635func TestValidateEngineMCPSessionTimeout(t *testing.T) {
636 tests := []struct {
637 name string
638 workflow *WorkflowData
639 expectError bool
640 errorSubstr string
641 }{
642 {
643 name: "nil workflow data",
644 workflow: nil,
645 expectError: false,
646 },
647 {
648 name: "nil engine config",
649 workflow: &WorkflowData{},
650 expectError: false,
651 },
652 {
653 name: "empty session timeout - no error",
654 workflow: &WorkflowData{
655 EngineConfig: &EngineConfig{ID: "copilot"},
656 },
657 expectError: false,
658 },
659 {
660 name: "valid duration 4h",
661 workflow: &WorkflowData{
662 EngineConfig: &EngineConfig{ID: "copilot", MCPSessionTimeout: "4h"},
663 },
664 expectError: false,
665 },
666 {
667 name: "valid duration 30m",
668 workflow: &WorkflowData{
669 EngineConfig: &EngineConfig{ID: "copilot", MCPSessionTimeout: "30m"},
670 },
671 expectError: false,
672 },
673 {
674 name: "valid duration 12h",
675 workflow: &WorkflowData{
676 EngineConfig: &EngineConfig{ID: "copilot", MCPSessionTimeout: "12h"},
677 },
678 expectError: false,
679 },
680 {
681 name: "valid duration 5m (minimum)",
682 workflow: &WorkflowData{
683 EngineConfig: &EngineConfig{ID: "copilot", MCPSessionTimeout: "5m"},
684 },
685 expectError: false,
686 },
687 {
688 name: "invalid duration string",
689 workflow: &WorkflowData{
690 EngineConfig: &EngineConfig{ID: "copilot", MCPSessionTimeout: "2hours"},
691 },
692 expectError: true,

Callers

nothing calls this directly

Calls 4

NewCompilerFunction · 0.85
RunMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected