From 3ebc4a7016c53d9a3cc752a016c6f540825bc4bb Mon Sep 17 00:00:00 2001 From: Yiian Chen <115157724+Aoitok@users.noreply.github.com> Date: Sun, 9 Mar 2025 21:09:20 +0800 Subject: [PATCH] Add Notation to TestGetCacheHitStates in pkg/ddc/alluxio/cache_test.go. Signed-off-by: Yiian Chen <115157724+Aoitok@users.noreply.github.com> --- pkg/ddc/alluxio/cache_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkg/ddc/alluxio/cache_test.go b/pkg/ddc/alluxio/cache_test.go index 2a1bb73a097..32ec9eae433 100644 --- a/pkg/ddc/alluxio/cache_test.go +++ b/pkg/ddc/alluxio/cache_test.go @@ -159,6 +159,17 @@ func TestQueryCacheStatus(t *testing.T) { }) } +// TestGetCacheHitStates verifies that the GetCacheHitStates method of the AlluxioEngine +// correctly extracts and maps the cache hit metrics from the engine's report. +// It overrides the GetReportMetrics method to return a controlled report, then asserts that +// the returned cache hit state contains the expected values for both local cache hits (bytesReadLocal) +// and unified file system hits (bytesReadUfsAll), ensuring correct metric parsing. +// +// Parameters: +// - t (*testing.T): The testing context used for running and reporting the test. +// +// Returns: +// - None: This test function does not return a value but uses assertions to verify correctness. func TestGetCacheHitStates(t *testing.T) { Convey("Test GetCacheHitStates ", t, func() { Convey("with data ", func() {