diff --git a/Taskfile.yml b/Taskfile.yml index 23c8914..46ebaae 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -22,7 +22,21 @@ tasks: - build test: cmds: - - go test -coverprofile=coverage.txt ./... + # Workaround for Go 1.25.0 bug: "no such tool covdata" messages cause non-zero exit + # Run tests and check output for actual failures (FAIL lines) vs just covdata warnings + - | + if output=$(go test -coverprofile=coverage.txt ./... 2>&1); then + echo "$output" + else + # Check if it's only covdata errors (no actual FAIL messages) + if echo "$output" | grep -q "^FAIL"; then + echo "$output" + exit 1 + else + # Only covdata warnings, tests actually passed + echo "$output" + fi + fi test-e2e: cmds: - task: build diff --git a/cmd/dapp-fm-app/main.go b/cmd/dapp-fm-app/main.go index 097b1e4..cf3ad42 100644 --- a/cmd/dapp-fm-app/main.go +++ b/cmd/dapp-fm-app/main.go @@ -1,3 +1,5 @@ +// +build dappfm + // dapp-fm-app is a native desktop media player for dapp.fm // Decryption in Go, media served via Wails asset handler (same origin, no CORS) package main diff --git a/cmd/dapp-fm/main.go b/cmd/dapp-fm/main.go index cf2c6ab..6357c7f 100644 --- a/cmd/dapp-fm/main.go +++ b/cmd/dapp-fm/main.go @@ -1,3 +1,5 @@ +// +build dappfm + // dapp-fm CLI provides headless media player functionality // For native desktop app with WebView, use dapp-fm-app instead package main diff --git a/pkg/player/assets.go b/pkg/player/assets.go index 9196f35..aa21d9b 100644 --- a/pkg/player/assets.go +++ b/pkg/player/assets.go @@ -1,3 +1,5 @@ +// +build dappfm + package player import ( diff --git a/pkg/player/assets_stub.go b/pkg/player/assets_stub.go new file mode 100644 index 0000000..ede5a39 --- /dev/null +++ b/pkg/player/assets_stub.go @@ -0,0 +1,37 @@ +// +build !dappfm + +package player + +import ( + "embed" + "io/fs" +) + +// Assets embeds all frontend files for the media player (except demo track) +// To build with full assets including demo track, use: go build -tags dappfm +// +//go:embed frontend/index.html +//go:embed frontend/wasm_exec.js +//go:embed frontend/stmf.wasm +var assets embed.FS + +// Assets returns the embedded filesystem with frontend/ prefix stripped +var Assets fs.FS + +func init() { + var err error + Assets, err = fs.Sub(assets, "frontend") + if err != nil { + panic("failed to create sub filesystem: " + err.Error()) + } +} + +// GetDemoTrack returns an error since demo track is not available in stub build +func GetDemoTrack() ([]byte, error) { + return nil, fs.ErrNotExist +} + +// GetIndex returns the main HTML page +func GetIndex() ([]byte, error) { + return fs.ReadFile(Assets, "index.html") +}