Skip to content

Enhance CI for Samples: Build, Test, and Smoke Tests#766

Open
jacobsimionato wants to merge 6 commits intogoogle:mainfrom
jacobsimionato:ci_samples
Open

Enhance CI for Samples: Build, Test, and Smoke Tests#766
jacobsimionato wants to merge 6 commits intogoogle:mainfrom
jacobsimionato:ci_samples

Conversation

@jacobsimionato
Copy link
Collaborator

@jacobsimionato jacobsimionato commented Mar 4, 2026

Analysis of Existing CI and Gaps

Previously, the CI for samples was focused primarily on a subset of projects and limited to build-time packaging, leaving several gaps:

  1. Angular: The CI only built 4 specific projects (contact, restaurant, rizzcharts, orchestrator). Critical projects like the a2a-chat-canvas library, gallery, and lib were never verified. Additionally, no unit tests were executed.
  2. Lit: The CI built the contact and shell samples but completely skipped the component_gallery. No tests or type-checking were run for any Lit sample.
  3. Python Agents: CI only performed uv build for ADK samples. This verified that they could be packaged but did not verify that they could actually start or that their imports were valid at runtime. The MCP demo was entirely omitted from CI.

Improvements and Rationale

This PR addresses these gaps by implementing a more comprehensive validation strategy:

Angular Improvements

  • Full Coverage: Updated the workflow to build all 7 projects defined in angular.json.
  • Explicit Type-checking: Added a type-checking loop using ng build with minimal options to catch import errors early.
  • Runtime Verification: Enabled npm run test (Karma/Jasmine) in headless mode to verify logic and component integrity.

Lit Improvements

  • Workspace Completion: Added component_gallery to the top-level workspaces in samples/client/lit/package.json.
  • Explicit Type-checking: Added npm run build:tsc --workspaces to verify TypeScript compilation across all samples.
  • New Smoke Tests: Created tests/smoke.test.ts in each sample workspace. These tests import the main application entry points and are executed via Node's test runner, ensuring that all dynamic and static imports resolve correctly in the final bundle.

Python Agent Smoke Tests

  • MCP Inclusion: Added samples/agent/mcp/ to the CI trigger paths and build steps.
  • CLI Validation: Added uv run . --help to all agents to verify CLI integrity.
  • Runtime Agent Validation: Added a runtime check for ADK agents (ContactAgent, OrchestratorAgent, etc.) that instantiates the agent and retrieves its Agent Card. This verifies that the agent logic, tool registration, and internal A2A/ADK dependencies are functional.

These changes ensure that all samples are verified for both build-time packaging and runtime integrity, preventing 'broken on arrival' samples due to import errors or dependency mismatches.

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

The pull request significantly enhances the CI pipeline for samples across Angular, Lit, and Python Agents. The changes aim to provide more comprehensive validation, including full project coverage, runtime verification, and test automation, which is a crucial step towards preventing 'broken on arrival' samples. The specific change in samples/client/lit/package.json correctly integrates the component_gallery into the Lit workspaces, aligning with the stated goal of improving Lit sample coverage.

Note: Security Review has been skipped due to the limited scope of the PR.

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

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant