From e18d57074dd5a23e0e48af50a905c742ad79ff31 Mon Sep 17 00:00:00 2001 From: Myzel394 <50424412+Myzel394@users.noreply.github.com> Date: Sun, 15 Sep 2024 18:07:57 +0200 Subject: [PATCH] fix: Fix tests --- .github/workflows/pr-tests.yaml | 4 ++-- flake.nix | 2 +- handlers/wireguard/commands/wg-commands_test.go | 8 ++++++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr-tests.yaml b/.github/workflows/pr-tests.yaml index 71a2213..02eee42 100644 --- a/.github/workflows/pr-tests.yaml +++ b/.github/workflows/pr-tests.yaml @@ -19,6 +19,6 @@ jobs: - name: Check Nix flake run: nix flake check - - name: Run tests - run: nix develop --command bash -c 'go test ./...' + - name: Build app + run: nix build -L diff --git a/flake.nix b/flake.nix index e0ffd36..d9d7af0 100644 --- a/flake.nix +++ b/flake.nix @@ -34,7 +34,7 @@ pname = "github.com/Myzel394/config-lsp"; version = "v0.0.1"; src = ./.; - vendorHash = "sha256-KhyqogTyb3jNrGP+0Zmn/nfx+WxzjgcrFOp2vivFgT0="; + vendorHash = "sha256-PUVmhdbmfy1FaSzLt3SIK0MtWezsjb+PL+Z5YxMMhdw="; checkPhase = '' go test -v $(pwd)/... ''; diff --git a/handlers/wireguard/commands/wg-commands_test.go b/handlers/wireguard/commands/wg-commands_test.go index 350cf91..874b840 100644 --- a/handlers/wireguard/commands/wg-commands_test.go +++ b/handlers/wireguard/commands/wg-commands_test.go @@ -13,6 +13,10 @@ func TestWireguardAvailable( func TestWireguardPrivateKey( t *testing.T, ) { + if !AreWireguardToolsAvailable() { + t.Skip("Wireguard tools not available") + } + privateKey, err := CreateNewPrivateKey() if err != nil { @@ -25,6 +29,10 @@ func TestWireguardPrivateKey( func TestWireguardPublicKey( t *testing.T, ) { + if !AreWireguardToolsAvailable() { + t.Skip("Wireguard tools not available") + } + privateKey := "UPBKR0kLF2C/+Ei5fwN5KHsAcon9xfBX+RWhebYFGWg=" publicKey, err := CreatePublicKey(privateKey)