Skip to content

Update XenServer610WrapperTest.java#8139

Merged
yadvr merged 2 commits intoapache:mainfrom
gzhao9:refactor-146-VolumeTO
Nov 3, 2023
Merged

Update XenServer610WrapperTest.java#8139
yadvr merged 2 commits intoapache:mainfrom
gzhao9:refactor-146-VolumeTO

Conversation

@gzhao9
Copy link
Contributor

@gzhao9 gzhao9 commented Oct 24, 2023

Description

This PR addresses a problem analogous to the one presented in Issue #8088. The core of the issue is repetitive mock object creation for VolumeTO within the test suite of XenServer610WrapperTest.java. In this refactoring process, I have streamlined the mock creation process for VolumeTO to enhance code maintainability and reduce redundancy.

Proposed Changes

Aiming to provide a solution similar to what has been described for Issue #8088, I've introduced a method named MockVolumeTO(String path). This method is specifically crafted to create consistent mock objects for VolumeTO based on the supplied path.

Benefits of the Proposed Refactoring:

  • The utilization of the MockVolumeTO(String path) method greatly simplifies the test cases within XenServer610WrapperTest.java, ensuring they are more comprehensible and easier to manage.
  • Should there be a necessity in the future to modify the VolumeTO mock creation process, developers can easily implement these changes within the MockVolumeTO method, preventing the need for dispersed modifications across the test class.

Fixes: Issue similar to #8088

@codecov
Copy link

codecov bot commented Oct 25, 2023

Codecov Report

Merging #8139 (a5b5015) into main (543c54c) will increase coverage by 1.35%.
Report is 12 commits behind head on main.
The diff coverage is n/a.

@@             Coverage Diff              @@
##               main    #8139      +/-   ##
============================================
+ Coverage     28.15%   29.51%   +1.35%     
- Complexity    29181    31005    +1824     
============================================
  Files          5111     5127      +16     
  Lines        360669   364530    +3861     
  Branches      52700    54349    +1649     
============================================
+ Hits         101562   107585    +6023     
+ Misses       245113   242064    -3049     
- Partials      13994    14881     +887     
Flag Coverage Δ
simulator-marvin-tests 25.52% <ø> (+1.66%) ⬆️
uitests 4.77% <ø> (-0.02%) ⬇️
unit-tests 14.60% <ø> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 309 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

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

agree with @rohityadavcloud 's comments. otherwise ltgm

Co-authored-by: Rohit Yadav <rohityadav89@gmail.com>
@DaanHoogland
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 7513

@shwstppr shwstppr requested a review from yadvr October 26, 2023 05:07
@DaanHoogland DaanHoogland reopened this Oct 26, 2023
@yadvr yadvr merged commit 39c0706 into apache:main Nov 3, 2023
@yadvr yadvr added this to the 4.19.0.0 milestone Nov 3, 2023
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Nov 8, 2023
* Update XenServer610WrapperTest.java

* Apply suggestions from code review

Co-authored-by: Rohit Yadav <rohityadav89@gmail.com>

---------

Co-authored-by: Rohit Yadav <rohityadav89@gmail.com>
Dajeong-Park added a commit to Dajeong-Park/ablestack-cloud that referenced this pull request Nov 16, 2023
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.

4 participants