Refactor Makefile and enhance disk/memory eviction tests
- Updated the 'bench' target in the Makefile to run all benchmarks for MemoryFS and DiskFS, improving clarity and coverage. - Added explicit post-eviction consistency checks in DiskFS tests to ensure on-disk files are removed after eviction. - Introduced new benchmarks for memory eviction strategies under pressure, enhancing test coverage for memory management. - Improved error handling in benchmark tests for both disk and memory file systems, ensuring robustness during performance evaluations. - Refactored key generation in tests for consistency and clarity.
This commit is contained in:
@@ -26,12 +26,12 @@ deps: ## Download dependencies
|
||||
clean: ## Remove build artifacts and test cache
|
||||
@rm -rf bin/ dist/ *.test coverage.out steamcache2
|
||||
|
||||
bench: deps ## Run benchmarks (with timer hygiene + allocs; optional in CI)
|
||||
@echo "Running key benchmarks (use -benchmem for more)..."
|
||||
@go test -bench=BenchmarkMemoryFS_CreateOpen -benchmem -run=^$ ./vfs/memory
|
||||
@go test -bench=BenchmarkDiskFS_CreateOpen -benchmem -run=^$ ./vfs/disk
|
||||
@go test -bench=BenchmarkEvictionUnderPressure -benchmem -run=^$ ./vfs/memory
|
||||
@echo "Bench done. Add -bench=. for all."
|
||||
bench: deps ## Run all benchmarks (MemoryFS + DiskFS variants, including all eviction strategies)
|
||||
@echo "Running MemoryFS benchmarks..."
|
||||
@go test -bench=. -benchmem -run=^$ -benchtime=1s ./vfs/memory
|
||||
@echo "Running DiskFS benchmarks..."
|
||||
@go test -bench=. -benchmem -run=^$ -benchtime=1s ./vfs/disk
|
||||
@echo "Bench done."
|
||||
|
||||
help: ## Show this help message
|
||||
@echo steamcache2 Makefile
|
||||
|
||||
Reference in New Issue
Block a user