Skip to content

Add a featuregatetest package and module to share featuregate testing support #12377

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bogdandrutu
Copy link
Member

No description provided.

… support

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
Copy link

codecov bot commented Feb 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.49%. Comparing base (d97904a) to head (e83c262).
Report is 422 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12377      +/-   ##
==========================================
- Coverage   91.49%   91.49%   -0.01%     
==========================================
  Files         466      465       -1     
  Lines       25612    25610       -2     
==========================================
- Hits        23434    23432       -2     
  Misses       1774     1774              
  Partials      404      404              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

func setFeatureGateForTest(tb testing.TB, gate *featuregate.Gate, enabled bool) {
// SetGate sets the value to the given gate. Also, it installs a cleanup function to restore
// the gate to the initial value when the test is done.
func SetGate(tb testing.TB, gate *featuregate.Gate, enabled bool) {
Copy link
Member

Choose a reason for hiding this comment

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

Why do this instead of using a local registry for testing? I am a bit worried about encouraging this pattern, it modifies global state and it can be hard to reason about

Copy link
Member Author

Choose a reason for hiding this comment

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

Any example where I can see what you envision?

Copy link
Member

Choose a reason for hiding this comment

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

I was thinking about some old PR but the idea is not directly applicable here (we no longer have IsEnabled).

I guess the equivalent here for the batch sender tests modified on this PR would be to pass a boolean flag directly to newQueueBatchExporter and set that flag based on the feature gate on the code

Copy link
Contributor

github-actions bot commented Mar 5, 2025

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added Stale and removed Stale labels Mar 5, 2025
Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added Stale and removed Stale labels Mar 21, 2025
Copy link
Member

@mx-psi mx-psi left a comment

Choose a reason for hiding this comment

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

I don't see a better way of doing this and don't want to block this indefinitely, approving!

Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added Stale and removed Stale labels Apr 11, 2025
Copy link
Contributor

github-actions bot commented May 1, 2025

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added Stale and removed Stale labels May 1, 2025
@jade-guiton-dd jade-guiton-dd added the ready-to-merge Code review completed; ready to merge by maintainers label May 2, 2025
Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label May 17, 2025
@mx-psi
Copy link
Member

mx-psi commented May 19, 2025

@bogdandrutu we can merge this once the conflicts are resolved

@github-actions github-actions bot removed the Stale label May 20, 2025
Copy link
Contributor

github-actions bot commented Jun 3, 2025

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added Stale and removed Stale labels Jun 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge Code review completed; ready to merge by maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy