✨ Label tests with unique IDs and propagate testuid#175
Merged
Conversation
Added unique testuid to each test and test result; updated logic to use it.
pelikhan
reviewed
Jun 20, 2025
Test run data now includes testuid; testuid index starts from 0.
Member
|
@copilot use nanoid package for test generation |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds a new testuid field to tests and results, propagates it through test execution and evaluation, and updates related scripts and environment configuration.
- Introduce
testuidproperty in type definitions and propagate throughrunTestand evaluation logic - Assign unique IDs to tests in
promptpexGenerate - Update
package.jsonscripts and add.env.ollamafor environment settings
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/genaisrc/src/types.mts | Added optional testuid field to PromptPexTest and PromptPexTestResult |
| src/genaisrc/src/testrun.mts | Passed testuid into the payload for runTest |
| src/genaisrc/src/testevalmetric.mts | Lookup tests by testuid and error if not found |
| src/genaisrc/src/promptpex.mts | Loop to assign testuid labels when missing |
| package.json | Added new script variants with --env .env.ollama |
| .env.ollama | New environment file for Ollama model credentials |
Comments suppressed due to low confidence (2)
src/genaisrc/src/types.mts:352
- [nitpick] Consider renaming
testuidtotestUid(ortestID) to follow camelCase conventions for improved readability.
testuid?: string
src/genaisrc/src/promptpex.mts:193
- There are no unit tests verifying that
testuidis assigned and propagated correctly. Add tests aroundpromptpexGenerateto cover this new logic.
if (!test.testuid) {
Integrated nanoid for generating unique, consistent test UIDs.
Corrected testuid generation format and used strict equality for lookup.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added unique testuid to each test and test result; updated logic to use it.