Enhance CI for Samples: Build, Test, and Smoke Tests#766
Enhance CI for Samples: Build, Test, and Smoke Tests#766jacobsimionato wants to merge 7 commits intogoogle:mainfrom
Conversation
There was a problem hiding this comment.
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.
|
Looks good, although it looks like some tests are still failing. |
| run: | | ||
| uv build . | ||
| uv run . --help | ||
| uv run python -c "from agent import RizzchartsAgent; a = RizzchartsAgent(base_url='http://localhost', use_ui=True); print(f'Agent card validated: {a.get_agent_card().name}')" |
There was a problem hiding this comment.
Can this be a configurable python script in scripts or similar that reads what class to import from the command line maybe? That way this line can become something like uv run python smoke_test.py RizzchartsAgent?
| }, | ||
| "test": { | ||
| "command": "node --test --enable-source-maps --test-reporter spec dist/src/0.8/tests/**/*.test.js", | ||
| "command": "npx tsx --test --test-reporter spec tests/**/*.test.ts", |
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:
contact,restaurant,rizzcharts,orchestrator). Critical projects like thea2a-chat-canvaslibrary,gallery, andlibwere never verified. Additionally, no unit tests were executed.contactandshellsamples but completely skipped thecomponent_gallery. No tests or type-checking were run for any Lit sample.uv buildfor 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
angular.json.ng buildwith minimal options to catch import errors early.npm run test(Karma/Jasmine) in headless mode to verify logic and component integrity.Lit Improvements
component_galleryto the top-level workspaces insamples/client/lit/package.json.npm run build:tsc --workspacesto verify TypeScript compilation across all samples.tests/smoke.test.tsin 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
samples/agent/mcp/to the CI trigger paths and build steps.uv run . --helpto all agents to verify CLI integrity.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.