Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
This repository was 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

@callahad

Description

@callahad

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-EnhancementNew features, changes in functionality, improvements in performance, or user-facing enhancements.good first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions