rss-bridge: Add simple NixOS test

Add a simple test that starts rss-bridge and tries to fetch the feed of
a demo bridge. On success we know the system setup (web server, PHP) and
rss-bridge are working fine. Internet access is avoided by using a demo
bridge.
This commit is contained in:
Mynacol 2024-07-31 15:17:50 +02:00
parent 73b80cba20
commit b444a0e028
3 changed files with 28 additions and 1 deletions

View File

@ -847,6 +847,7 @@ in {
rshim = handleTest ./rshim.nix {};
rspamd = handleTest ./rspamd.nix {};
rspamd-trainer = handleTest ./rspamd-trainer.nix {};
rss-bridge = handleTest ./web-apps/rss-bridge.nix {};
rss2email = handleTest ./rss2email.nix {};
rstudio-server = handleTest ./rstudio-server.nix {};
rsyncd = handleTest ./rsyncd.nix {};

View File

@ -0,0 +1,22 @@
{ pkgs, ... }:
{
name = "rss-bridge";
meta.maintainers = with pkgs.lib.maintainers; [ mynacol ];
nodes.machine =
{ ... }:
{
services.rss-bridge = {
enable = true;
};
};
testScript = ''
start_all()
machine.wait_for_unit("nginx.service")
machine.wait_for_unit("phpfpm-rss-bridge.service")
# check for successful feed download
machine.succeed("curl -sS -f 'http://localhost/?action=display&bridge=DemoBridge&context=testCheckbox&format=Atom'")
'';
}

View File

@ -1,4 +1,4 @@
{ stdenv, lib, fetchFromGitHub }:
{ stdenv, lib, fetchFromGitHub, nixosTests }:
stdenv.mkDerivation rec {
pname = "rss-bridge";
@ -20,6 +20,10 @@ stdenv.mkDerivation rec {
cp -R ./* $out
'';
passthru.tests = {
basic-functionality = nixosTests.rss-bridge;
};
meta = with lib; {
description = "RSS feed for websites missing it";
homepage = "https://github.com/RSS-Bridge/rss-bridge";