-
Notifications
You must be signed in to change notification settings - Fork 14
[ZEPHYR] Get a specific test case #215
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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 adds functionality to retrieve individual test case details from Zephyr by key. The implementation follows the existing pattern established by the GetProjects tool.
- Introduces a new
GetTestCasetool that fetches test case details by key - Adds comprehensive schema definitions for test cases including links, labels, and custom fields
- Includes unit tests covering success and error scenarios
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 15 comments.
| File | Description |
|---|---|
src/zephyr/tool/test-case/get-test-case.ts |
Implements the new GetTestCase tool with input validation and API call handling |
src/zephyr/common/types.ts |
Adds schema definitions for test cases, including supporting schemas for references, users, links, and labels |
src/zephyr/client.ts |
Registers the new GetTestCase tool with the Zephyr client |
src/tests/unit/zephyr/tool/test-case/get-test-case.test.ts |
Provides unit tests for the GetTestCase tool |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| export const CustomFieldsSchema = z | ||
| .record(z.any()) | ||
| .describe("Custom fields with dynamic keys and values."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can alter the description slightly, because keys are always String in this case. Only values can be of various types.
| .describe("Custom fields with dynamic keys and values."); | ||
|
|
||
| export const TypeSchema = z.enum(["COVERAGE", "RELATES", "BLOCKS"]); | ||
| export const TestCaseLabelsSchema = z.enum([ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TestCaseLabelsSchema should be z.array(z.string()), it's not an enum. It can be an array of any strings.
| z.object({ | ||
| description: z.string().nullable().describe("Description of the web link."), | ||
| url: z.string().url().describe("URL of the web link."), | ||
| type: z.string().describe("Type of the web link."), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should also be a TypeSchema, since it's an enum
Goal
This PR will provide functionality for getting a specific Test Case
Design
Changeset
Added get-test-case.ts and get-test-case.test.ts
Testing
Added unit tests
Tested the functionality using GitHub Copilot and invoking the tool