Skip to content

Commit

Permalink
Merge pull request #19 from thiagokokada/check-hyprland-version-in-ni…
Browse files Browse the repository at this point in the history
…x-ci

request_test: check the Hyprland version in NixOS test VM
  • Loading branch information
thiagokokada authored Aug 31, 2024
2 parents 5b4dc25 + d03a0fd commit 6c8a305
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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}
'';
Expand Down
9 changes: 8 additions & 1 deletion request_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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)
}
}
2 changes: 1 addition & 1 deletion request_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6c8a305

Please sign in to comment.