forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitb0a55f4
committed
Add TAP test to automate the equivalent of check_guc
src/backend/utils/misc/check_guc is a script that cross-checks theconsistency of the GUCs with postgresql.conf.sample, making sure thatits format is in line with what guc.c has. It has never been runautomatically, and has rotten over the years, creating a lot of falsepositives as per a report from Justin Pryzby.d10e41d has introduced a SQL function to publish the most relevant flagsassociated to a GUC, with tests added in the main regression test suiteto make sure that we avoid most of the inconsistencies in the GUCsettings, based on recent reports, but there was nothing able tocross-check postgresql.conf.sample with the contents of guc.c.This commit adds a TAP test that covers the remaining gap. It emulatesthe most relevant checks that check_guc does, so as any format mistakesare detected in postgresql.conf.sample at development stage, with thefollowing checks:- Check that parameters marked as NOT_IN_SAMPLE are not in the samplefile.- Check that there are no dead entries in postgresql.conf.sample forparameters not marked as NOT_IN_SAMPLE.- Check that no parameters are missing from the sample file if listed inguc.c without NOT_IN_SAMPLE.The idea of building a list of the GUCs by parsing the sample file comesfrom Justin, and he wrote the regex used in the patch to find all theGUCs (this same formatting rule basically applies for the last 20~ yearsor so). In order to test this patch, I have played with manualmodifications of postgresql.conf.sample and guc.c, making sure that wedetect problems with the GUC rules and the sample file format.The test is located in src/test/modules/test_misc, which is the bestlocation I could think about for such sanity checks.Reviewed-by: Justin PryzbyDiscussion:https://postgr.es/m/Yf9YGSwPiMu0c7fP@paquier.xyz1 parentd5c2a91 commitb0a55f4
1 file changed
+108
-0
lines changedLines changed: 108 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + |
0 commit comments
Comments
(0)