Skip to content

Add unit test for DeleteManifest method in TencentCR adapter#22537

Merged
chlins merged 2 commits intogoharbor:mainfrom
intojhanurag:feat/tencentcr-delete-manifest-test
Nov 5, 2025
Merged

Add unit test for DeleteManifest method in TencentCR adapter#22537
chlins merged 2 commits intogoharbor:mainfrom
intojhanurag:feat/tencentcr-delete-manifest-test

Conversation

@intojhanurag
Copy link
Copy Markdown
Contributor

@intojhanurag intojhanurag commented Oct 31, 2025

This PR adds a unit test for the DeleteManifest function in the Tencent Container Registry (TCR) adapter.

Changes:

  • Introduced a mockAdapter to simulate the delete behavior without calling real Tencent Cloud APIs.
  • Added two test cases:
    1. Invalid repository format — ensures the function returns an error when the repository name doesn’t follow the <namespace>/<repo> pattern.
    2. Valid repository format — validates correct parsing of namespace and repository, and successful invocation of the mock delete method.
Screenshot 2025-10-31 193101

Signed-off-by: Anurag Ojha <aojharaj2004@gmail.com>
@intojhanurag intojhanurag force-pushed the feat/tencentcr-delete-manifest-test branch from 33ee4a3 to 0754346 Compare October 31, 2025 14:07
@codecov
Copy link
Copy Markdown

codecov Bot commented Oct 31, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.84%. Comparing base (c8c11b4) to head (a86dbff).
⚠️ Report is 593 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main   #22537       +/-   ##
===========================================
+ Coverage   45.36%   65.84%   +20.47%     
===========================================
  Files         244     1073      +829     
  Lines       13333   116079   +102746     
  Branches     2719     2931      +212     
===========================================
+ Hits         6049    76432    +70383     
- Misses       6983    35408    +28425     
- Partials      301     4239     +3938     
Flag Coverage Δ
unittests 65.84% <ø> (+20.47%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 987 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@intojhanurag
Copy link
Copy Markdown
Contributor Author

intojhanurag commented Oct 31, 2025

Hey @chlins @MinerYang, I added a test . Can you take a look if you have a moment that my approach is good to go ??

@chlins chlins added the release-note/ignore-for-release Do not include PR or Issue for release notes label Nov 3, 2025
Copy link
Copy Markdown
Member

@chlins chlins left a comment

Choose a reason for hiding this comment

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

lgtm

@chlins chlins enabled auto-merge (squash) November 3, 2025 02:31
@intojhanurag
Copy link
Copy Markdown
Contributor Author

Hey @Vad1mo , @wy65701436 , Can you take a look on this ?

Copy link
Copy Markdown
Contributor

@reasonerjt reasonerjt left a comment

Choose a reason for hiding this comment

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

LGTM thanks!

@chlins chlins merged commit 8f7e4bb into goharbor:main Nov 5, 2025
12 checks passed
Aloui-Ikram pushed a commit to Aloui-Ikram/harbor that referenced this pull request Nov 19, 2025
…r#22537)

Added test case

Signed-off-by: Anurag Ojha <aojharaj2004@gmail.com>
Signed-off-by: ikram aloui <your-email@container-registry.com>
Aloui-Ikram pushed a commit to Aloui-Ikram/harbor that referenced this pull request Nov 19, 2025
…r#22537)

Added test case

Signed-off-by: Anurag Ojha <aojharaj2004@gmail.com>
Signed-off-by: ikram aloui <your-email@container-registry.com>
Signed-off-by: Aloui-Ikram <ikram@container-registry.com>
Aloui-Ikram pushed a commit to Aloui-Ikram/harbor that referenced this pull request Nov 19, 2025
…r#22537)

Added test case

Signed-off-by: Anurag Ojha <aojharaj2004@gmail.com>
Signed-off-by: ikram aloui <your-email@container-registry.com>
Signed-off-by: Aloui-Ikram <ikram@container-registry.com>
Aloui-Ikram pushed a commit to Aloui-Ikram/harbor that referenced this pull request Nov 19, 2025
…r#22537)

Added test case

Signed-off-by: Anurag Ojha <aojharaj2004@gmail.com>
Signed-off-by: Aloui-Ikram <ikram@container-registry.com>
Aloui-Ikram pushed a commit to Aloui-Ikram/harbor that referenced this pull request Nov 19, 2025
…r#22537)

Added test case

Signed-off-by: Anurag Ojha <aojharaj2004@gmail.com>
Signed-off-by: Aloui-Ikram <ikram@container-registry.com>
Aloui-Ikram pushed a commit to Aloui-Ikram/harbor that referenced this pull request Nov 24, 2025
Signed-off-by: dulanting <dulanting@outlook.jp>
Signed-off-by: Aloui-Ikram <ikram@container-registry.com>

Add unit test for DeleteManifest method in TencentCR adapter (goharbor#22537)

Added test case

Signed-off-by: Anurag Ojha <aojharaj2004@gmail.com>
Signed-off-by: Aloui-Ikram <ikram@container-registry.com>

disable land tag in the backend storage (goharbor#22507)

According to the gc performance proposal, harbor will skip to write the tag file into the data storage since we already use the harbor database to manage the tag CRUD.
Proposal: goharbor/community#265

fixed goharbor#22405

Signed-off-by: wang yan <yan-yw.wang@broadcom.com>
Co-authored-by: wang yan <yan-yw.wang@broadcom.com>

Signed-off-by: Aloui-Ikram <ikram@container-registry.com>
vg006 pushed a commit to vg006/harbor that referenced this pull request Dec 4, 2025
…r#22537)

Added test case

Signed-off-by: Anurag Ojha <aojharaj2004@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-note/ignore-for-release Do not include PR or Issue for release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants