(t *testing.T)
| 150 | } |
| 151 | |
| 152 | func TestLoadProject_WithProfiles(t *testing.T) { |
| 153 | tmpDir := t.TempDir() |
| 154 | composeFile := filepath.Join(tmpDir, "compose.yaml") |
| 155 | composeContent := ` |
| 156 | services: |
| 157 | web: |
| 158 | image: nginx:latest |
| 159 | debug: |
| 160 | image: busybox:latest |
| 161 | profiles: ["debug"] |
| 162 | ` |
| 163 | err := os.WriteFile(composeFile, []byte(composeContent), 0o644) |
| 164 | assert.NilError(t, err) |
| 165 | |
| 166 | service, err := NewComposeService(nil) |
| 167 | assert.NilError(t, err) |
| 168 | |
| 169 | // Without debug profile |
| 170 | t.Run("WithoutProfile", func(t *testing.T) { |
| 171 | project, err := service.LoadProject(t.Context(), api.ProjectLoadOptions{ |
| 172 | ConfigPaths: []string{composeFile}, |
| 173 | }) |
| 174 | assert.NilError(t, err) |
| 175 | assert.Check(t, is.Len(project.Services, 1)) |
| 176 | assert.Check(t, is.Contains(project.Services, "web")) |
| 177 | }) |
| 178 | |
| 179 | // With debug profile |
| 180 | t.Run("WithProfile", func(t *testing.T) { |
| 181 | project, err := service.LoadProject(t.Context(), api.ProjectLoadOptions{ |
| 182 | ConfigPaths: []string{composeFile}, |
| 183 | Profiles: []string{"debug"}, |
| 184 | }) |
| 185 | assert.NilError(t, err) |
| 186 | assert.Check(t, is.Len(project.Services, 2)) |
| 187 | assert.Check(t, is.Contains(project.Services, "web")) |
| 188 | assert.Check(t, is.Contains(project.Services, "debug")) |
| 189 | }) |
| 190 | } |
| 191 | |
| 192 | func TestLoadProject_WithLoadListeners(t *testing.T) { |
| 193 | tmpDir := t.TempDir() |
nothing calls this directly
no test coverage detected