Skip to content

Conversation

zhukaihan
Copy link
Collaborator

Ignore evaluationId in metadata.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes test assertion issues by ignoring the evaluationId field in metadata when comparing variants, as this field is inconsistent across evaluations. It introduces a custom assertion function to handle this comparison properly.

  • Adds a custom assertVariantEquals function that normalizes evaluationId metadata before comparison
  • Updates test variant and assertions to use the new comparison function
  • Adds environment configuration files for staging and production

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/test/kotlin/RemoteEvaluationClientTest.kt Implements custom variant comparison logic and updates test assertions
.env.staging Adds staging environment configuration
.env.proooood Adds production environment configuration
Comments suppressed due to low confidence (1)

src/test/kotlin/RemoteEvaluationClientTest.kt:1

  • The logic for creating metadata is incorrect. When expected.metadata is null but actual?.metadata is not null, an empty mutable map is created, but it should preserve the actual's metadata structure. This could cause test failures when actual has metadata but expected doesn't.
package com.amplitude.experiment

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@zhukaihan zhukaihan force-pushed the fix-tests-extra-metadata branch from 91ac11e to 93fecf9 Compare September 29, 2025 22:40
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.

1 participant