Skip to content

Commit 16d4b6d

Browse files
committed
ci: Fix test to use correct version
1 parent 08a3564 commit 16d4b6d

File tree

4 files changed

+31
-6
lines changed

4 files changed

+31
-6
lines changed

.github/release-please-config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"release-type": "go",
66
"bump-minor-pre-major": true,
77
"include-v-in-tag": true,
8-
"version-file": "main.go"
8+
"version-file": "internal/app/version.go"
99
}
1010
}
1111
}

e2e_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ package main_test
2424

2525
import (
2626
"bytes"
27+
"fmt"
2728
"io"
2829
"os"
2930
"os/exec"
@@ -32,6 +33,7 @@ import (
3233
"testing"
3334
"time"
3435

36+
"github.com/armsnyder/gdshader-language-server/internal/app"
3537
. "github.com/onsi/gomega"
3638

3739
"github.com/samber/lo"
@@ -89,7 +91,7 @@ func TestE2E(t *testing.T) {
8991
expected += "Content-Length: " + strconv.Itoa(len(s)) + "\r\nContent-Type: application/vscode-jsonrpc; charset=utf-8\r\n\r\n" + s
9092
}
9193

92-
expect(`{"jsonrpc":"2.0","id":1,"result":{"capabilities":{"textDocumentSync":{"openClose":true,"change":2},"completionProvider":{}},"serverInfo":{"name":"gdshader-language-server","version":"development"}}}`)
94+
expect(fmt.Sprintf(`{"jsonrpc":"2.0","id":1,"result":{"capabilities":{"textDocumentSync":{"openClose":true,"change":2},"completionProvider":{}},"serverInfo":{"name":"gdshader-language-server","version":%q}}}`, app.Version))
9395
expect(`{"jsonrpc":"2.0","id":2,"result":null}`)
9496

9597
g.Expect(stdout.String()).To(BeComparableTo(string(expected)), "Output does not match expected")

internal/app/version.go

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// MIT License
2+
//
3+
// Copyright (c) 2025 Adam Snyder
4+
//
5+
// Permission is hereby granted, free of charge, to any person obtaining a copy
6+
// of this software and associated documentation files (the "Software"), to deal
7+
// in the Software without restriction, including without limitation the rights
8+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
// copies of the Software, and to permit persons to whom the Software is
10+
// furnished to do so, subject to the following conditions:
11+
//
12+
// The above copyright notice and this permission notice shall be included in all
13+
// copies or substantial portions of the Software.
14+
//
15+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
// SOFTWARE.
22+
23+
package app
24+
25+
// Version is set by release-please.
26+
const Version = "0.0.0"

main.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@ import (
3232
"github.com/armsnyder/gdshader-language-server/internal/lsp"
3333
)
3434

35-
// Version is set by release-please.
36-
const Version = "0.0.0"
37-
3835
func main() {
3936
var flags struct {
4037
Debug bool
@@ -49,7 +46,7 @@ func main() {
4946
server := &lsp.Server{
5047
Info: lsp.ServerInfo{
5148
Name: "gdshader-language-server",
52-
Version: Version,
49+
Version: app.Version,
5350
},
5451
Handler: &app.Handler{},
5552
}

0 commit comments

Comments
 (0)