From d03a0fde6ce9b33839d4d4211a020d9e20ebc6e3 Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Sat, 31 Aug 2024 18:23:18 +0100 Subject: [PATCH] request_test: check the Hyprland version in NixOS test VM --- flake.nix | 2 +- request_test.go | 9 ++++++++- request_types.go | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index 91e3996..a243d8f 100644 --- a/flake.nix +++ b/flake.nix @@ -95,7 +95,7 @@ glxinfo -B > ${glxinfoOut} || true cd ${./.} - export CI=1 + export NIX_CI=1 go test -bench=. -coverprofile ${covOut} -v ./... > ${testLog} 2>&1 go tool cover -html=${covOut} -o ${covHtml} ''; diff --git a/request_test.go b/request_test.go index a713b9e..ccba442 100644 --- a/request_test.go +++ b/request_test.go @@ -241,7 +241,7 @@ func TestConfigErrors(t *testing.T) { } func TestCursorPos(t *testing.T) { - if os.Getenv("CI") != "" { + if os.Getenv("NIX_CI") != "" { // https://github.com/NixOS/nixpkgs/issues/156067 // https://github.com/hyprwm/Hyprland/discussions/1257 t.Skip("skip test that always returns CursorPos{X:0, Y:0} in CI since we can't move cursor") @@ -388,4 +388,11 @@ func TestWorkspaces(t *testing.T) { func TestVersion(t *testing.T) { testCommand(t, c.Version, Version{}) + + if os.Getenv("NIX_CI") != "" { + // make sure that we are running the same version of Hyprland + // in NixOS VM test that we are declaring as compatible + v, _ := c.Version() + assert.Equal(t, v.Tag, "v"+HYPRLAND_VERSION) + } } diff --git a/request_types.go b/request_types.go index a5a4001..536f6e8 100644 --- a/request_types.go +++ b/request_types.go @@ -3,7 +3,7 @@ package hyprland import "net" // Indicates the version where the structs are up-to-date. -const HYPRLAND_VERSION = "0.42" +const HYPRLAND_VERSION = "0.42.0" // Represents a raw request that is passed for Hyprland's socket. type RawRequest []byte