edgedb-cli icon indicating copy to clipboard operation
edgedb-cli copied to clipboard

Dodgy/buggy use of test source trees for migration tests

Open msullivan opened this issue 10 months ago • 0 comments

The migration tests (such as https://github.com/edgedb/edgedb-cli/blob/9df25ac84d6a362188d601a93de09e60a29dd422/tests/func/migrations.rs#L574-L577) run the tests against schema/migration directories inside the source tree. The migration create commands in tests will create new files in the source tree that are left in place (and ignored with https://github.com/edgedb/edgedb-cli/blob/master/tests/.gitignore)

To make things work if the tests are run more than once, at the start of the tests they attempt to delete the migrations.

This makes them fragile, though, in combination with putting hashes in the file names now. I've been getting failures on modified3_interactive because, at least locally for me, we now generate 00002-m1nnddt.edgeql as the second migration file, which isn't what the test expects. This never shows up in CI, because it only runs the tests once.

I think the correct approach is to copy the folders into the a tmp directory.

msullivan avatar Apr 02 '24 22:04 msullivan