Skip to content

fix: set EnvironmentKey on evaluation requests in environment integration tests#5499

Merged
markphelps merged 1 commit into
v2from
fix/flaky-env-integration-tests
Mar 6, 2026
Merged

fix: set EnvironmentKey on evaluation requests in environment integration tests#5499
markphelps merged 1 commit into
v2from
fix/flaky-env-integration-tests

Conversation

@markphelps

Copy link
Copy Markdown
Collaborator

Summary

  • Fixed flaky environment integration tests (envs and envs/dir) caused by evaluation requests not specifying EnvironmentKey
  • Without the key, evaluations always hit the default environment — when Go's random map iteration ran "production" first, flags didn't exist there yet, causing intermittent "not found" errors

Changes

  • build/testing/integration/environments/api_test.go: Added EnvironmentKey: env to the Variant and Boolean evaluation requests so they evaluate against the correct environment being tested

Fixes #5413

…tion tests

The evaluation requests were missing EnvironmentKey, causing them to
always evaluate against the default environment. Since Go map iteration
order is random, when the "production" environment test ran before
"default", the flags didn't exist in the default environment yet,
resulting in intermittent "not found" errors.

Fixes #5413

Signed-off-by: Mark Phelps <[email protected]>
@markphelps
markphelps requested a review from a team as a code owner March 6, 2026 14:11
@markphelps markphelps added bug v2 Flipt v2 labels Mar 6, 2026
@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Mar 6, 2026
@codecov

codecov Bot commented Mar 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.40%. Comparing base (e592577) to head (280bd59).
⚠️ Report is 1 commits behind head on v2.

Additional details and impacted files
@@           Coverage Diff           @@
##               v2    #5499   +/-   ##
=======================================
  Coverage   60.40%   60.40%           
=======================================
  Files         141      141           
  Lines       13995    13995           
=======================================
  Hits         8453     8453           
  Misses       4821     4821           
  Partials      721      721           
Flag Coverage Δ
integrationtests 34.32% <ø> (ø)
unittests 51.53% <ø> (ø)

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

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@erka erka left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nice!

@markphelps
markphelps merged commit 04a99ca into v2 Mar 6, 2026
36 checks passed
@markphelps
markphelps deleted the fix/flaky-env-integration-tests branch March 6, 2026 16:06
@github-project-automation github-project-automation Bot moved this to Done in Flipt V2 Mar 6, 2026
markphelps added a commit that referenced this pull request Mar 6, 2026
* v2:
  fix: bump node version from 18 to 20 in CI workflows (#5501)
  chore(deps): bump @tootallnate/once and jest-environment-jsdom in /ui (#5478)
  fix: set EnvironmentKey on evaluation requests in environment integration tests (#5499)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug size:S This PR changes 10-29 lines, ignoring generated files. v2 Flipt v2

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

fix: flaky integration tests due to Gitea post-receive hook 500 errors

2 participants