Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Our Debian build scripts do not respect DEB_BUILD_OPTIONS=nocheck to skip running unit tests #9706

Closed
callahad opened this issue Mar 28, 2021 · 1 comment
Labels
good first issue Good for newcomers T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements.

Comments

@callahad
Copy link
Contributor

By convention, scripts to build Debian packages should skip running unit tests if the environment variable DEB_BUILD_OPTIONS contains the string "nocheck"

For example, dh-virtualenv specifies

if 'nocheck' in os.environ.get('DEB_BUILD_OPTIONS', ''):
    do_test = False
else:
    do_test = options.setuptools_test

But Synapse doesn't respect this.

In our debian/build_virtualenv file we always run the tests:

# we copy the tests to a temporary directory so that we can put them on the
# PYTHONPATH without putting the uninstalled synapse on the pythonpath.
tmpdir=`mktemp -d`
trap "rm -r $tmpdir" EXIT

cp -r tests "$tmpdir"

PYTHONPATH="$tmpdir" \
    "${TARGET_PYTHON}" -m twisted.trial --reporter=text -j2 tests

It would be good if that was conditional and skipped if DEB_BUILD_OPTIONS included nocheck.

It may be that this should go in our debian/rules file under override_dh_auto_test: or similar, instead of in the debian/build_virtualenv file.

@callahad callahad added good first issue Good for newcomers T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements. labels Mar 28, 2021
@richvdh
Copy link
Member

richvdh commented Jul 14, 2021

Looks like this was fixed in #9793.

@richvdh richvdh closed this as completed Jul 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Good for newcomers T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements.
Projects
None yet
Development

No branches or pull requests

2 participants