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 more substantial tests for compute migrations #9811

Merged
merged 1 commit into from
Jan 2, 2025

Conversation

tristan957
Copy link
Member

The previous tests really didn't do much. This set should be quite a bit more encompassing.

@tristan957
Copy link
Member Author

One thing worth calling out: is the format of the migration plpsql tests what we want? Would it make more sense to do something like "if neon_superuser is granted access to func_xyz, write a SQL query for func_xyz?"

Copy link

github-actions bot commented Nov 19, 2024

7242 tests run: 6890 passed, 0 failed, 352 skipped (full report)


Flaky tests (6)

Postgres 17

Postgres 14

Code coverage* (full report)

  • functions: 31.2% (8398 of 26879 functions)
  • lines: 47.9% (66688 of 139094 lines)

* collected from Rust tests only


The comment gets automatically updated with the latest test results
b34260a at 2024-12-23T17:26:30.663Z :recycle:

Copy link

@clipperhouse clipperhouse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don’t think control plane has anything to say here, so LGTM.

@clipperhouse clipperhouse removed the request for review from NanoBjorn November 20, 2024 01:11
Copy link
Member

@ololobus ololobus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some suggestions, but otherwise looks great!

compute_tools/src/migration.rs Outdated Show resolved Hide resolved
test_runner/regress/test_compute_migrations.py Outdated Show resolved Hide resolved
test_runner/regress/test_compute_migrations.py Outdated Show resolved Hide resolved
test_runner/regress/test_compute_migrations.py Outdated Show resolved Hide resolved
compute_tools/src/compute.rs Outdated Show resolved Hide resolved
@tristan957 tristan957 force-pushed the tristan957/migrations branch from 6fa910d to 2d5d92c Compare December 19, 2024 06:30
@tristan957
Copy link
Member Author

I think this is pretty good. Perhaps we could add one more test which tests the following scenario:

BEGIN;
-- Run migration
-- Fail, causing transaction ABORT
-- Update migration ID
COMMIT;

and maybe

BEGIN;
-- Run migration
-- Update migration ID
-- Fail, causing transaction ABORT
COMMIT;

The purpose would be to make sure that the two operations (running the migration and updating the persisted migration ID) are transactional. Let me know if that sounds worthwhile, and I will add it.

@tristan957 tristan957 force-pushed the tristan957/migrations branch from 2d5d92c to dfe6cc3 Compare December 19, 2024 06:37
@tristan957
Copy link
Member Author

Of course when you're reading directory entries they aren't sorted 😆

@tristan957 tristan957 force-pushed the tristan957/migrations branch from dfe6cc3 to 183df72 Compare December 19, 2024 16:06
Copy link
Member

@ololobus ololobus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really good to me. See my final comment and I think it's ready for merge

compute_tools/src/migration.rs Outdated Show resolved Hide resolved
compute_tools/src/migration.rs Show resolved Hide resolved
The previous tests really didn't do much. This set should be quite a bit
more encompassing.

Signed-off-by: Tristan Partin <[email protected]>
@tristan957 tristan957 force-pushed the tristan957/migrations branch from 183df72 to b34260a Compare December 23, 2024 16:02
@tristan957 tristan957 added this pull request to the merge queue Jan 2, 2025
Merged via the queue into main with commit 363ea97 Jan 2, 2025
83 checks passed
@tristan957 tristan957 deleted the tristan957/migrations branch January 2, 2025 18:39
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

Successfully merging this pull request may close these issues.

3 participants