Coverage improvements: - pkg/build: 89.4% - pkg/release: 86.7% (from 36.7%) - pkg/container: 85.7% - pkg/php: 62.1% (from 26%) - pkg/devops: 56.7% (from 33.1%) - pkg/release/publishers: 54.7% Also: - Add GEMINI.md for Gemini agent guidance - Update .gitignore to exclude coverage files - Remove stray core.go at root - Add core go cov command for coverage reports Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
35 lines
941 B
Go
35 lines
941 B
Go
package sources
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestSourceConfig_Empty(t *testing.T) {
|
|
cfg := SourceConfig{}
|
|
assert.Empty(t, cfg.GitHubRepo)
|
|
assert.Empty(t, cfg.RegistryImage)
|
|
assert.Empty(t, cfg.CDNURL)
|
|
assert.Empty(t, cfg.ImageName)
|
|
}
|
|
|
|
func TestSourceConfig_Complete(t *testing.T) {
|
|
cfg := SourceConfig{
|
|
GitHubRepo: "owner/repo",
|
|
RegistryImage: "ghcr.io/owner/image:v1",
|
|
CDNURL: "https://cdn.example.com/images",
|
|
ImageName: "my-image-darwin-arm64.qcow2",
|
|
}
|
|
|
|
assert.Equal(t, "owner/repo", cfg.GitHubRepo)
|
|
assert.Equal(t, "ghcr.io/owner/image:v1", cfg.RegistryImage)
|
|
assert.Equal(t, "https://cdn.example.com/images", cfg.CDNURL)
|
|
assert.Equal(t, "my-image-darwin-arm64.qcow2", cfg.ImageName)
|
|
}
|
|
|
|
func TestImageSource_Interface(t *testing.T) {
|
|
// Ensure both sources implement the interface
|
|
var _ ImageSource = (*GitHubSource)(nil)
|
|
var _ ImageSource = (*CDNSource)(nil)
|
|
}
|