-
Notifications
You must be signed in to change notification settings - Fork 884
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 test for repair table script #2065
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2065 +/- ##
==========================================
+ Coverage 90.01% 90.24% +0.23%
==========================================
Files 210 211 +1
Lines 33255 33643 +388
==========================================
+ Hits 29933 30361 +428
+ Misses 3322 3282 -40
Continue to review full report at Codecov.
|
8940810
to
51aea09
Compare
There is one unfortunate situation in that we need to have two copies of the repair script. I fear that might result in mistakes when one script is updated but not the other. Include commands do not work with the update scripts, but we could have version-specific pre- and post-scripts and use these to generate the actual scripts in a similar way to have |
This commit copies out the repair query into a separate file and turns it into a procedure. This will allow the repair query to be tested separately using `pg_regress`. It also adds a test script for the repair procedure and will remove different sorts of dimensions and see that they can be properly repaired. It also contain a fix for the timestamp parsing query that prevented it from handling all timestamp formats and a fix so that if many chunks refer to the same dimension slice, it might generate duplicate rows.
51aea09
to
f81ce58
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't seem right to me that the update script is tested in a regression test. Why isn't it part of the update test?
The odd thing is that this is a script that needs to run only once on upgrades of specific versions of the database, so it doesn't seem right that this has to run as part of our standard regression suite. It also doesn't test that the update script actually works during an update to a new version of the extension.
Not sure I follow. Pg_regress will start a clean server and test that the repair script will repair tables, so it's perfect for testing the repair script. It is not a complete test that the update script works, it just test that it can repair the dimension slice table. We already have update tests, but they cannot catch all kind of problems. They just test that a correct installation can be updated. |
I agree with @erimatnor the script is run when upgrading from 1.7.1 to 1.7.2 so there is no need in maintaining it and adjusting it to catalog changes because it needs to run in the 1.7.1 environment therefore regression tests are not the right place. |
Closing. |
This commit copies the repair query into a separate file and turns
it into a procedure. This will allow the repair query to be tested
separately using
pg_regress
. It also adds a test script for therepair procedure and will remove different sorts of dimensions and see
that they can be properly repaired.
It also contain a fix for the timestamp parsing query that prevented it
from handling all timestamp formats and a fix so that if many chunks refer to the same dimension slice, it might generate duplicate rows.