(t *testing.T)
| 124 | } |
| 125 | |
| 126 | func TestCodexEngineWithVersion(t *testing.T) { |
| 127 | engine := NewCodexEngine() |
| 128 | |
| 129 | // Test installation steps without version (should use pinned default version) |
| 130 | stepsNoVersion := engine.GetInstallationSteps(&WorkflowData{}) |
| 131 | foundNoVersionInstall := false |
| 132 | expectedPackage := fmt.Sprintf("@openai/codex@%s", constants.DefaultCodexVersion) |
| 133 | for _, step := range stepsNoVersion { |
| 134 | for _, line := range step { |
| 135 | if strings.Contains(line, "npm install") && strings.Contains(line, expectedPackage) { |
| 136 | foundNoVersionInstall = true |
| 137 | break |
| 138 | } |
| 139 | } |
| 140 | } |
| 141 | if !foundNoVersionInstall { |
| 142 | t.Errorf("Expected npm install command with @%s when no version specified", constants.DefaultCodexVersion) |
| 143 | } |
| 144 | |
| 145 | // Test installation steps with version |
| 146 | engineConfig := &EngineConfig{ |
| 147 | ID: "codex", |
| 148 | Version: "3.0.1", |
| 149 | } |
| 150 | workflowData := &WorkflowData{ |
| 151 | EngineConfig: engineConfig, |
| 152 | } |
| 153 | stepsWithVersion := engine.GetInstallationSteps(workflowData) |
| 154 | foundVersionInstall := false |
| 155 | for _, step := range stepsWithVersion { |
| 156 | for _, line := range step { |
| 157 | if strings.Contains(line, "npm install") && strings.Contains(line, "@openai/codex@3.0.1") { |
| 158 | foundVersionInstall = true |
| 159 | break |
| 160 | } |
| 161 | } |
| 162 | } |
| 163 | if !foundVersionInstall { |
| 164 | t.Error("Expected versioned npm install command with @openai/codex@3.0.1") |
| 165 | } |
| 166 | } |
| 167 | |
| 168 | func TestCodexEngineExecutionIncludesGitHubAWPrompt(t *testing.T) { |
| 169 | engine := NewCodexEngine() |
nothing calls this directly
no test coverage detected