1+ name : PowerShell Quoting Test
2+
3+ on :
4+ pull_request :
5+ push :
6+ branches :
7+ - master
8+ workflow_dispatch :
9+
10+ jobs :
11+ test-powershell-quoting :
12+ runs-on : windows-latest
13+ steps :
14+ - uses : actions/checkout@v4
15+
16+ - name : Set up Python
17+ uses : actions/setup-python@v4
18+ with :
19+ python-version : " 3.11"
20+
21+ - name : Install dependencies
22+ run : |
23+ pip install --upgrade pip
24+ pip install -e .
25+ shell : pwsh
26+
27+ - name : Test Unix-style quoting (should fail in PowerShell)
28+ id : unix-style
29+ shell : pwsh
30+ continue-on-error : true
31+ run : |
32+ Write-Host "Testing Unix-style quoting: 'diagnosis_3:`"Squamous cell carcinoma in situ`"'"
33+ $query = 'diagnosis_3:"Squamous cell carcinoma in situ"'
34+ Write-Host "PowerShell will pass: $query"
35+ isic metadata download -s 'diagnosis_3:"Squamous cell carcinoma in situ"' --limit 1
36+
37+ - name : Test incorrect PowerShell quoting (should also fail)
38+ id : incorrect-powershell
39+ shell : pwsh
40+ continue-on-error : true
41+ run : |
42+ # This is what users might try but still fails
43+ isic metadata download -s "diagnosis_3:\"Squamous cell carcinoma in situ\"" --limit 1
44+
45+ - name : Test correct PowerShell quoting with doubled quotes
46+ id : correct-powershell-doubled
47+ shell : pwsh
48+ continue-on-error : true
49+ run : |
50+ # This should work - doubled quotes inside single quotes
51+ isic metadata download -s 'diagnosis_3:""Squamous cell carcinoma in situ""' --limit 1
52+
53+ - name : Test correct PowerShell quoting with backticks
54+ id : correct-powershell-backticks
55+ shell : pwsh
56+ continue-on-error : true
57+ run : |
58+ # This should work - backtick escaping
59+ isic metadata download -s "diagnosis_3:`"Squamous cell carcinoma in situ`"" --limit 1
60+
61+ - name : Test simple query without spaces (should always work)
62+ id : simple-query
63+ shell : pwsh
64+ run : |
65+ # This should always work regardless of shell
66+ isic metadata download -s 'age_approx:50' --limit 1
67+
68+ - name : Analyze test results
69+ shell : pwsh
70+ run : |
71+ Write-Host "=== Test Results Analysis ==="
72+ Write-Host "Unix-style quoting outcome: ${{ steps.unix-style.outcome }}"
73+ Write-Host "Incorrect PowerShell quoting outcome: ${{ steps.incorrect-powershell.outcome }}"
74+ Write-Host "Correct PowerShell doubled quotes outcome: ${{ steps.correct-powershell-doubled.outcome }}"
75+ Write-Host "Correct PowerShell backticks outcome: ${{ steps.correct-powershell-backticks.outcome }}"
76+ Write-Host "Simple query outcome: ${{ steps.simple-query.outcome }}"
77+
78+ Write-Host ""
79+ Write-Host "=== Analysis ==="
80+
81+ # Count successes and failures
82+ $successes = @("${{ steps.unix-style.outcome }}", "${{ steps.incorrect-powershell.outcome }}", "${{ steps.correct-powershell-doubled.outcome }}", "${{ steps.correct-powershell-backticks.outcome }}", "${{ steps.simple-query.outcome }}") | Where-Object { $_ -eq "success" }
83+ $failures = @("${{ steps.unix-style.outcome }}", "${{ steps.incorrect-powershell.outcome }}", "${{ steps.correct-powershell-doubled.outcome }}", "${{ steps.correct-powershell-backticks.outcome }}", "${{ steps.simple-query.outcome }}") | Where-Object { $_ -eq "failure" }
84+
85+ Write-Host "Total successes: $($successes.Count)"
86+ Write-Host "Total failures: $($failures.Count)"
87+
88+ if ($successes.Count -eq 5) {
89+ Write-Host "🔍 All commands succeeded - this suggests either:"
90+ Write-Host " 1. PowerShell is handling all quoting styles correctly, OR"
91+ Write-Host " 2. The search validation is not strict enough to catch quoting issues"
92+ Write-Host "✅ This is actually good news - the quoting issue may not exist or be as severe as expected"
93+ } elseif ($failures.Count -eq 5) {
94+ Write-Host "❌ All commands failed - this suggests:"
95+ Write-Host " 1. Network/authentication issues, OR"
96+ Write-Host " 2. Invalid diagnosis value, OR"
97+ Write-Host " 3. CLI installation problems"
98+ } else {
99+ Write-Host "📊 Mixed results - this is the expected behavior if there's a real quoting issue"
100+ Write-Host " - Some quoting styles work, others don't"
101+ }
102+
103+ Write-Host ""
104+ Write-Host "This test run provides valuable data about PowerShell quoting behavior."
105+ Write-Host "All outcomes are informative and help us understand the real issue."
106+
107+ test-cmd-quoting :
108+ runs-on : windows-latest
109+ steps :
110+ - uses : actions/checkout@v4
111+
112+ - name : Set up Python
113+ uses : actions/setup-python@v4
114+ with :
115+ python-version : " 3.11"
116+
117+ - name : Install dependencies
118+ run : |
119+ pip install --upgrade pip
120+ pip install -e .
121+ shell : cmd
122+
123+ - name : Test quoting in Command Prompt
124+ shell : cmd
125+ run : |
126+ REM Test basic quoting in cmd.exe
127+ isic metadata download -s "diagnosis_3:\"Squamous cell carcinoma in situ\"" --limit 1
128+
129+ - name : Test simple query in Command Prompt
130+ shell : cmd
131+ run : |
132+ isic metadata download -s "age_approx:50" --limit 1
0 commit comments