diff --git a/requirements/test.in b/requirements/test.in index 88c37fa2c51926e2f0fd12b534e9bc99a53c0bd9..93cf1deaefec1eb0aaa179f111d4533fa3c8b8b7 100644 --- a/requirements/test.in +++ b/requirements/test.in @@ -2,4 +2,4 @@ coverage fixtures testtools hypothesis -flake8 +pyflakes diff --git a/tests.nix b/tests.nix index 727e4e2508c476787254d3d8dc4f11bbcb4d89da..0ac16ac8fffa8a8f96e7bf5d80092362dd117d45 100644 --- a/tests.nix +++ b/tests.nix @@ -5,7 +5,6 @@ in , pypiData ? sources.pypi-deps-db , mach-nix ? import sources.mach-nix { inherit pkgs pypiData; } , zkapauthorizer ? (import ./. { inherit pkgs pypiData mach-nix; }).zkapauthorizer -, ci-reports ? false , hypothesisProfile ? null , collectCoverage ? false , testSuite ? null @@ -28,37 +27,22 @@ in _.hypothesis.postUnpack = ""; }; in - pkgs.runCommand "zkapauthorizer-tests" { - # When running in CI, we want `nix build` to succeed and create the `result` symlink - # even if the tests fail. `succeedOnFailure` will create a `nix-support/failed` file - # with the exit code, which is read by the CI command to propogate the exit status. - succeedOnFailure = ci-reports; - } '' - ${if ci-reports then - '' - mkdir -p $out/codeclimate - flake8_args+="--format=gl-codeclimate --output-file $out/codeclimate/flake8.json" - '' - else - '' - mkdir -p $out - flake8_args+="--tee --output-file $out/flake8.txt" - '' - } + pkgs.runCommand "zkapauthorizer-tests" {} '' + mkdir -p $out + pushd ${zkapauthorizer.src} - #${python}/bin/flake8 $flake8_args ${python}/bin/pyflakes popd ZKAPAUTHORIZER_HYPOTHESIS_PROFILE=${hypothesisProfile'} ${python}/bin/python -m ${if collectCoverage - then "coverage run --debug=config --rcfile=${zkapauthorizer.src}/.coveragerc --module" - else "" - } twisted.trial ${extraTrialArgs} ${testSuite'} + then "coverage run --debug=config --rcfile=${zkapauthorizer.src}/.coveragerc --module" + else "" + } twisted.trial ${extraTrialArgs} ${testSuite'} ${lib.optionalString collectCoverage - '' - mkdir -p "$out/coverage" - cp -v .coverage.* "$out/coverage" - '' - } + '' + mkdir -p "$out/coverage" + cp -v .coverage.* "$out/coverage" + '' + } ''