aboutsummaryrefslogtreecommitdiffstats
path: root/tests
AgeCommit message (Collapse)Author
2021-04-21Add SPDX license headers to layerindex-web source filesMeh Mbeh Ida Delphine
Added SPDX identifiers to all .py files except those in migrations directory. Fixes: [YOCTO #13527] Signed-off-by: Meh Mbeh Ida Delphine <idadelm@gmail.com> Signed-off-by: Paul Eggleton <bluelightning@bluelightning.org>
2018-07-19Add minimal tests for update scriptPaul Eggleton
Up to this point we haven't had any regression tests for the layer index, but the application (in particular the update script) has become rather complicated, and we have had a few regressions, so here are some tests. I've implemented them using pytest and pytest-django; I chose pytest since we are starting from scratch here and I like the idea of pytest's fixtures among other features. Annoyingly though because of our use of separate scripts that need to perform database operations I had to hack around some of the behaviour of pytest-django, which is clearly not designed with this kind of structure in mind, but that's taken care of now. Note that I've only considered backend testing for the moment, there's not yet a strategy for testing the UI. To run the tests you simply run "pytest" in the root of the repository. You will need to have a working configuration set in settings.py (a database needs to be set, but won't actually be used), and if you're using MariaDB/MySQL then you'll need the READ COMMITTED transaction isolation mode selected. At the moment there are only a few basic tests for the update script and a bunch of comments describing some we should add. The tests use a newly added synthetic meta-layerindex-test layer on git.yoctoproject.org so we can have something with known and fairly static content. I expect we will extend these tests in the near future. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>