Skip to content

test: add alluxio engine and transform coverage#5804

Open
hxrshxz wants to merge 1 commit intofluid-cloudnative:masterfrom
hxrshxz:test/alluxio-file-scope-5676
Open

test: add alluxio engine and transform coverage#5804
hxrshxz wants to merge 1 commit intofluid-cloudnative:masterfrom
hxrshxz:test/alluxio-file-scope-5676

Conversation

@hxrshxz
Copy link
Copy Markdown
Contributor

@hxrshxz hxrshxz commented Apr 23, 2026

Ⅰ. Describe what this PR does

Add test-only Ginkgo/Gomega coverage for the file-scoped pkg/ddc/alluxio engine and transform paths, while migrating the scoped API gateway tests to Ginkgo/Gomega.

Ⅱ. Does this pull request fix one issue?

fixes #5676

Ⅲ. List the added test cases (unit test/integration test) if any, please explain if no tests are needed.

  • migrate pkg/ddc/alluxio/api_gateway_test.go to Ginkgo/Gomega
  • add focused same-package coverage for Build and Precheck in pkg/ddc/alluxio/engine_transform_file_scope_test.go
  • add focused same-package coverage for top-level transform(...) behavior and placement defaults in pkg/ddc/alluxio/engine_transform_file_scope_test.go

Ⅳ. Describe how to verify it

  • go test ./pkg/ddc/alluxio -run '^(TestAlluxio|TestBuild|TestTransformPodMetadata|TestGetMediumTypeFromVolumeSource|TestAlluxioEngine_allocateSinglePort|TestAlluxioEngine_allocatePorts|TestTransformShortCircuit|TestTransformMaster|TestTransformWorkers|TestGenerateStaticPorts|TestGenerateNonNativeMountsInfo|TestTransformMasterProperties|TestTransformWorkerProperties|TestTransformMasterMountConfigMap|TestTransformFuseProperties|TestTransformFuse)$' -ginkgo.label-filter='pkg.ddc.alluxio.engine_transform_file_scope_test.go || pkg.ddc.alluxio.api_gateway_test.go'

Ⅴ. Special notes for reviews

N/A

Signed-off-by: Harsh <harshmastic@gmail.com>
Copilot AI review requested due to automatic review settings April 23, 2026 17:30
@fluid-e2e-bot
Copy link
Copy Markdown

fluid-e2e-bot Bot commented Apr 23, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign zwwhdls for approval by writing /assign @zwwhdls in a comment. For more information see:The Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@fluid-e2e-bot
Copy link
Copy Markdown

fluid-e2e-bot Bot commented Apr 23, 2026

Hi @hxrshxz. Thanks for your PR.

I'm waiting for a fluid-cloudnative member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the Alluxio API gateway tests to use the Ginkgo and Gomega frameworks and introduces a new test file, engine_transform_file_scope_test.go, to cover engine building, prechecking, and transformation logic. I have no feedback to provide.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.80%. Comparing base (6df6421) to head (2ecc47b).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5804      +/-   ##
==========================================
+ Coverage   58.51%   58.80%   +0.29%     
==========================================
  Files         473      478       +5     
  Lines       32283    32485     +202     
==========================================
+ Hits        18890    19103     +213     
+ Misses      11849    11825      -24     
- Partials     1544     1557      +13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Ginkgo/Gomega-based unit tests to increase coverage for pkg/ddc/alluxio, focusing on engine build/precheck behavior and file-scoped transform behavior, and migrates the API gateway tests from testify to Ginkgo/Gomega (part of the broader testing framework modernization in #5676).

Changes:

  • Add same-package Ginkgo/Gomega coverage for Build, Precheck, transformPlacementMode, and top-level transform(...) behavior in the Alluxio engine.
  • Migrate api_gateway_test.go from testing + testify/assert to Ginkgo/Gomega with table-driven specs.
  • Add focused assertions for placement defaults and key transform outputs (ports, properties, pod metadata, tiered store paths).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
pkg/ddc/alluxio/engine_transform_file_scope_test.go New Ginkgo/Gomega specs covering Build/Precheck and file-scoped transform behaviors and defaults.
pkg/ddc/alluxio/api_gateway_test.go Migrates API gateway unit tests to Ginkgo/Gomega table-driven specs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +171 to +173
Expect(value.Fuse.Args).To(HaveLen(2))
Expect(value.Fuse.Args[1]).To(ContainSubstring("max_readahead=0"))
Expect(value.Fuse.Args[1]).To(ContainSubstring("allow_other"))
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The assertions around value.Fuse.Args are brittle because the arg shape depends on the fuse image tag (via parseFuseImage + checkIfNewFuseArgVersion), not runtime.Spec.AlluxioVersion.ImageTag. If the default DefaultAlluxioFuseImage (or ALLUXIO_FUSE_IMAGE_ENV) ever moves to >= 2.8.0, value.Fuse.Args will include mount args and won’t have length 2, and Args[1] may no longer be the only place to check options. Consider explicitly setting runtime.Spec.Fuse.ImageTag to a known <2.8.0 value in this test (or relaxing the assertions to be version-agnostic by searching across the args slice).

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unify and Modernize Fluid’s Unit Testing Framework and Enhance Testing Coverage

2 participants