[PR #10465] [MERGED] Fix code-format and test invocation through PowerShell #28068

Open
opened 2026-01-31 09:26:07 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/10465
Author: @ianjoneill
Created: 6/20/2021
Status: Merged
Merged: 6/21/2021
Merged by: @lhecker

Base: mainHead: f-fix-code-format-test-invocation-fns


📝 Commits (1)

  • 78d9c46 Fix code-format and test invocation through PowerShell

📊 Changes

2 files changed (+11 additions, -9 deletions)

View changed files

📝 tools/OpenConsole.psm1 (+9 -7)
📝 tools/tests.xml (+2 -2)

📄 Description

Fixes the Invoke-CodeFormat and Invoke-OpenConsoleTests functions in OpenConsole.psm1 so that they can be run directly from PowerShell.

Addresses the issues found when creating #10447.

Invoke-CodeFormat did not work when invoked directly from PowerShell due to a relative path being passed into the .NET function [IO.File]::WriteAllLines(). The working directory for .NET objects does not change when you change directory in PowerShell, so the paths were being treated as relative to the initial working directory of the shell - which was not the terminal git repo.

Invoke-OpenConsoleTests had 3 issues:

  1. The path to TestHostApp was wrong.
  2. It would attempt to run the "in host app" tests both in the host app and not in the host app.
  3. The test configuration in tests.xml wasn't in sync with the runABC.cmd files, so the remoting and control unit tests didn't run.

Validation Steps Performed

  1. Ran Invoke-CodeFormat and runformat.cmd from multiple directories and didn't see errors.
  2. Ran Invoke-OpenConsoleTests and didn't see errors.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/10465 **Author:** [@ianjoneill](https://github.com/ianjoneill) **Created:** 6/20/2021 **Status:** ✅ Merged **Merged:** 6/21/2021 **Merged by:** [@lhecker](https://github.com/lhecker) **Base:** `main` ← **Head:** `f-fix-code-format-test-invocation-fns` --- ### 📝 Commits (1) - [`78d9c46`](https://github.com/microsoft/terminal/commit/78d9c460af4434213fcfcdeb684966d06148f04e) Fix code-format and test invocation through PowerShell ### 📊 Changes **2 files changed** (+11 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `tools/OpenConsole.psm1` (+9 -7) 📝 `tools/tests.xml` (+2 -2) </details> ### 📄 Description Fixes the `Invoke-CodeFormat` and `Invoke-OpenConsoleTests` functions in `OpenConsole.psm1` so that they can be run directly from PowerShell. Addresses the issues found when creating #10447. `Invoke-CodeFormat` did not work when invoked directly from PowerShell due to a relative path being passed into the .NET function `[IO.File]::WriteAllLines()`. The working directory for .NET objects does not change when you change directory in PowerShell, so the paths were being treated as relative to the initial working directory of the shell - which was not the terminal git repo. `Invoke-OpenConsoleTests` had 3 issues: 1. The path to `TestHostApp` was wrong. 2. It would attempt to run the "in host app" tests both in the host app and not in the host app. 3. The test configuration in `tests.xml` wasn't in sync with the `runABC.cmd` files, so the remoting and control unit tests didn't run. ## Validation Steps Performed 1. Ran `Invoke-CodeFormat` and `runformat.cmd` from multiple directories and didn't see errors. 2. Ran `Invoke-OpenConsoleTests` and didn't see errors. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:26:07 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#28068