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

Dodgy/buggy use of test source trees for migration tests #1279

Open
msullivan opened this issue Apr 2, 2024 · 0 comments
Open

Dodgy/buggy use of test source trees for migration tests #1279

msullivan opened this issue Apr 2, 2024 · 0 comments

Comments

@msullivan
Copy link
Member

The migration tests (such as

#[test]
fn modified3_interactive() -> anyhow::Result<()> {
fs::remove_file("tests/migrations/db1/modified3/migrations/00002-m1czhvu.edgeql")
.ok();
) 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.

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

1 participant