Open Bug 1712169 Opened 3 years ago

let execution of tests in tests/webapp/ with test folder provided pass

Categories

(Tree Management :: Treeherder, defect)

defect

Tracking

(Not tracked)

People

(Reporter: aryx, Unassigned)

Details

Execution of docker-compose run backend pytest tests/webapp/ fails all test while the documentation mentions this as the recommended way to run all tests in a folder.

The same issue applies to individual tests:

docker-compose run backend pytest tests/webapp/ -k test_auth
Creating treeherder_backend_run ... done
-----> MySQL service is available
======================================================= test session starts =======================================================platform linux -- Python 3.7.10, pytest-6.2.2, py-1.10.0, pluggy-0.13.1
django: settings: tests.settings (from ini)
rootdir: /app, configfile: setup.cfg
plugins: freezegun-0.4.2, asyncio-0.14.0, betamax-0.8.1, cov-2.11.1, django-4.1.0, testmon-1.1.0, celery-4.4.2
collected 191 items / 167 deselected / 24 selected

tests/webapp/api/test_auth.py FFFFFFFF                                                                                      [ 33%] tests/webapp/api/test_performance_alertsummary_api.py F                                                                     [ 37%] tests/webapp/api/test_auth.py ..FFFFFFFFFFFFF                                                                               [100%]

============================================================ FAILURES =============================================================________________ test_login_logout_relogin[ad|Mozilla-LDAP|email-from-test-mozilla-ldap/email-from-test] ________________

self = <Variable: 'panel.content'>
context = [{'True': True, 'False': False, 'None': None}, {'toolbar': <debug_toolbar.toolbar.DebugToolbar object at 0x7f0db16ea790>}]

    def _resolve_lookup(self, context):
        """
        Perform resolution of a real variable (i.e. not a literal) against the
        given context.

        As indicated by the method's name, this method is an implementation
        detail and shouldn't be called by external code. Use Variable.resolve()
        instead.
        """
        current = context
        try:  # catch-all for silent variable failures
            for bit in self.lookups:
                try:  # dictionary lookup
>                   current = current[bit]
E                   TypeError: 'HistoryPanel' object is not subscriptable

/usr/local/lib/python3.7/site-packages/django/template/base.py:829: TypeError

Running the complete set of tests lets also the webapp tests pass.

You need to log in before you can comment on or make changes to this bug.