Skip to content

Conversation

@gru-agent
Copy link
Contributor

@gru-agent gru-agent bot commented Nov 19, 2025

Trigger Info

Trigger Type Triggered By Source Pull Request Assignment
Ready for Review FinleyGe 5957 Detail

Summary

This PR introduces unit tests for the marketplace/api module, ensuring the correctness of API calls and their expected responses. The following functionalities are covered:

  1. getSystemInstalledPlugins:

    • Verifies that the GET request is made to the correct endpoint with the appropriate query parameters.

    • Confirms the response structure matches the expected format.

  2. getMarketplaceTools:

    • Ensures the POST request is sent to the correct endpoint with the provided body.

    • Validates the response structure.

  3. getMarketplaceToolDetail:

    • Tests the GET request to fetch tool details using the correct endpoint and query parameters.

    • Confirms the response matches the expected tool detail format.

  4. getMarketPlaceToolTags:

    • Checks the GET request to retrieve tool tags from the correct endpoint.

    • Validates the response contains the expected tags.

  5. getMarketplaceDownloadURL:

    • Verifies the GET request to fetch the download URL for a tool using the correct endpoint and tool ID.

    • Includes a test case for handling an empty toolId.

Mocking is implemented for the GET and POST methods from the @/web/common/api/request module to isolate and test the API logic. Each test ensures the API calls are made with the correct parameters and that the returned data matches the expected structure.

Coverage

The change in coverage value, such as: 0% -> 50%, indicates that the coverage was 0% before writing the tests and 50% after writing them.

https://web.dev/articles/ta-code-coverage

Type Change
lines 0% -> 100% 🔺
functions 0% -> 100% 🔺
statements 0% -> 100% 🔺
branches 0% -> 100% 🔺
source program

Test Statuses

Status Change
passed 0 -> 6 🔺
failed 0 -> 0
skipped 0 -> 0
source program

Tip

You can @gru-agent and leave your feedback. TestGru will make adjustments based on your input

Tip

You can @gru-agent rebase to rebase the PR.

Tip

You can @gru-agent redo to reset or rebase before redoing the PR.

Tip

To modify the test code yourself, click here Edit Test Code

@github-actions
Copy link

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 25.65% 16311 / 63573
🔵 Statements 25.65% 16311 / 63573
🔵 Functions 34.61% 486 / 1404
🔵 Branches 70.79% 1549 / 2188
File CoverageNo changed files found.
Generated in workflow #2824 for commit c189823 by the Vitest Coverage Report Action

@github-actions
Copy link

Preview mcp_server Image:

registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-pr:fatsgpt_mcp_server_c1898232d66163e2e1953f6fdb4710ea838d7fa1

@github-actions
Copy link

Preview sandbox Image:

registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-pr:fatsgpt_sandbox_c1898232d66163e2e1953f6fdb4710ea838d7fa1

@github-actions
Copy link

Preview fastgpt Image:

registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-pr:fatsgpt_c1898232d66163e2e1953f6fdb4710ea838d7fa1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants