Add comprehensive test coverage for core functionalities

This commit introduces test cases for the API, archive, store, and filesystem functionalities, as well as a functional test for a full workflow. It ensures robust testing for snapshot operations, archiving, and blob management, significantly improving reliability.
This commit is contained in:
2025-05-10 20:13:29 +03:00
parent 65b1daa52c
commit 047e8d2df0
20 changed files with 3623 additions and 49 deletions

View File

@ -14,3 +14,38 @@ gen-proto:
--go-grpc_out=grpc --go-grpc_opt paths=source_relative \
--grpc-gateway_out=grpc --grpc-gateway_opt paths=source_relative \
./grpc/snapshot.proto
# Запуск всех тестов
test:
go test -v ./...
# Запуск модульных тестов
test-unit:
go test -v ./store/... ./hash/... ./archive/...
# Запуск интеграционных тестов
test-integration:
go test -v -tags=integration ./...
# Запуск функциональных тестов
test-functional:
go test -v -run TestFull ./...
# Запуск тестов производительности
test-performance:
go test -v -run TestPerformanceMetrics ./...
go test -v -bench=. ./...
# Запуск тестов с покрытием кода
test-coverage:
go test -v -coverprofile=coverage.out ./...
go tool cover -html=coverage.out -o coverage.html
# Запуск линтера
lint:
golangci-lint run
# Запуск всех проверок (тесты + линтер)
check: test lint
.PHONY: download-third-party gen-proto test test-unit test-integration test-functional test-performance test-coverage lint check