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: add envtest for redis standalone #748

Conversation

MathieuCesbron
Copy link
Contributor

@MathieuCesbron MathieuCesbron commented Jan 11, 2024

Description

I feel like it would be a good idea to add integration tests with EnvTest on the reconcile loop like mentioned here.

Would this feature be accepted if I make it ?

Edit: Feature accepted

Fixes #656

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • Tests have been added/modified and all tests pass.
  • Functionality/bugs have been confirmed to be unchanged or fixed.
  • I have performed a self-review of my own code.
  • Documentation has been updated or added where necessary.

Copy link

codecov bot commented Jan 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (7665d4a) 29.25% compared to head (0935e54) 29.89%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #748      +/-   ##
==========================================
+ Coverage   29.25%   29.89%   +0.64%     
==========================================
  Files          19       19              
  Lines        3241     3241              
==========================================
+ Hits          948      969      +21     
+ Misses       2258     2233      -25     
- Partials       35       39       +4     

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

@MathieuCesbron MathieuCesbron force-pushed the Add_envtest_to_rest_reconcile branch from be17e6a to 2375205 Compare January 11, 2024 13:45
@drivebyer
Copy link
Collaborator

drivebyer commented Jan 11, 2024

Actually, we use chainsaw to do some e2e test, plz see https://github.com/OT-CONTAINER-KIT/redis-operator/tree/master/tests/e2e-chainsaw/v1beta2. :)

@MathieuCesbron
Copy link
Contributor Author

MathieuCesbron commented Jan 11, 2024

So you think there is no point in doing integration test ? e2e is enough ?

I like integration tests because it's fast to run while still testing the reconcile logic in an holistic way.

@drivebyer
Copy link
Collaborator

So you think there is no point in doing integration test ? e2e is enough ?

I like integration tests because it's fast to run while still testing the reconcile logic in an holistic way.

Integration tests is nice of course.

@MathieuCesbron
Copy link
Contributor Author

Thanks for your input.

I asked because I would like to know if I should start the feature or if it's not gonna be accepted anyway.

@drivebyer
Copy link
Collaborator

drivebyer commented Jan 11, 2024

Thanks for your input.

I asked because I would like to know if I should start the feature or if it's not gonna be accepted anyway.

IMO, it's a nice feature for the operator.

cc @shubham-cmyk

@shubham-cmyk
Copy link
Member

Integration testing is great you can add that👌

@MathieuCesbron MathieuCesbron force-pushed the Add_envtest_to_rest_reconcile branch 6 times, most recently from 7579ca5 to 158cca9 Compare January 13, 2024 15:17
@MathieuCesbron MathieuCesbron force-pushed the Add_envtest_to_rest_reconcile branch 2 times, most recently from 13905ce to 79c4fb7 Compare January 14, 2024 15:20
@MathieuCesbron MathieuCesbron force-pushed the Add_envtest_to_rest_reconcile branch from 79c4fb7 to 0935e54 Compare January 14, 2024 19:55
@MathieuCesbron
Copy link
Contributor Author

MathieuCesbron commented Jan 14, 2024

I have added the setup for integration test and integration tests for redis standalone. We check that statefulset, service,... are created and that deleting the CR delete the statefulset.

I will add integration tests for the other redis (cluster, replication, sentinel) each in his own PR if you don't mind.

The code coverage is now 29.89% 🥳

@MathieuCesbron MathieuCesbron marked this pull request as ready for review January 14, 2024 20:10
@drivebyer drivebyer changed the title Add envtest config test: add envtest for redis standalone Jan 15, 2024
@drivebyer drivebyer enabled auto-merge (squash) January 15, 2024 05:34
Copy link
Collaborator

@drivebyer drivebyer left a comment

Choose a reason for hiding this comment

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

nice work!

@drivebyer drivebyer merged commit cd1e810 into OT-CONTAINER-KIT:master Jan 15, 2024
29 checks passed
mattrobinsonsre pushed a commit to mattrobinsonsre/redis-operator that referenced this pull request Jul 11, 2024
Signed-off-by: Mathieu Cesbron <[email protected]>
Signed-off-by: Matt Robinson <[email protected]>
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.

[Tracker] : Cover Testing of Operator.
3 participants