Skip to content

feat(cli): Add CLI integration tests and migrate to System.CommandLine 2.0.1#21

Merged
AGIBuild merged 3 commits intomainfrom
feature/add-module-template
Dec 14, 2025
Merged

feat(cli): Add CLI integration tests and migrate to System.CommandLine 2.0.1#21
AGIBuild merged 3 commits intomainfrom
feature/add-module-template

Conversation

@AGIBuild
Copy link
Copy Markdown
Owner

Summary

Add comprehensive CLI integration tests and migrate to System.CommandLine 2.0.1 stable API.

Changes

CLI Integration Tests

  • Add new test project Modulus.Cli.IntegrationTests
  • Add command-specific tests for: new, build, pack, install, uninstall, list
  • Add end-to-end lifecycle tests (new → build → pack → install → list → uninstall)
  • Add module load verification tests using ModuleLoader
  • Add CliRunner and CliTestContext for isolated test environments

Command Handlers

  • Add InstallHandler, UninstallHandler, ListHandler for database-dependent commands
  • Enable dependency injection in tests for database isolation

System.CommandLine 2.0.1 Migration

  • Migrate all CLI commands to stable 2.0.1 API
  • Use Option<T>("--name", "-alias") { Description = "..." } syntax
  • Use command.Options.Add() and command.Arguments.Add()
  • Update Program.cs to use rootCommand.Parse(args).InvokeAsync()

Build System

  • Add TestCli target to Nuke build
  • Integrate CLI tests into pre-release gate

Test Results

  • 35 passed, 1 skipped (process timeout issue), 0 failed

Related

  • OpenSpec: add-cli-integration-tests

Hongwei-MB and others added 3 commits December 12, 2025 23:26
## CLI Enhancements
- Add 'modulus build' command for compiling modules
- Add 'modulus pack' command for packaging modules as .modpkg
- Fix pack command output path and package naming (use module name instead of GUID)
- Fix IModuleCleanupService dependency in CliServiceProvider

## Project Templates
- Add dotnet new templates (modulus-avalonia, modulus-blazor)
- Add VSIX extension project structure
- Add Nuke targets: pack-templates, publish-templates, pack-vsix
- Update template package references to Agibuild.Modulus.*

## Documentation
- Add getting-started.md and getting-started.zh-CN.md
- Add cli-reference.md with complete command reference
- Add module-development.md with development guide
- Update README.md and README.zh-CN.md with new CLI commands

## Build System
- Enable nullable reference types in build project
- Fix nullable warnings in BuildTasks.cs
- Add template packaging targets

## Proposal
- Add add-cli-integration-tests proposal for CLI testing framework
…e 2.0.1

- Add CLI integration tests project (Modulus.Cli.IntegrationTests)
- Add command-specific tests: new, build, pack, install, uninstall, list
- Add end-to-end lifecycle tests and module load verification
- Add CliRunner and CliTestContext for test isolation
- Add command handlers for database-dependent commands
- Migrate CLI commands to System.CommandLine 2.0.1 API
- Add TestCli target to Nuke build system
- All 35 tests passing (1 skipped due to process timeout)
@AGIBuild AGIBuild merged commit 0413780 into main Dec 14, 2025
1 check passed
@AGIBuild AGIBuild deleted the feature/add-module-template branch December 14, 2025 15:02
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