Skip to content

Commit 455e7ad

Browse files
authored
Integration tests for python, typescript, and rust (#16)
1 parent 609efda commit 455e7ad

File tree

105 files changed

+4614
-54
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+4614
-54
lines changed

.github/dependabot.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ updates:
33
- package-ecosystem: "gomod"
44
directory: "/"
55
schedule:
6-
interval: "weekly"
6+
interval: "monthly"
77
open-pull-requests-limit: 10
88
labels:
99
- "dependencies"
@@ -16,4 +16,5 @@ updates:
1616
open-pull-requests-limit: 10
1717
labels:
1818
- "dependencies"
19-
- "github-actions"
19+
- "github-actions"
20+

.github/workflows/go.yml

Lines changed: 95 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ on:
88
workflow_dispatch:
99

1010
jobs:
11-
test:
12-
name: Run Tests
11+
unit-tests:
12+
name: Unit Tests and Code Quality
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@v4
@@ -21,14 +21,23 @@ jobs:
2121
check-latest: true
2222
cache: true
2323

24+
- name: Build
25+
run: go build -o mcp-language-server
26+
27+
- name: Install just
28+
run: curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to /usr/local/bin
29+
2430
- name: Install gopls
2531
run: go install golang.org/x/tools/gopls@latest
2632

27-
- name: Run tests
28-
run: go test ./...
33+
- name: Run unit tests
34+
run: go test ./internal/...
35+
36+
- name: Run code quality checks
37+
run: just check
2938

30-
check:
31-
name: Build and Code Quality Checks
39+
go-integration-tests:
40+
name: Go Integration Tests
3241
runs-on: ubuntu-latest
3342
steps:
3443
- uses: actions/checkout@v4
@@ -40,14 +49,86 @@ jobs:
4049
check-latest: true
4150
cache: true
4251

43-
- name: Build
44-
run: go build -o mcp-language-server
45-
46-
- name: Install just
47-
run: curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to /usr/local/bin
48-
4952
- name: Install gopls
5053
run: go install golang.org/x/tools/gopls@latest
5154

52-
- name: Run code quality checks
53-
run: just check
55+
- name: Run Go integration tests
56+
run: go test ./integrationtests/languages/go/...
57+
58+
python-integration-tests:
59+
name: Python Integration Tests
60+
runs-on: ubuntu-latest
61+
steps:
62+
- uses: actions/checkout@v4
63+
64+
- name: Set up Go
65+
uses: actions/setup-go@v5
66+
with:
67+
go-version: "1.24"
68+
check-latest: true
69+
cache: true
70+
71+
- name: Set up Python
72+
uses: actions/setup-python@v5
73+
with:
74+
python-version: "3.10"
75+
76+
- name: Install pyright
77+
run: npm install -g pyright
78+
79+
- name: Run Python integration tests
80+
run: go test ./integrationtests/languages/python/...
81+
82+
rust-integration-tests:
83+
name: Rust Integration Tests
84+
runs-on: ubuntu-latest
85+
steps:
86+
- uses: actions/checkout@v4
87+
88+
- name: Set up Go
89+
uses: actions/setup-go@v5
90+
with:
91+
go-version: "1.24"
92+
check-latest: true
93+
cache: true
94+
95+
- name: Set up Rust
96+
uses: actions-rs/toolchain@v1
97+
with:
98+
toolchain: stable
99+
components: rust-src
100+
override: true
101+
102+
- name: Install rust-analyzer
103+
run: |
104+
mkdir -p ~/.local/bin
105+
curl -L https://github.com/rust-analyzer/rust-analyzer/releases/latest/download/rust-analyzer-x86_64-unknown-linux-gnu.gz | gunzip -c - > ~/.local/bin/rust-analyzer
106+
chmod +x ~/.local/bin/rust-analyzer
107+
echo "$HOME/.local/bin" >> $GITHUB_PATH
108+
109+
- name: Run Rust integration tests
110+
run: go test ./integrationtests/languages/rust/...
111+
112+
typescript-integration-tests:
113+
name: TypeScript Integration Tests
114+
runs-on: ubuntu-latest
115+
steps:
116+
- uses: actions/checkout@v4
117+
118+
- name: Set up Go
119+
uses: actions/setup-go@v5
120+
with:
121+
go-version: "1.24"
122+
check-latest: true
123+
cache: true
124+
125+
- name: Set up Node.js
126+
uses: actions/setup-node@v4
127+
with:
128+
node-version: "20"
129+
130+
- name: Install typescript-language-server
131+
run: npm install -g typescript typescript-language-server
132+
133+
- name: Run TypeScript integration tests
134+
run: go test ./integrationtests/languages/typescript/...

integrationtests/fixtures/snapshots/go/diagnostics/unreachable.snap

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ Code: default
1010
8| fmt.Println("Unreachable code") // This is unreachable code
1111
9|}
1212

