Page MenuHomeSoftware Heritage

functional tests for the web UI, with actual data
Closed, MigratedEdits Locked

Description

We don't really have functional test for the Web UI right now, we only test some of its units.
We should add proper end-to-end functional tests.

To do so we need to

  1. either, augment storage-testdata with actual data and deploy a storage backend when running the web UI testsuite,
  2. or, use object mocking to simulate the existence of the storage backend

Related Objects

Event Timeline

zack raised the priority of this task from to Normal.
zack updated the task description. (Show Details)
zack added projects: Web app, Developers.

FWIW, my preference is for (2), i.e., object mocking.

ardumont raised the priority of this task from Normal to High.

swh-web-ui is now using mocks (standard lib in python3 - unittest.mock).

It's not end-to-end tests yet.
Still, the coverage has improved from api (controller.py) to service modules (service.py).

(The part not well covered for the moment are the generated html pages)

ardumont lowered the priority of this task from High to Normal.Nov 13 2015, 2:56 PM

Since T223, controller has been split in 2 and both api and views (T224) are covered the unit test way.

State on swh-web-ui coverage:

Name Stmts Miss Cover Missing

swh.web.ui 0 0 100%
swh.web.ui.api 59 3 95% 29, 41, 275
swh.web.ui.converters 36 1 97% 13
swh.web.ui.errorhandler 7 0 100%
swh.web.ui.exc 6 0 100%
swh.web.ui.main 48 33 31% 38-48, 64-69, 75-89, 110-128
swh.web.ui.query 27 3 89% 44, 48, 57
swh.web.ui.renderers 44 0 100%
swh.web.ui.service 80 5 94% 121, 154, 172, 178, 215
swh.web.ui.upload 29 0 100%
swh.web.ui.utils 32 0 100%

swh.web.ui.views 91 2 98% 27-30

TOTAL 459 47 90%

Ran 101 tests in 0.405s

OK

olasd changed the visibility from "All Users" to "Public (No Login Required)".May 13 2016, 5:07 PM