Skip to content

[Code Quality] tests/ConsoleApp/Program.cs — Developer-specific hardcoded Python path + dead commented code #746

@Christophe-Rogiers

Description

@Christophe-Rogiers

Severity: Info
File: tests/ConsoleApp/ConsoleApp/Program.cs

Description:
The repo ships a small standalone ConsoleApp/Program.cs under tests/ that is not referenced by any test project. Its purpose appears to be a manual smoke test for console encoding, Ctrl+C handling, and Python subprocess launching. It contains:

  • A developer-specific hardcoded path: C:\Users\aelassas\AppData\Local\Programs\Python\Python313\python.exe (line 59), live in the non-commented ProcessStartInfo. No-one else can run this as-is.
  • Dead commented code referring to E:\dev\servy\src\tests\ctrlc.py (lines 39–48) and AllocConsole() (line 20).
  • Local file I/O side-effects to output.txt (line 14) that persist across runs in the binary-output directory.
var psi = new ProcessStartInfo
{
    FileName = @"C:\Users\aelassas\AppData\Local\Programs\Python\Python313\python.exe",
    Arguments = /* … */
};

This is not a bug in the product but it is an artefact that can confuse new contributors (and bloats the git history when anyone edits it on their own machine).

Suggested fix:
Either (a) remove tests/ConsoleApp/ConsoleApp/ entirely if its purpose is now covered by the proper test projects and tests/ctrlc*.py, or (b) move it under a scratch/ or tools/dev-harness/ folder, parameterise the paths via Environment.GetEnvironmentVariable("PYTHON_EXE") or CLI args, and add a README explaining when/why to run it. Clean out the commented-out AllocConsole / ctrlc.py blocks in the same pass.

Metadata

Metadata

Assignees

Labels

refactorChanges that improve structure, readability, or maintainability without altering external behavior

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions