- Set up cobra CLI with all commands (backup, restore, prune, verify, fetch) - Integrate uber/fx for dependency injection and lifecycle management - Add globals package with build-time variables (Version, Commit) - Implement config loading from YAML with validation - Create core data models (FileInfo, ChunkInfo, BlobInfo, Snapshot) - Add Makefile with build, test, lint, and clean targets - Include minimal test suite for compilation verification - Update documentation with --quick flag for verify command - Fix markdown numbering in implementation TODO
34 lines
829 B
Go
34 lines
829 B
Go
package cli
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
// TestCLIEntry ensures the CLI can be imported and basic initialization works
|
|
func TestCLIEntry(t *testing.T) {
|
|
// This test primarily serves as a compilation test
|
|
// to ensure all imports resolve correctly
|
|
cmd := NewRootCommand()
|
|
if cmd == nil {
|
|
t.Fatal("NewRootCommand() returned nil")
|
|
}
|
|
|
|
if cmd.Use != "vaultik" {
|
|
t.Errorf("Expected command use to be 'vaultik', got '%s'", cmd.Use)
|
|
}
|
|
|
|
// Verify all subcommands are registered
|
|
expectedCommands := []string{"backup", "restore", "prune", "verify", "fetch"}
|
|
for _, expected := range expectedCommands {
|
|
found := false
|
|
for _, cmd := range cmd.Commands() {
|
|
if cmd.Use == expected || cmd.Name() == expected {
|
|
found = true
|
|
break
|
|
}
|
|
}
|
|
if !found {
|
|
t.Errorf("Expected command '%s' not found", expected)
|
|
}
|
|
}
|
|
} |