Skip to content
Snippets Groups Projects
Commit 3330ead6 authored by Jean-Paul Calderone's avatar Jean-Paul Calderone
Browse files

let me control what tests run

parent 4a8d6deb
No related branches found
No related tags found
1 merge request!52Check passes in add_lease
{ pkgs ? import ./nixpkgs.nix { }, hypothesisProfile ? null, collectCoverage ? false }: { pkgs ? import ./nixpkgs.nix { }, hypothesisProfile ? null, collectCoverage ? false, testSuite ? null }:
pkgs.python27Packages.zkapauthorizer.override { inherit hypothesisProfile collectCoverage; } pkgs.python27Packages.zkapauthorizer.override { inherit hypothesisProfile collectCoverage testSuite; }
...@@ -3,9 +3,11 @@ ...@@ -3,9 +3,11 @@
, fixtures, testtools, hypothesis, pyflakes, treq, coverage , fixtures, testtools, hypothesis, pyflakes, treq, coverage
, hypothesisProfile ? null , hypothesisProfile ? null
, collectCoverage ? false , collectCoverage ? false
, testSuite ? null
}: }:
let let
hypothesisProfile' = if hypothesisProfile == null then "default" else hypothesisProfile; hypothesisProfile' = if hypothesisProfile == null then "default" else hypothesisProfile;
testSuite' = if testSuite == null then "_zkapauthorizer" else testSuite;
in in
buildPythonPackage rec { buildPythonPackage rec {
version = "0.0"; version = "0.0";
...@@ -45,7 +47,7 @@ buildPythonPackage rec { ...@@ -45,7 +47,7 @@ buildPythonPackage rec {
ZKAPAUTHORIZER_HYPOTHESIS_PROFILE=${hypothesisProfile'} python -m ${if collectCoverage ZKAPAUTHORIZER_HYPOTHESIS_PROFILE=${hypothesisProfile'} python -m ${if collectCoverage
then "coverage run --branch --source _zkapauthorizer,twisted.plugins.zkapauthorizer --module" then "coverage run --branch --source _zkapauthorizer,twisted.plugins.zkapauthorizer --module"
else "" else ""
} twisted.trial _zkapauthorizer } twisted.trial ${testSuite'}
runHook postCheck runHook postCheck
''; '';
...@@ -54,6 +56,7 @@ buildPythonPackage rec { ...@@ -54,6 +56,7 @@ buildPythonPackage rec {
python -m coverage html python -m coverage html
mkdir -p "$doc/share/doc/${name}" mkdir -p "$doc/share/doc/${name}"
cp -vr .coverage htmlcov "$doc/share/doc/${name}" cp -vr .coverage htmlcov "$doc/share/doc/${name}"
python -m coverage report
'' ''
else ""; else "";
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment