Skip to content

Refactor testCRUDAcl to Separated Case to Improve the Test Experience - #7705

Merged
yadvr merged 1 commit into
apache:mainfrom
Codegass:refactor-testCRUDAcl
Nov 3, 2023
Merged

yadvr merged 1 commit into
apache:mainfrom
Codegass:refactor-testCRUDAcl

Conversation

@Codegass

@Codegass Codegass commented Jun 29, 2023

Copy link
Copy Markdown
Contributor

Description

This PR refactors the case testCRUDAcl.

Fix #6665

  • Extracted shared ACL setup logic into a private helper method, setupAcl().
  • Split original testCRUDAcl into two separate tests: testCRUDAclReadAll and testCRUDAclReadOne.
  • Each test case now represents a unique scenario for better readability and maintainability.
  • Replaced assertTrue(false) with fail() in catch blocks for better test failure indication.

These changes aim to enhance the clarity and maintainability of the test suite, and ensure each test case checks only one scenario.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Screenshots (if appropriate):

How Has This Been Tested?

The local cluster environment (KVM, UBUNTU 18.04) runs the test suite.

- Extracted shared ACL setup logic into a private helper method, setupAcl().
- Split original testCRUDAcl into two separate tests: testCRUDAclReadAll and testCRUDAclReadOne.
- Each test case now represents a unique scenario for better readability and maintainability.
- Replaced assertTrue(false) with fail() in catch blocks for better test failure indication.

These changes aim to enhance the clarity and maintainability of the test suite, and ensure each test case checks only one scenario.
@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland a [SF] 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
Copy Markdown

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

@codecov

codecov Bot commented Jul 3, 2023

Copy link
Copy Markdown

Codecov Report

Merging #7705 (92f6aa5) into main (5975ea8) will increase coverage by 14.90%.
Report is 237 commits behind head on main.
The diff coverage is n/a.

@@              Coverage Diff              @@
##               main    #7705       +/-   ##
=============================================
+ Coverage     13.37%   28.28%   +14.90%     
- Complexity     9320    29706    +20386     
=============================================
  Files          2740     5100     +2360     
  Lines        258249   385702   +127453     
  Branches      40235    63778    +23543     
=============================================
+ Hits          34537   109086    +74549     
- Misses       219354   261739    +42385     
- Partials       4358    14877    +10519     
Flag Coverage Δ
simulator-marvin-tests 25.19% <ø> (?)
uitests 4.86% <ø> (?)
unit-tests 14.50% <ø> (?)

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

see 3667 files with indirect coverage changes

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

@DaanHoogland DaanHoogland left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

looks good, but I just noticed this code is testing a no longer valid plugin. We can merge for my part however, for future development.

@DaanHoogland

Copy link
Copy Markdown
Contributor

@Pearl1594 @nvazquez , Can you assess if still is usefull in further development?

@yadvr
yadvr merged commit b2938c0 into apache:main Nov 3, 2023
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Nov 8, 2023
- Extracted shared ACL setup logic into a private helper method, setupAcl().
- Split original testCRUDAcl into two separate tests: testCRUDAclReadAll and testCRUDAclReadOne.
- Each test case now represents a unique scenario for better readability and maintainability.
- Replaced assertTrue(false) with fail() in catch blocks for better test failure indication.

These changes aim to enhance the clarity and maintainability of the test suite, and ensure each test case checks only one scenario.
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.

Refactor testCRUDAcl to improve the test experience

5 participants