Skip to content

Commit

Permalink
irrd: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yu-re-ka committed Jul 14, 2023
1 parent 421c9eb commit 7da2bb2
Showing 1 changed file with 26 additions and 9 deletions.
35 changes: 26 additions & 9 deletions pkgs/servers/irrd/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
, python3
, fetchPypi
, git
, postgresql
, postgresqlTestHook
, redis
}:

let
Expand Down Expand Up @@ -85,16 +88,12 @@ buildPythonPackage rec {
nativeCheckInputs = [
pytestCheckHook
git
pytest
pytest-cov
pytest-env
coverage
twisted
python-graphql-client
pytest-asyncio
freezegun
pytest-freezegun
sqlalchemy

redis
postgresql
postgresqlTestHook
];

propagatedBuildInputs = [
Expand All @@ -109,7 +108,7 @@ buildPythonPackage rec {
setproctitle
python-daemon
pid
redis
py.pkgs.redis
hiredis
coredis
requests
Expand All @@ -130,6 +129,24 @@ buildPythonPackage rec {
websockets
] ++ uvicorn.optional-dependencies.standard;

preCheck = ''
redis-server &
while ! redis-cli --scan ; do
echo waiting for redis
sleep 1
done
export IRRD_DATABASE_URL="postgres:///$PGDATABASE"
export IRRD_REDIS_URL="redis://localhost/1"
'';

# skip tests that require internet access
pytestFlagsArray = [
"--deselect=irrd/scripts/tests/test_irr_rpsl_submit.py::Test900Command::test_020_dash_o_noop"
"--deselect=irrd/scripts/tests/test_irr_rpsl_submit.py::Test900Command::test_050_non_json_response"
];

meta = with lib; {
description = "An IRR database server, processing IRR objects in the RPSL format";
license = licenses.mit;
Expand Down

0 comments on commit 7da2bb2

Please sign in to comment.