fix: Fix tests

This commit is contained in:
Myzel394 2024-09-15 18:07:57 +02:00
parent 1bda1f76e0
commit e18d57074d
No known key found for this signature in database
GPG Key ID: DEC4AAB876F73185
3 changed files with 11 additions and 3 deletions

View File

@ -19,6 +19,6 @@ jobs:
- name: Check Nix flake - name: Check Nix flake
run: nix flake check run: nix flake check
- name: Run tests - name: Build app
run: nix develop --command bash -c 'go test ./...' run: nix build -L

View File

@ -34,7 +34,7 @@
pname = "github.com/Myzel394/config-lsp"; pname = "github.com/Myzel394/config-lsp";
version = "v0.0.1"; version = "v0.0.1";
src = ./.; src = ./.;
vendorHash = "sha256-KhyqogTyb3jNrGP+0Zmn/nfx+WxzjgcrFOp2vivFgT0="; vendorHash = "sha256-PUVmhdbmfy1FaSzLt3SIK0MtWezsjb+PL+Z5YxMMhdw=";
checkPhase = '' checkPhase = ''
go test -v $(pwd)/... go test -v $(pwd)/...
''; '';

View File

@ -13,6 +13,10 @@ func TestWireguardAvailable(
func TestWireguardPrivateKey( func TestWireguardPrivateKey(
t *testing.T, t *testing.T,
) { ) {
if !AreWireguardToolsAvailable() {
t.Skip("Wireguard tools not available")
}
privateKey, err := CreateNewPrivateKey() privateKey, err := CreateNewPrivateKey()
if err != nil { if err != nil {
@ -25,6 +29,10 @@ func TestWireguardPrivateKey(
func TestWireguardPublicKey( func TestWireguardPublicKey(
t *testing.T, t *testing.T,
) { ) {
if !AreWireguardToolsAvailable() {
t.Skip("Wireguard tools not available")
}
privateKey := "UPBKR0kLF2C/+Ei5fwN5KHsAcon9xfBX+RWhebYFGWg=" privateKey := "UPBKR0kLF2C/+Ei5fwN5KHsAcon9xfBX+RWhebYFGWg="
publicKey, err := CreatePublicKey(privateKey) publicKey, err := CreatePublicKey(privateKey)