Skip to content

Commit

Permalink
Skip test instead of fail if pylsp is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
gordon-klotho committed Mar 6, 2024
1 parent 2840a11 commit 9df5166
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/code/lsp.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ func NewLSP(ctx context.Context, lspCmd string, cmdStderr io.Writer) (*LSP, erro
log := zap.L().Named(fmt.Sprintf("lsp/%s", lspCmd))

cmd := exec.CommandContext(ctx, lspCmd, "-vv")
if cmd.Err != nil {
return nil, fmt.Errorf("failed to create command: %w", cmd.Err)
}
send, err := cmd.StdinPipe()
if err != nil {
return nil, fmt.Errorf("failed to create stdin pipe: %w", err)
Expand Down
4 changes: 4 additions & 0 deletions pkg/code/python/python_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"io"
"os"
"os/exec"
"path/filepath"
"strings"
"testing"
Expand Down Expand Up @@ -103,6 +104,9 @@ func (tc testCase) TestConstraints(t *testing.T, input []byte) {
"test.py": &fstest.MapFile{Data: input},
}
actual, err := FindBoto3Constraints(context.Background(), files)
if errors.Is(err, exec.ErrNotFound) {
t.Skip("pylsp not found")
}
if err != nil {
t.Fatal(err)
}
Expand Down

0 comments on commit 9df5166

Please sign in to comment.