Skip to content

chore: adding test coverage PodLogs & NewApplicationLogsTestCommand#14045

Closed
zhaque44 wants to merge 3 commits intoargoproj:masterfrom
zhaque44:unit-tests-13398
Closed

chore: adding test coverage PodLogs & NewApplicationLogsTestCommand#14045
zhaque44 wants to merge 3 commits intoargoproj:masterfrom
zhaque44:unit-tests-13398

Conversation

@zhaque44
Copy link
Contributor

This effort is to help fix the ArgoCD build pipelines and help remove flaky tests:

Ticket: #13398

Adding tests for the PodLogs func:

  1. TestPodLogs: This test verifies that the PodLogs function retrieves logs for a specific pod without any errors. It sets up the mocks, calls the function, and asserts that the returned logs match the expected logs.
  2. TestPodLogs_RBAC: This test validates that the PodLogs function successfully retrieves logs for a specific pod, taking into account RBAC enforcement. It sets up mocks with RBAC policies, calls the function, and asserts that the returned logs.
  3. TestPodLogs_Cancellation: This test verifies that the PodLogs function successfully retrieves logs for a specific pod and ensures that the logs are received without any errors.
  4. TestPodLogs_CancellationError: This test validates that the PodLogs function handles the scenario where there is an error while retrieving the logs.
    Note on DCO:

If the DCO action in the integration test fails, one or more of your commits are not signed off. Please click on the Details link next to the DCO action for instructions on how to resolve this.

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.
  • Optional. My organization is added to USERS.md.
  • 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.

Please see Contribution FAQs if you have questions about your pull-request.

…3398

Signed-off-by: zhaque44 <haque.zubair@gmail.com>
@codecov
Copy link

codecov bot commented Jun 14, 2023

Codecov Report

Patch coverage: 80.00% and project coverage change: +0.12 🎉

Comparison is base (f63b856) 49.57% compared to head (d640f54) 49.69%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #14045      +/-   ##
==========================================
+ Coverage   49.57%   49.69%   +0.12%     
==========================================
  Files         256      256              
  Lines       43920    43941      +21     
==========================================
+ Hits        21773    21837      +64     
+ Misses      19985    19940      -45     
- Partials     2162     2164       +2     
Impacted Files Coverage Δ
server/application/application.go 51.39% <78.26%> (+1.80%) ⬆️
server/server.go 55.62% <100.00%> (+0.04%) ⬆️

... and 3 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

crenshaw-dev and others added 2 commits June 16, 2023 09:31
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
@zhaque44
Copy link
Contributor Author

closing this PR due to the fact that we have most likely uncovered the underlying issue

@zhaque44 zhaque44 closed this Jul 10, 2023
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.

2 participants