Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests to check all pages load without errors (in different situations) #809

Open
hyanwong opened this issue Apr 17, 2024 · 2 comments
Open

Comments

@hyanwong
Copy link
Member

hyanwong commented Apr 17, 2024

We did have some (probably poorly written) tests that I wrote that spidered through the OneZoom site to check all the pages were working (e.g. broken pages caused by stuff like #779). Ideally these would also catch ajax-y type errors like #794 and #799, logging-in errors like #791, and also JS errors like #801.

@lentinj : do you know the status of this sort of testing? Is there any way to start setting up stuff to run on GH PRs that tests at least some of this (it's hard, I guess?). It worries me that we can release a site in which some of this is broken.

As a slight aside, we should also check that hard-coded OTTs, especially the ones in https://github.com/OneZoom/OZtree/blob/main/views/default/footer_sponsor_items.load, are still retained in the database (see #812 for a fix when this failed). We could perhaps do this when building a new tree, e.g. with added instructions in https://github.com/OneZoom/tree-build/blob/main/oz_tree_build/README.markdown#upload-data-to-the-server-and-check-it (point 10).

@lentinj
Copy link
Collaborator

lentinj commented Apr 18, 2024

Chrom(e|ium) headless mode has gotten rid of the faff of webdrivers, and there's various actions for github actions to handle the setup for us, but the fundamental problems that make the tests in tests/functional hard to write and brittle long-term haven't gone away.

We've talked a few times about a minimal tree MySQL dump that's part of the OZtree repo, that could be enough both for new developers to get up to speed without needing persuade a dump out somewhere, and for github actions to be able to configure MySQL and run the tests/unit tests. That would include the controllers/default test, which triggers the controller for each endpoint there.

Once that works we could think about resurrecting the functional tests. If we can make them work locally, github actions shouldn't be too much of a stretch.

Generically loading every page and seeing if there's Javascript errors won't be easy, since a page being "done" doesn't have an obvious answer, beyond something like "wait 3 seconds after the DOM is loaded". But then the tests get very slow, and a github action on every commit is probably the wrong approach.

@lentinj
Copy link
Collaborator

lentinj commented Apr 18, 2024

check that hard-coded OTTs . . . are still retained in the database

This is somewhat similar to the discussion in #742, although having a custom default startpoint was abandoned in the end, configuring these hardcoded OTTs in tree-build-land does feel like the right place for them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants