Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
test-backend: Enable --ban-console-output and document.
Tim Abbottdbf3894c499d
diff --git a/docs/testing/testing-with-django.md b/docs/testing/testing-with-django.mdindex e7547066268..2b26d732a78 100644--- a/docs/testing/testing-with-django.md+++ b/docs/testing/testing-with-django.md@@ -436,6 +436,13 @@ code and edge cases. It will generate a nice HTML report that you canview right from your browser (the tool prints the URL where the reportis exposed in your development environment).+- **Console output** A properly written test should print nothing to+the console; use `with self.assertLogs` to capture and verify any+logging output. Note that we reconfigure various loggers in+`zproject/test_extra_settings.py` where the output is unlikely to be+interesting when running our test suite. `test-backend+--ban-console-output` checks for stray print statements.+Note that `test-backend --coverage` will assert thatvarious specific files in the project have 100% test coverage andthrow an error if their coverage has fallen. One of our project goalsdiff --git a/tools/ci/backend b/tools/ci/backendindex 3f6278ae2a7..90327300a66 100755--- a/tools/ci/backend+++ b/tools/ci/backend@@ -12,7 +12,7 @@ set -x# docker setup means the auto-detection logic sees the ~36 processes# the Docker host has, not the ~2 processes of resources we're# allocated.-./tools/test-backend --coverage --include-webhooks --no-cov-cleanup --parallel=6+./tools/test-backend --coverage --include-webhooks --no-cov-cleanup --ban-console-output --parallel=6# We run mypy after the backend tests so we get output from the# backend tests, which tend to uncover more serious problems, first.diff --git a/tools/test-all b/tools/test-allindex e897083d466..2421a98baaa 100755--- a/tools/test-all+++ b/tools/test-all@@ -49,7 +49,7 @@ run ./tools/clean-repo# ci/backendrun ./tools/lint --groups=backend $FORCEARGrun ./tools/test-tools-run ./tools/test-backend --include-webhooks $FORCEARG+run ./tools/test-backend --include-webhooks --ban-console-output $FORCEARGrun ./tools/test-migrations# Not running SVG optimizing since it's low-churn# run ./tools/setup/optimize-svg