geldata / geldata/gel-cli

Dodgy/buggy use of test source trees for migration tests

Open
#1,279 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
175
Forks
32
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.