Skip to content

feat(test): add end-to-end validation for architecture_config integration#199

Open
rishi-jat wants to merge 2 commits intomodelpack:mainfrom
rishi-jat:feat/architecture-integration-test-v2
Open

feat(test): add end-to-end validation for architecture_config integration#199
rishi-jat wants to merge 2 commits intomodelpack:mainfrom
rishi-jat:feat/architecture-integration-test-v2

Conversation

@rishi-jat
Copy link

Summary

Adds an integration test that validates the full pipeline for architecture_config within the ModelPack model specification.

This test ensures that a HuggingFace-style configuration can be converted into architecture_config, embedded into a Model, and passed through schema validation.

Scope

  • Simulates HuggingFace config input
  • Converts to architecture_config
  • Embeds the result into a full Model object
  • Validates using schema.ValidatorMediaTypeModelConfig

Test Coverage

  • Valid end-to-end conversion and embedding
  • Missing required HuggingFace fields
  • Invalid model structure (schema rejection)
  • Invalid field values (e.g., zero or incorrect types)

Notes

  • Validation of architecture_config depends on the schema changes introduced in the corresponding schema PR.
  • Until that schema is merged, validation is expected to fail specifically due to the presence of the architecture_config field.
  • This test intentionally preserves the correct structure rather than bypassing validation.

Non-goals

  • No changes to schema definitions
  • No changes to conversion tooling
  • No extension of architecture specification beyond minimal fields

This PR establishes a baseline integration check for future work on architecture specification, tooling, and validation.

Signed-off-by: Rishi Jat <rishijat098@gmail.com>
Copilot AI review requested due to automatic review settings March 26, 2026 00:58
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a crucial end-to-end integration test to ensure the robust handling of architecture_config within the ModelPack model specification. It simulates the conversion of HuggingFace configurations into the architecture_config format, embeds this into a complete Model object, and then subjects it to schema validation. This establishes a foundational check for future work on architecture specification and tooling, without altering existing schema definitions or conversion logic.

Highlights

  • New End-to-End Integration Test: Added a new end-to-end integration test specifically for the architecture_config within the ModelPack model specification.
  • Full Pipeline Validation: Validated the complete pipeline, encompassing the conversion of HuggingFace-style configurations into architecture_config, embedding this configuration into a Model object, and subsequently performing schema validation.
  • Comprehensive Test Coverage: Included test cases to cover valid conversions, scenarios with missing required HuggingFace fields, rejection of invalid model structures by the schema, and validation of field values (e.g., ensuring numerical values are within expected ranges).
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces schema/architecture_integration_test.go, which includes a utility function convertHFToArchConfig for converting HuggingFace configurations to an internal architecture format, along with several integration tests. These tests cover valid conversions, missing fields, invalid model structures, and invalid field values, and also validate the full pipeline including schema validation. Feedback suggests improving the archConfig map verification in TestArchitectureIntegrationValidConversion by using reflect.DeepEqual for robustness and conciseness. Additionally, it's recommended to explicitly handle the success case in the validation logic of TestArchitectureIntegrationValidConversion to enhance clarity for its dual-purpose nature.

Copy link

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

Adds a new Go integration test to exercise the end-to-end pipeline for deriving an architecture_config-like object from a HuggingFace-style config and embedding it into a full Model JSON for schema validation (with current expected failure behavior until the schema accepts the new field).

Changes:

  • Introduces schema/architecture_integration_test.go with a simulated HF→architecture_config conversion helper.
  • Adds an end-to-end validation test that currently expects schema rejection due to architecture_config being an unknown field.
  • Adds negative-path tests for missing HF fields, invalid model structure, and invalid numeric values.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: Rishi Jat <rishijat098@gmail.com>
@rishi-jat
Copy link
Author

/cc @aftersnow
/cc @bergwolf

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.

2 participants