From 9e3328a6aaefe4bd1aa0ec3e8bf6e93d6033180b Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 20 Jul 2025 21:20:40 +0300 Subject: test: add comprehensive test suite for audio and anki packages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add tests for audio package (62.8% coverage) - OpenAI provider tests with mocking - Provider interface and fallback mechanism tests - Bulgarian text validation tests - Audio caching functionality tests - Add tests for anki package (84.8% coverage) - CSV generation tests - APKG package generation tests - Card management and formatting tests - Directory scanning and media handling tests - Add test utilities and mocks - Mock implementations for external dependencies - Test helpers for common operations - Utilities for creating test directories and files - Update Taskfile.yaml with comprehensive test targets - test: Run all tests - test-verbose: Run with verbose output - test-coverage: Run with coverage report - test-coverage-html: Generate HTML coverage report - test-race: Run with race detector - test-short: Run only short tests - test-all: Comprehensive suite with coverage and race detection - clean: Remove build artifacts and test files - Fix existing image package tests - Remove tests for non-existent methods - Update tests to match actual implementation - Skip tests requiring live OpenAI API This provides a solid foundation for ensuring code quality and catching regressions. 🤖 Generated with [opencode](https://opencode.ai) Co-Authored-By: opencode --- Taskfile.yaml | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'Taskfile.yaml') diff --git a/Taskfile.yaml b/Taskfile.yaml index 0c8c31f..f4588d1 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -8,8 +8,49 @@ tasks: cmds: - go run ./cmd/totalrecall test: + desc: Run all tests cmds: - go test ./... + + test-verbose: + desc: Run all tests with verbose output + cmds: + - go test -v ./... + + test-coverage: + desc: Run all tests with coverage report + cmds: + - go test -cover ./... + + test-coverage-html: + desc: Run all tests and generate HTML coverage report + cmds: + - go test -coverprofile=coverage.out ./... + - go tool cover -html=coverage.out -o coverage.html + - echo "Coverage report generated at coverage.html" + + test-race: + desc: Run all tests with race detector + cmds: + - go test -race ./... + + test-short: + desc: Run only short tests (skip integration tests) + cmds: + - go test -short ./... + + test-all: + desc: Run comprehensive test suite with coverage and race detection + cmds: + - echo "Running comprehensive test suite..." + - go test -v -race -cover ./... install: cmds: - go install ./cmd/totalrecall + + clean: + desc: Clean build artifacts and test coverage files + cmds: + - rm -f totalrecall + - rm -f coverage.out coverage.html + - go clean -testcache -- cgit v1.2.3