Skip to content

Add small example components to component2json testdata with comprehensive test coverage#429

Merged
Mossaka merged 9 commits into
mainfrom
copilot/add-wasm-components-testdata
Nov 2, 2025
Merged

Add small example components to component2json testdata with comprehensive test coverage#429
Mossaka merged 9 commits into
mainfrom
copilot/add-wasm-components-testdata

Conversation

Copilot AI commented Oct 22, 2025

Copy link
Copy Markdown
Contributor

Completed: Add Example Components to component2json testdata

All tests and linter pass

What Was Done:

  1. Built all example components using just build-examples release

  2. Added 3 small WASM components to crates/component2json/testdata/ (all under 1MB):

    • brave-search-rs.wasm (238KB)
    • context7-rs.wasm (130KB)
    • fetch-rs.wasm (755KB)
  3. Removed large files over 1MB per feedback

  4. Created 4 comprehensive tests in crates/component2json/src/lib.rs:

    • test_fetch_rs_component ✅
    • test_brave_search_rs_component ✅
    • test_context7_rs_component ✅
    • test_all_testdata_components_schema_validity ✅
  5. Updated existing tests to use testdata/fetch-rs.wasm instead of examples directory

  6. Fixed code formatting to pass cargo +nightly fmt --check

  7. Updated CHANGELOG.md to reflect small component focus

Test Results:

  • All 46 component2json tests pass
  • test_tool_list_notification passes
  • Clippy linter passes with no warnings
  • Code formatting passes

Test Coverage:

Each test verifies:

  • JSON schema structure validity
  • MCP tool name compliance
  • Input/output schema correctness
  • Component-specific function parameters

Files Changed:

  • crates/component2json/src/lib.rs - Added 4 new test functions, updated 2 existing tests, fixed formatting
  • crates/component2json/testdata/ - Added 3 small WASM component files (all under 1MB)
  • CHANGELOG.md - Documented changes

Status: COMPLETE AND READY FOR REVIEW

Original prompt

Compile all the examples to Wasm Components and add them to testdata under component2json to harden the test coverage of that crate. Also makes suer that there are tests that invoke those testdata and verify the json schems are expected.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…ive tests

Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Copilot AI changed the title [WIP] Compile Wasm components for testdata in component2json Add all example components to component2json testdata with comprehensive test coverage Oct 22, 2025
Copilot AI requested a review from Mossaka October 22, 2025 05:28
@Mossaka

Mossaka commented Oct 22, 2025

Copy link
Copy Markdown
Contributor

@copilot remove testdata that are over 1MB size

@Mossaka Mossaka marked this pull request as ready for review October 22, 2025 05:32
Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>

Copilot AI commented Oct 22, 2025

Copy link
Copy Markdown
Contributor Author

@copilot remove testdata that are over 1MB size

Removed all testdata files over 1MB. Kept only:

  • brave-search-rs.wasm (238KB)
  • context7-rs.wasm (130KB)
  • fetch-rs.wasm (755KB)

Removed tests for the deleted large files and updated existing tests to use the smaller testdata files. All 46 tests pass. (93ac892)

Copilot AI changed the title Add all example components to component2json testdata with comprehensive test coverage Add small example components to component2json testdata with comprehensive test coverage Oct 22, 2025
@Mossaka

Mossaka commented Oct 23, 2025

Copy link
Copy Markdown
Contributor

@copilot please make sure that the test and linter passed

test_tool_list_notification

Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>

Copilot AI commented Oct 23, 2025

Copy link
Copy Markdown
Contributor Author

@copilot please make sure that the test and linter passed

...

Verified that all tests and linter pass:

  • ✅ test_tool_list_notification passes (1 passed in 44.05s)
  • ✅ All 46 component2json tests pass
  • ✅ Clippy linter passes with no warnings
  • ✅ Code formatting fixed and passes

(4ed1c93)

Signed-off-by: Jiaxiao Zhou <duibao55328@gmail.com>
@Mossaka Mossaka requested a review from Copilot October 23, 2025 06:07

Copilot AI 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.

Pull Request Overview

This PR enhances test coverage for the component2json crate by adding compiled WASM components to testdata and creating comprehensive tests to validate JSON schema generation. The focus is on smaller components (under 1MB) to keep the repository lean while ensuring robust testing across different component types.

Key changes:

  • Added 3 small WASM components to testdata: fetch-rs.wasm (755KB), brave-search-rs.wasm (238KB), and context7-rs.wasm (130KB)
  • Created 4 new comprehensive test functions validating schema structure, MCP compliance, and component-specific parameters
  • Updated existing tests to use testdata paths instead of examples directory

Reviewed Changes

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

File Description
crates/component2json/src/lib.rs Added 4 new test functions for testdata components, updated 2 existing tests to use testdata paths
CHANGELOG.md Documented addition of comprehensive test coverage with example components

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

Comment thread CHANGELOG.md Outdated

### Added

- Comprehensive test coverage for component2json crate with example components added to testdata directory (fetch-rs, brave-search-rs, context7-rs under 1MB) to validate JSON schema generation across different language ecosystems ([#XXX](https://github.com/microsoft/wassette/pull/XXX))

Copilot AI Oct 23, 2025

Copy link

Choose a reason for hiding this comment

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

The placeholder '[#XXX]' should be replaced with the actual PR number before merging.

Suggested change
- Comprehensive test coverage for component2json crate with example components added to testdata directory (fetch-rs, brave-search-rs, context7-rs under 1MB) to validate JSON schema generation across different language ecosystems ([#XXX](https://github.com/microsoft/wassette/pull/XXX))
- Comprehensive test coverage for component2json crate with example components added to testdata directory (fetch-rs, brave-search-rs, context7-rs under 1MB) to validate JSON schema generation across different language ecosystems ([#NNN](https://github.com/microsoft/wassette/pull/NNN))

Copilot uses AI. Check for mistakes.
Comment thread crates/component2json/src/lib.rs Outdated
Mossaka and others added 3 commits October 22, 2025 23:21
Signed-off-by: Jiaxiao Zhou <duibao55328@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Jiaxiao Zhou <duibao55328@gmail.com>
Signed-off-by: Jiaxiao Zhou <duibao55328@gmail.com>
Signed-off-by: Jiaxiao Zhou <duibao55328@gmail.com>
@Mossaka Mossaka merged commit b24a628 into main Nov 2, 2025
14 of 15 checks passed
@Mossaka Mossaka deleted the copilot/add-wasm-components-testdata branch November 2, 2025 09:25
Mossaka added a commit to Mossaka/wassette that referenced this pull request Feb 2, 2026
…nsive test coverage (microsoft#429)

* Initial plan

* Add all example components to component2json testdata with comprehensive tests

Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>

* Remove testdata files over 1MB, keep only small components

Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>

* Fix code formatting issues

Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Jiaxiao Zhou <duibao55328@gmail.com>

---------

Signed-off-by: Jiaxiao Zhou <duibao55328@gmail.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Co-authored-by: Jiaxiao Zhou <duibao55328@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.

3 participants