Skip to content

Commit

Permalink
Add SourceKit Validation smoke test
Browse files Browse the repository at this point in the history
  • Loading branch information
z2oh committed Mar 7, 2024
1 parent 86420a9 commit 47efdcb
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/swift-toolchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2431,6 +2431,10 @@ jobs:
runs-on: ${{ needs.context.outputs.windows_build_runner }}

steps:
- uses: actions/checkout@v4
with:
sparse-checkout: tests

- uses: actions/download-artifact@v4
with:
name: installer-amd64
Expand Down Expand Up @@ -2483,6 +2487,27 @@ jobs:
- run: swift test -Xswiftc -DENABLE_TESTING
working-directory: ${{ github.workspace }}/SourceCache/swift-win32

- name: SourceKit Validation
id: sourcekit-validation
working-directory: ${{ github.workspace }}/SourceCache/swift-win32
continue-on-error: true
run: |
$diagnosticOutput = $( $output = & Get-Content ${{ github.workspace }}/tests/sourcekit-lsp-initialization-message | sourcekit-lsp.exe ) 2>&1
if (-not ($diagnosticOutput -Match "Succeeded") -or -not ($diagnosticOutput -Match "InitializeResult")) {
Write-Host "sourcekit-lsp failed to initialize"
Write-Host $diagnosticOutput
echo "failed=true" >> $GITHUB_OUTPUT
} else {
echo "failed=false" >> $GITHUB_OUTPUT
}
- name: SourceKit Validation Check
run: |
if (${{ steps.sourcekit-validation.outputs.failed == 'true' }}) {
Write-Host "sourcekit-lsp failed to initialize"
exit 1
}
snapshot:
runs-on: ubuntu-latest
needs: [context, smoke_test]
Expand Down
11 changes: 11 additions & 0 deletions tests/sourcekit-lsp-initialization-message
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Content-Length: 152

{
"jsonrpc": "2.0",
"id": 0,
"method": "initialize",
"params": {
"capabilities": {},
"trace": "verbose",
}
}

0 comments on commit 47efdcb

Please sign in to comment.