Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 14369Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 14369" |
There was a problem hiding this comment.
Pull request overview
This PR centralizes E2E test terminal creation by introducing a helper method CreateTestTerminal() in CliE2ETestHelpers, eliminating duplicated Hex1b terminal setup code across 17 test methods in 13 test files. The helper uses [CallerMemberName] to automatically derive the test name for asciinema recording filenames, maintaining the existing recording behavior while reducing code duplication.
Changes:
- Added
CreateTestTerminal()helper method inCliE2ETestHelperswith configurable dimensions (default 160x48) and automatic test name capture via[CallerMemberName] - Updated 17 test methods across 13 test files to use the centralized helper instead of inline terminal builder code
- Removed now-unnecessary
using Hex1b;imports from test files (onlyusing Hex1b.Automation;remains where needed)
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/Aspire.Cli.EndToEnd.Tests/Helpers/CliE2ETestHelpers.cs | Added CreateTestTerminal() helper method with CallerMemberName attribute for automatic test name capture |
| tests/Aspire.Cli.EndToEnd.Tests/AgentCommandTests.cs | Replaced 3 instances of inline terminal creation with centralized helper, removed unused import |
| tests/Aspire.Cli.EndToEnd.Tests/BannerTests.cs | Replaced 3 instances of inline terminal creation with centralized helper, removed unused import, standardized dimensions to 160x48 |
| tests/Aspire.Cli.EndToEnd.Tests/DockerDeploymentTests.cs | Replaced 2 instances of inline terminal creation with centralized helper, removed unused import |
| tests/Aspire.Cli.EndToEnd.Tests/DoctorCommandTests.cs | Replaced 2 instances of inline terminal creation with centralized helper, removed unused import |
| tests/Aspire.Cli.EndToEnd.Tests/EmptyAppHostTemplateTests.cs | Replaced inline terminal creation with centralized helper, removed unused import |
| tests/Aspire.Cli.EndToEnd.Tests/JsReactTemplateTests.cs | Replaced inline terminal creation with centralized helper, removed unused import |
| tests/Aspire.Cli.EndToEnd.Tests/KubernetesPublishTests.cs | Replaced inline terminal creation with centralized helper, removed unused import |
| tests/Aspire.Cli.EndToEnd.Tests/LogsCommandTests.cs | Replaced inline terminal creation with centralized helper, removed unused import |
| tests/Aspire.Cli.EndToEnd.Tests/PsCommandTests.cs | Replaced inline terminal creation with centralized helper, removed unused import |
| tests/Aspire.Cli.EndToEnd.Tests/PythonReactTemplateTests.cs | Replaced inline terminal creation with centralized helper, removed unused import |
| tests/Aspire.Cli.EndToEnd.Tests/ResourcesCommandTests.cs | Replaced inline terminal creation with centralized helper, removed unused import |
| tests/Aspire.Cli.EndToEnd.Tests/SmokeTests.cs | Replaced inline terminal creation with centralized helper, removed unused import |
| tests/Aspire.Cli.EndToEnd.Tests/StartStopTests.cs | Replaced inline terminal creation with centralized helper, removed unused import |
| tests/Aspire.Cli.EndToEnd.Tests/TypeScriptPolyglotTests.cs | Replaced inline terminal creation with centralized helper, removed unused import |
| /// <param name="testName">The test name used for the recording file path. Defaults to the calling method name.</param> | ||
| /// <param name="width">The terminal width in columns. Defaults to 160.</param> | ||
| /// <param name="height">The terminal height in rows. Defaults to 48.</param> |
There was a problem hiding this comment.
The parameter documentation order doesn't match the actual parameter order in the method signature. The documentation lists parameters as: testName, width, height, but the actual signature has: width, height, testName. While the code will work correctly, this inconsistency could confuse developers reading the documentation. Consider reordering the param tags to match the actual signature order.
| /// <param name="testName">The test name used for the recording file path. Defaults to the calling method name.</param> | |
| /// <param name="width">The terminal width in columns. Defaults to 160.</param> | |
| /// <param name="height">The terminal height in rows. Defaults to 48.</param> | |
| /// <param name="width">The terminal width in columns. Defaults to 160.</param> | |
| /// <param name="height">The terminal height in rows. Defaults to 48.</param> | |
| /// <param name="testName">The test name used for the recording file path. Defaults to the calling method name.</param> |
🎬 CLI E2E Test RecordingsThe following terminal recordings are available for commit
📹 Recordings uploaded automatically from CI run #21775607240 |
Centralize creating test terminal.
Background: I had a test failing because the test terminal hadn't been updated with a larger size. This method centralizes it.