cldellow / datasette-ui-extras

Add editing UI and other power-user features to Datasette.
Apache License 2.0
12 stars 1 forks source link

Smoke tests #84

Closed cldellow closed 1 year ago

cldellow commented 1 year ago

I think the big picture architecture is stable now. It'd be good to add at least smoke tests that validate that monkey patches haven't broken when Datasette releases new versions.

cldellow commented 1 year ago

Open question - can we integrate Cypress tests with codecov? Would be nice to get a blended picture of coverage

cldellow commented 1 year ago

Rough idea: add e2e_test_host.py that looks like:

import sys
from datasette.cli import cli

sys.exit(cli())

Have a pre-canned cooking.db that we can fetch from the web. It should be duxed already so we don't have to wait for the indexers to run.

Then as a Cypress setup step do:

coverage run -m e2e_test_host

Then do the Cypress stuff.

Then Ctrl+C the coverage process (how?)

Then we should have an accurate capture of the backend stuff.

This will have exercised the JS, but the JS is not instrumented, so we won't have coverage data... that's probably OK for the moment, though it would be nice to have a more complete picture.

cldellow commented 1 year ago

The April 2011 DIY meta dump is only 500kb as a SQLite db, let's prefer to use that for testing (vs cooking @ 35MB or superuser @ 435MB)

cldellow commented 1 year ago

That also indexes basically immediately, it has like ~3,000 rows total. I think we could use it in non-duxed form as the starting point for the tests, which would be convenient for also testing indexing.

cldellow commented 1 year ago

Fixed in https://github.com/cldellow/datasette-ui-extras/pull/91

The tests are very smokey, but I think that's a reasonable balance for the moment