Skip to content

Commit

Permalink
Merge pull request #2 from thiagokokada/run-testVm-in-ci
Browse files Browse the repository at this point in the history
.github/nix: init
  • Loading branch information
thiagokokada authored Jul 23, 2024
2 parents e35c92f + b4f028e commit 9b856dc
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 10 deletions.
1 change: 0 additions & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ on:
branches: [ "main" ]

jobs:

build:
runs-on: ubuntu-latest
steps:
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/nix.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: "Test"

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: DeterminateSystems/nix-installer-action@main

- uses: DeterminateSystems/magic-nix-cache-action@main

- run: nix flake check -L
12 changes: 6 additions & 6 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,10 @@
"-m 4G"
"-vga none"
"-device virtio-gpu-pci"
#"-device virtio-vga-gl"
#"-display gtk,gl=on"
# needs qemu_full:
# "-device virtio-vga-gl"
# "-display egl-headless,gl=core"
# "-display gtk,gl=on"
];
};

Expand All @@ -87,7 +89,7 @@
# bash
''
cd ${./.}
go test -short -v 2>&1 | tee -a "$HOME/test.log"
go test -v 2>&1 | tee -a "$HOME/test.log"
echo $? > "$HOME/test-finished"
hyprctl dispatch exit
'';
Expand All @@ -102,9 +104,7 @@
# bash
''
if [ "$(tty)" = "/dev/tty1" ]; then
mkdir -p $HOME/.config/hypr
cp ${hyprlandConf} $HOME/.config/hypr/hyprland.conf
Hyprland
Hyprland --config ${hyprlandConf}
fi
'';
};
Expand Down
5 changes: 2 additions & 3 deletions request_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ func TestDispatch(t *testing.T) {
if testing.Short() {
t.Skip("skip slow test")
}

// Testing if we can open at least the amount of instances we asked
// Dispatch() to open.
// The reason this test exist is because Hyprland has a hidden
Expand All @@ -175,9 +174,9 @@ func TestDispatch(t *testing.T) {
// batch commands is working as expected.
// See also: prepareRequests function and MAX_COMMANDS const
const want = 35
const retries = 10
const retries = 15
t.Run(fmt.Sprintf("test_opening_%d_kitty_instances", want), func(t *testing.T) {
must1(c.Dispatch(genParams("exec kitty sh -c 'sleep 10 && exit 0'", want)...))
must1(c.Dispatch(genParams(fmt.Sprintf("exec kitty sh -c 'sleep %d && exit 0'", retries), want)...))
awid := must1(c.ActiveWorkspace()).Id
got := 0
for i := 0; i < retries; i++ {
Expand Down

0 comments on commit 9b856dc

Please sign in to comment.