Skip to content

Conversation

@ManishTechie
Copy link

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • The title of the PR conforms to the Toolchain Guide
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).
  • My new feature complies with the feature status guidelines.
  • I have added a brief description of why this PR is necessary and/or what this PR solves.
  • Optional. My organization is added to USERS.md.
  • Optional. For bug fixes, I've indicated what older releases this fix should be cherry-picked into (this may or may not happen depending on risk/complexity).

@ManishTechie ManishTechie requested a review from a team as a code owner April 24, 2025 19:50
@bunnyshell
Copy link

bunnyshell bot commented Apr 24, 2025

❌ Preview Environment deleted from Bunnyshell

Available commands (reply to this comment):

  • 🚀 /bns:deploy to deploy the environment

@ManishTechie ManishTechie changed the title add a unit test for updateLive function test: add a unit test for updateLive function Apr 24, 2025
@ManishTechie ManishTechie force-pushed the feature/add-unit-test-admin-cli branch from e479a7d to 7d3ca71 Compare April 24, 2025 19:56
@ManishTechie ManishTechie changed the title test: add a unit test for updateLive function test: add a unit test for argocd admin import command Apr 24, 2025
@codecov
Copy link

codecov bot commented Apr 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.07%. Comparing base (0ad3a2c) to head (381ca87).
⚠️ Report is 490 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #22782      +/-   ##
==========================================
+ Coverage   56.02%   56.07%   +0.04%     
==========================================
  Files         343      343              
  Lines       57551    57551              
==========================================
+ Hits        32242    32269      +27     
+ Misses      22653    22632      -21     
+ Partials     2656     2650       -6     

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

})
}
if kind != "" {
cm.Kind = kind
Copy link
Contributor

Choose a reason for hiding this comment

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

Hm, but we create cm as a ConfigMap, how can we override the kind?

Copy link
Author

Choose a reason for hiding this comment

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

In the updateLive function, we are checking different kinds, so I have added this override to include these lines in the code coverage.

Screenshot 2025-04-27 at 8 58 30 PM

@andrii-korotkov
Copy link
Contributor

andrii-korotkov commented Apr 27, 2025 via email

@ManishTechie
Copy link
Author

Still, this looks off. Config map already has a fixed kind IIUC.

On Sun, Apr 27, 2025 at 8:32 AM Manish Kumar @.> wrote: @.* commented on this pull request. ------------------------------ In cmd/argocd/commands/admin/backup_test.go <#22782 (comment)>: > @@ -36,6 +37,10 @@ func newBackupObject(trackingValue string, trackingLabel bool, trackingAnnotatio common.AnnotationKeyAppInstance: trackingValue, }) } + if kind != "" { + cm.Kind = kind In the updateLive function https://github.com/argoproj/argo-cd/blob/master/cmd/argocd/commands/admin/backup.go#L489, we are checking different kinds, so I have added this override to include these lines in the code coverage. Screenshot.2025-04-27.at.8.58.30.PM.png (view on web) https://github.com/user-attachments/assets/b87d9db1-6a2b-41e0-a807-6f2f34cc64a6 — Reply to this email directly, view it on GitHub <#22782 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA2VCNUOB4C52NIDP3A5VYD23T2BNAVCNFSM6AAAAAB3Z5XJHKVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDOOJXGY3TMMBUGM . You are receiving this because you commented.Message ID: @.***>

This is just a test function. We can remove the kind from it, or I can create a different test function for different types of kinds.

@ManishTechie
Copy link
Author

FYI, this PR will need more test code to increase the code coverage for the Import/Export methods.

Copy link
Member

@nitishfy nitishfy left a comment

Choose a reason for hiding this comment

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

There's already an existing PR: #22780

@nitishfy nitishfy closed this Apr 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants