Skip to content

Commit d2e637b

Browse files
This PR is to add comments to TestJuiceFSEngine_queryCacheStatus in pkg/ddc/juicefs/cache_test.go. (#5085)
* Add Notation to TestJuiceFSEngine_queryCacheStatus in pkg/ddc/juicefs/cache_test.go Signed-off-by: ScarletDream <2863009812@qq.com> * Go fmt pkg/ddc/juicefs/cache_test.go Signed-off-by: cheyang <cheyang@163.com> --------- Signed-off-by: ScarletDream <2863009812@qq.com> Signed-off-by: cheyang <cheyang@163.com> Co-authored-by: cheyang <cheyang@163.com>
1 parent fcd1b45 commit d2e637b

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

pkg/ddc/juicefs/cache_test.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,24 @@ import (
3333
"github.com/fluid-cloudnative/fluid/pkg/utils/fake"
3434
)
3535

36+
// TestJuiceFSEngine_queryCacheStatus tests the queryCacheStatus method of JuiceFSEngine
37+
//
38+
// The test is divided into two scenarios:
39+
// 1. queryCacheStatus success case:
40+
// - Creates a mock JuiceFSRuntime environment
41+
// - Mocks various engine methods:
42+
// - GetRunningPodsOfDaemonset to return mock pods
43+
// - GetPodMetrics to return mock metrics
44+
// - GetRunningPodsOfStatefulSet to return mock pods
45+
// - GetEdition to return "enterprise"
46+
// - Verifies the returned cacheStates matches expected values
47+
//
48+
// 2. queryCacheStatus with tiered store case:
49+
// - Similar setup but with tiered store configuration
50+
// - Verifies different expected cacheStates values
51+
//
52+
// The test uses goconvey framework for BDD-style testing
53+
// Each scenario checks both error cases and the correctness of returned cache states
3654
func TestJuiceFSEngine_queryCacheStatus(t *testing.T) {
3755
Convey("Test queryCacheStatus ", t, func() {
3856
Convey("queryCacheStatus success", func() {

0 commit comments

Comments
 (0)