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

Function TestEngineConfigurationWithCustomEnvVars

pkg/workflow/engine_config_test.go:786–883  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

784}
785
786func TestEngineConfigurationWithCustomEnvVars(t *testing.T) {
787 tests := []struct {
788 name string
789 engine CodingAgentEngine
790 engineConfig *EngineConfig
791 hasOutput bool
792 }{
793 {
794 name: "Claude with custom env vars",
795 engine: NewClaudeEngine(),
796 engineConfig: &EngineConfig{
797 ID: "claude",
798 Env: map[string]string{"AWS_REGION": "us-west-2", "CUSTOM_VAR": "${{ secrets.MY_SECRET }}"},
799 },
800 hasOutput: false,
801 },
802 {
803 name: "Claude with custom env vars and output",
804 engine: NewClaudeEngine(),
805 engineConfig: &EngineConfig{
806 ID: "claude",
807 Env: map[string]string{"API_ENDPOINT": "https://api.example.com", "DEBUG_MODE": "true"},
808 },
809 hasOutput: true,
810 },
811 {
812 name: "Codex with custom env vars",
813 engine: NewCodexEngine(),
814 engineConfig: &EngineConfig{
815 ID: "codex",
816 Env: map[string]string{"CUSTOM_API_KEY": "test123", "PROXY_URL": "http://proxy.example.com"},
817 },
818 hasOutput: false,
819 },
820 {
821 name: "Codex with custom env vars and output",
822 engine: NewCodexEngine(),
823 engineConfig: &EngineConfig{
824 ID: "codex",
825 Env: map[string]string{"ENVIRONMENT": "production", "LOG_LEVEL": "debug"},
826 },
827 hasOutput: true,
828 },
829 }
830
831 for _, tt := range tests {
832 t.Run(tt.name, func(t *testing.T) {
833 workflowData := &WorkflowData{
834 Name: "test-workflow",
835 EngineConfig: tt.engineConfig,
836 }
837 if tt.hasOutput {
838 workflowData.SafeOutputs = &SafeOutputsConfig{}
839 }
840 steps := tt.engine.GetExecutionSteps(workflowData, "test-log")
841
842 if len(steps) == 0 {
843 t.Fatalf("Expected at least one step, got none")

Callers

nothing calls this directly

Calls 6

NewClaudeEngineFunction · 0.85
NewCodexEngineFunction · 0.85
GetExecutionStepsMethod · 0.65
GetIDMethod · 0.65
RunMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected