tetra icon indicating copy to clipboard operation
tetra copied to clipboard

Missing tests

Open nerdoc opened this issue 3 years ago • 5 comments
trafficstars

There are no tests in tetra.

If you tell me what testing framework you prefer (Django unit tests, pytest/pytest-django, etc.) I can help at least with adding some backend tests, , e.g. using the demo site.

  • [x] test framework setup
  • [x] (at least some) backend tests
  • [ ] (at least some) frontend tests

nerdoc avatar Oct 02 '22 19:10 nerdoc

Ha, yes. Thats a little embarrassing really...

PyTest (with Playwright for integration) are my preferred tools.

Something I want to do I provide a simple way for devs to setup PyTest/Playwright for their own Tetra components.

samwillis avatar Oct 03 '22 21:10 samwillis

Do you want to include tests into the demosite, as there already is a django project to use for tests? I always had problems setting up pytest "standalone", without a full django project (just with those runtests.py, conftest.py etc).

nerdoc avatar Oct 03 '22 22:10 nerdoc

@nerdoc Did you ever start with the tests? Did you also plan to add a CI setup?

If it helps, I could add something like this as a test infrastructure:

  • Packaging setup all in pyproject.toml (replacing setup.py)
  • Test setup with Tox (linting and test execution against all supported Python versions in tox.ini)
  • CI with GHA (using the Tox environments to run linting and tests)

The setup would be similar to what you can find in this Django project example, but with GHA for GitHub.

Interested?

bittner avatar Sep 19 '23 13:09 bittner

HM, no. As tetra seems to be dead (at least Sam seems to have no time for maintaining it), I switched to using HTMX...

nerdoc avatar Sep 20 '23 12:09 nerdoc

@bittner Wind is changing again ;-) As I took over the development of tetra, I added basic tests, at least for some of the blocks and backend things, see in the "tetra-package" branch (soon to be merged).

I never used tox, but the tests are run with pytest ATM. CI in GH is set up and working as well.

I don't know well how to test the frontend parts. I've never used a Js frontent test engine. MochaJs (X,=nodejs), Jest(X, more for React etc), Jasmine(BDD!), Karma(needs Browser?), Cypress(component testing!!, supported by PyCharm IDE), Selenium (uuuaaargh...)

nerdoc avatar Apr 09 '24 21:04 nerdoc