Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: added catch statement in lifecycle-operator integration tests #3233

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

UtkarshUmre
Copy link
Contributor

@UtkarshUmre UtkarshUmre commented Mar 11, 2024

Description

This issue is about adding catch statements to integration tests for improved error handling.

Fixes #2698

Checklist

  • My PR fulfills the Definition of Done of the corresponding issue and not more (or parts if the issue is separated
    into multiple PRs)
  • I used descriptive commit messages to help reviewers understand my thought process
  • I signed off all my commits according to the Developer Certificate of Origin (DCO)
    see Contribution Guide
  • My PR title is formatted according to the semantic PR conventions described in
    the Contribution Guide
  • My code follows the style guidelines of this project (golangci-lint passes, YAMLLint passes)
  • I regenerated the auto-generated docs for Helm and the CRD documentation (if applicable)
  • I have performed a self-review of my code
  • I have made corresponding changes to the documentation (if needed)
  • My changes result in all-green PR checks (first-time contributors need to ask a maintainer to approve their test runs)
  • New and existing unit and integration tests pass locally with my changes

Summary

In this pull request, I've implemented catch statements within the integration test. I've conducted thorough local testing to confirm their effectiveness in resolving the issue.

Signed-off-by: utkarsh <utkarshumre@outlook.com>
Signed-off-by: utkarsh <utkarshumre@outlook.com>
@UtkarshUmre UtkarshUmre changed the title test: added catch statement in lifecycle-operator integration tests test: added catch statement in lifecycle-operator integration tests Mar 11, 2024
UtkarshUmre and others added 8 commits March 13, 2024 08:12
Signed-off-by: utkarsh <utkarshumre@outlook.com>
Signed-off-by: utkarsh <utkarshumre@outlook.com>
Signed-off-by: UtkarshUmre <112888849+UtkarshUmre@users.noreply.github.com>
Signed-off-by: UtkarshUmre <112888849+UtkarshUmre@users.noreply.github.com>
Signed-off-by: UtkarshUmre <112888849+UtkarshUmre@users.noreply.github.com>
@UtkarshUmre UtkarshUmre marked this pull request as ready for review March 13, 2024 03:50
@UtkarshUmre UtkarshUmre requested a review from a team as a code owner March 13, 2024 03:50
Copy link

codecov bot commented Mar 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.00%. Comparing base (e048679) to head (7ca2e36).

❗ Current head 7ca2e36 differs from pull request most recent head c1944b1. Consider uploading reports for the commit c1944b1 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3233      +/-   ##
==========================================
+ Coverage   85.36%   87.00%   +1.63%     
==========================================
  Files         167      162       -5     
  Lines        7412     8647    +1235     
==========================================
+ Hits         6327     7523    +1196     
- Misses        798      832      +34     
- Partials      287      292       +5     

see 91 files with indirect coverage changes

Flag Coverage Δ
certificate-operator 69.23% <ø> (ø)
component-tests 57.48% <ø> (-1.29%) ⬇️
lifecycle-operator 86.75% <ø> (+3.28%) ⬆️
metrics-operator 88.32% <ø> (ø)
scheduler 34.74% <ø> (ø)

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

Signed-off-by: UtkarshUmre <112888849+UtkarshUmre@users.noreply.github.com>
@odubajDT
Copy link
Contributor

odubajDT commented Mar 13, 2024

Hi @UtkarshUmre , thanks for your PR. Did you check if the resources you are catching the the tests are valid things to check if the test fails? All catch blocks are the same and in some cases (for example api conversions) it does not make sense to describe app pod (because it does not exist) and as well keptn resources.

Please if possible go through each test and re-evaluate if it's needed.

Thank you!

Copy link

sonarcloud bot commented Mar 15, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@UtkarshUmre
Copy link
Contributor Author

Hey @odubajDT I've re-evaluated the catch statements & addressed the issues with api conversions. i've made the necessary corrections, Could you please review it

@@ -11,3 +11,14 @@ spec:
file: 00-install.yaml
- assert:
file: 00-assert.yaml
catch:
Copy link
Contributor

Choose a reason for hiding this comment

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

Are you sure that keptnworkloadinstance and keptnapp are needed here? AFAIK they are not created in this test (please check 00-install.yaml). Also metrics-operator is not used here

@odubajDT
Copy link
Contributor

Hey @odubajDT I've re-evaluated the catch statements & addressed the issues with api conversions. i've made the necessary corrections, Could you please review it

Hi @UtkarshUmre , thank you for the adaptations. From what I see there are still a lot of information in the catch statement that are not needed.

My tip would be: Try to go through the tests and look at the install and assert files -> from the content (what is applied to the cluster and what is checked/asserted) you should be able to see what resources make sense to be retrieved in case the test fails

@odubajDT
Copy link
Contributor

Hi @UtkarshUmre any updates on this?

@UtkarshUmre
Copy link
Contributor Author

Hey @odubajDT I'm tied up with some work at the moment, but I'll revisit the PR issues in a couple of days

@odubajDT
Copy link
Contributor

@UtkarshUmre any updates on this please?

@UtkarshUmre
Copy link
Contributor Author

@odubajDT Half of the file's done, but the rest needs another look. I'll update the PR soon.

Signed-off-by: utkarsh <utkarshumre@outlook.com>
Signed-off-by: utkarsh <utkarshumre@outlook.com>
Copy link

sonarcloud bot commented May 4, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@UtkarshUmre UtkarshUmre requested a review from odubajDT May 4, 2024 06:48
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.

Add collectors to Lifecycle Operator Integration Tests
2 participants