nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
fork

Configure Feed

Select the types of activity you want to include in your feed.

tt-rss: More comprehensive test

gileri e09c54ce 2cc6ef5b

+30 -1
+20 -1
nixos/tests/web-apps/tt-rss.nix
··· 10 10 enable = true; 11 11 virtualHost = "localhost"; 12 12 selfUrlPath = "http://localhost/"; 13 + pluginPackages = with pkgs; [ 14 + tt-rss-plugin-auth-ldap 15 + ]; 13 16 singleUserMode = true; 17 + themePackages = with pkgs; [ tt-rss-theme-feedly ]; 14 18 }; 15 19 }; 16 20 17 21 testScript = '' 22 + import json 23 + import re 18 24 machine.wait_for_unit("tt-rss.service") 19 - machine.succeed("curl -sSfL http://localhost/ | grep 'Tiny Tiny RSS'") 25 + 26 + matches = re.search('__csrf_token = "([^"]*)"', machine.succeed("curl -sSfL --cookie cjar --cookie-jar cjar -sSfL http://localhost/")) 27 + if matches is None: 28 + assert False, "CSRF token not found" 29 + csrf_token = matches.group(1) 30 + 31 + # Ensure themes are loaded. No API found for these, so it's a crude check. 32 + preference_page = machine.succeed("curl -sSfL --cookie cjar --cookie-jar cjar http://localhost/backend.php?op=Pref_Prefs") 33 + assert "feedly" in preference_page 34 + 35 + plugins = json.loads(machine.succeed(f"curl -sSfL --cookie cjar --cookie-jar cjar 'http://localhost/backend.php' -X POST --data-raw 'op=Pref_Prefs&method=getPluginsList&csrf_token={csrf_token}'"))["plugins"] 36 + expected_plugins = ["auth_ldap"]; 37 + found_plugins = [p["name"] for p in plugins if p["name"] in expected_plugins] 38 + assert len(found_plugins) == len(expected_plugins), f"Expected plugins {expected_plugins}, found {found_plugins}" 20 39 ''; 21 40 } 22 41 )
+5
pkgs/by-name/tt/tt-rss-plugin-auth-ldap/package.nix
··· 1 1 { 2 2 lib, 3 + nixosTests, 3 4 stdenv, 4 5 fetchFromGitHub, 5 6 }: ··· 19 18 installPhase = '' 20 19 install -D plugins/auth_ldap/init.php $out/auth_ldap/init.php 21 20 ''; 21 + 22 + passthru = { 23 + tests = { inherit (nixosTests) tt-rss; }; 24 + }; 22 25 23 26 meta = with lib; { 24 27 description = "Plugin for TT-RSS to authenticate users via ldap";
+5
pkgs/by-name/tt/tt-rss-theme-feedly/package.nix
··· 1 1 { 2 2 lib, 3 + nixosTests, 3 4 stdenv, 4 5 fetchFromGitHub, 5 6 }: ··· 23 22 24 23 cp -ra feedly *.css $out 25 24 ''; 25 + 26 + passthru = { 27 + tests = { inherit (nixosTests) tt-rss; }; 28 + }; 26 29 27 30 meta = with lib; { 28 31 description = "Feedly theme for Tiny Tiny RSS";