freetube: add test

This change fixes ofborg eval error
This commit is contained in:
Kirill Radzikhovskyy 2023-10-30 06:49:08 +11:00
parent 26d50f9860
commit 4eeff46bbb
3 changed files with 45 additions and 1 deletions

View file

@ -306,6 +306,7 @@ in {
forgejo = handleTest ./forgejo.nix { };
freenet = handleTest ./freenet.nix {};
freeswitch = handleTest ./freeswitch.nix {};
freetube = discoverTests (import ./freetube.nix);
freshrss-sqlite = handleTest ./freshrss-sqlite.nix {};
freshrss-pgsql = handleTest ./freshrss-pgsql.nix {};
frigate = handleTest ./frigate.nix {};

41
nixos/tests/freetube.nix Normal file
View file

@ -0,0 +1,41 @@
let
tests = {
wayland = { pkgs, ... }: {
imports = [ ./common/wayland-cage.nix ];
services.cage.program = "${pkgs.freetube}/bin/freetube";
virtualisation.memorySize = 2047;
environment.variables.NIXOS_OZONE_WL = "1";
environment.variables.DISPLAY = "do not use";
};
xorg = { pkgs, ... }: {
imports = [ ./common/user-account.nix ./common/x11.nix ];
virtualisation.memorySize = 2047;
services.xserver.enable = true;
services.xserver.displayManager.sessionCommands = ''
${pkgs.freetube}/bin/freetube
'';
test-support.displayManager.auto.user = "alice";
};
};
mkTest = name: machine:
import ./make-test-python.nix ({ pkgs, ... }: {
inherit name;
nodes = { "${name}" = machine; };
meta.maintainers = with pkgs.lib.maintainers; [ kirillrdy ];
enableOCR = true;
testScript = ''
start_all()
machine.wait_for_unit('graphical.target')
machine.wait_for_text('Your Subscription list is currently empty')
machine.send_key("ctrl-r")
machine.wait_for_text('Your Subscription list is currently empty')
machine.screenshot("main.png")
machine.send_key("ctrl-comma")
machine.wait_for_text('General Settings', timeout=30)
machine.screenshot("preferences.png")
'';
});
in
builtins.mapAttrs (k: v: mkTest k v { }) tests

View file

@ -1,4 +1,4 @@
{ stdenv, lib, fetchurl, appimageTools, makeWrapper, electron }:
{ stdenv, lib, fetchurl, appimageTools, makeWrapper, electron, nixosTests }:
stdenv.mkDerivation rec {
pname = "freetube";
@ -9,6 +9,8 @@ stdenv.mkDerivation rec {
sha256 = "add96ad3509d4d5c6d8658b005dfd046963cd6bb0a4e1f3e88f726a86c05810f";
};
passthru.tests = nixosTests.freetube;
appimageContents = appimageTools.extractType2 {
name = "${pname}-${version}";
inherit src;