13-
1413
===
1514
/TEST_OUTPUT/workspace/main.go
1615
Location: Line 9, Column 1

integrationtests/fixtures/snapshots/go/references/foobar-function.snap

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
/TEST_OUTPUT/workspace/main.go
33
References in File: 1
44
===
5-
65
Reference at Line 12, Column 14:
76
11|func main() {
87
12| fmt.Println(FooBar())

integrationtests/fixtures/snapshots/go/references/helper-function.snap

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
/TEST_OUTPUT/workspace/another_consumer.go
33
References in File: 1
44
===
5-
65
Reference at Line 8, Column 34:
76
6|func AnotherConsumer() {
87
7| // Use helper function
@@ -41,12 +40,10 @@ Reference at Line 8, Column 34:
4140
40| }
4241
41|}
4342

44-
4543
===
4644
/TEST_OUTPUT/workspace/consumer.go
4745
References in File: 1
4846
===
49-
5047
Reference at Line 7, Column 13:
5148
6|func ConsumerFunction() {
5249
7| message := HelperFunction()

integrationtests/fixtures/snapshots/go/references/interface-method.snap

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
/TEST_OUTPUT/workspace/another_consumer.go
33
References in File: 1
44
===
5-
65
Reference at Line 19, Column 15:
76
6|func AnotherConsumer() {
87
7| // Use helper function
@@ -41,12 +40,10 @@ Reference at Line 19, Column 15:
4140
40| }
4241
41|}
4342

44-
4543
===
4644
/TEST_OUTPUT/workspace/consumer.go
4745
References in File: 1
4846
===
49-
5047
Reference at Line 24, Column 20:
5148
6|func ConsumerFunction() {
5249
7| message := HelperFunction()

integrationtests/fixtures/snapshots/go/references/shared-constant.snap

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
/TEST_OUTPUT/workspace/another_consumer.go
33
References in File: 1
44
===
5-
65
Reference at Line 15, Column 23:
76
6|func AnotherConsumer() {
87
7| // Use helper function
@@ -41,12 +40,10 @@ Reference at Line 15, Column 23:
4140
40| }
4241
41|}
4342

44-
4543
===
4644
/TEST_OUTPUT/workspace/consumer.go
4745
References in File: 1
4846
===
49-
5047
Reference at Line 15, Column 23:
5148
6|func ConsumerFunction() {
5249
7| message := HelperFunction()

integrationtests/fixtures/snapshots/go/references/shared-interface.snap

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
/TEST_OUTPUT/workspace/another_consumer.go
33
References in File: 1
44
===
5-
65
Reference at Line 33, Column 12:
76
6|func AnotherConsumer() {
87
7| // Use helper function
@@ -41,12 +40,10 @@ Reference at Line 33, Column 12:
4140
40| }
4241
41|}
4342

44-
4543
===
4644
/TEST_OUTPUT/workspace/consumer.go
4745
References in File: 1
4846
===
49-
5047
Reference at Line 23, Column 12:
5148
6|func ConsumerFunction() {
5249
7| message := HelperFunction()

integrationtests/fixtures/snapshots/go/references/shared-struct.snap

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
/TEST_OUTPUT/workspace/another_consumer.go
33
References in File: 2
44
===
5-
65
Reference at Line 11, Column 8:
76
6|func AnotherConsumer() {
87
7| // Use helper function
@@ -80,12 +79,10 @@ Reference at Line 25, Column 3:
8079
40| }
8180
41|}
8281

83-
8482
===
8583
/TEST_OUTPUT/workspace/consumer.go
8684
References in File: 1
8785
===
88-
8986
Reference at Line 11, Column 8:
9087
6|func ConsumerFunction() {
9188
7| message := HelperFunction()
@@ -112,12 +109,10 @@ Reference at Line 11, Column 8:
112109
28| fmt.Println(t)
113110
29|}
114111

115-
116112
===
117113
/TEST_OUTPUT/workspace/types.go
118114
References in File: 3
119115
===
120-
121116
Reference at Line 14, Column 10:
122117
14|func (s *SharedStruct) Method() string {
123118
15| return s.Name

integrationtests/fixtures/snapshots/go/references/shared-type.snap

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
/TEST_OUTPUT/workspace/another_consumer.go
33
References in File: 1
44
===
5-
65
Reference at Line 37, Column 14:
76
6|func AnotherConsumer() {
87
7| // Use helper function
@@ -41,12 +40,10 @@ Reference at Line 37, Column 14:
4140
40| }
4241
41|}
4342

44-
4543
===
4644
/TEST_OUTPUT/workspace/consumer.go
4745
References in File: 1
4846
===
49-
5047
Reference at Line 27, Column 8:
5148
6|func ConsumerFunction() {
5249
7| message := HelperFunction()

0 commit comments

Comments
 (0)