stripe / pg-schema-diff

Go library for diffing Postgres schemas and generating SQL migrations
MIT License
316 stars 23 forks source link

Improve testing #31

Closed bplunkett-stripe closed 1 year ago

bplunkett-stripe commented 1 year ago

Description

Motivation

Improve (UX) for testing

Example of workflow logs filled with checkpoint logging:

2023-06-13T19:27:25.4226255Z === RUN   TestAcceptanceSuite/TestCheckConstraintAcceptanceTestCases/No-op/vanilla
2023-06-13T19:27:25.7390204Z 2023-06-13 19:27:25.738 UTC [2370] LOG:  checkpoint starting: immediate force wait
2023-06-13T19:27:26.0039876Z 2023-06-13 19:27:26.003 UTC [2370] LOG:  checkpoint complete: wrote 912 buffers (5.6%); 1 WAL file(s) added, 0 removed, 0 recycled; write=0.015 s, sync=0.210 s, total=0.265 s; sync files=250, longest=0.021 s, average=0.001 s; distance=8332 kB, estimate=8332 kB
2023-06-13T19:27:26.1023881Z 2023-06-13 19:27:26.101 UTC [2370] LOG:  checkpoint starting: immediate force wait
2023-06-13T19:27:26.1074002Z 2023-06-13 19:27:26.106 UTC [2370] LOG:  checkpoint complete: wrote 4 buffers (0.0%); 0 WAL file(s) added, 0 removed, 1 recycled; write=0.001 s, sync=0.002 s, total=0.006 s; sync files=4, longest=0.001 s, average=0.001 s; distance=4166 kB, estimate=7916 kB
2023-06-13T19:27:26.3794226Z 2023-06-13 19:27:26.378 UTC [2370] LOG:  checkpoint starting: immediate force wait
2023-06-13T19:27:26.3859755Z 2023-06-13 19:27:26.385 UTC [2370] LOG:  checkpoint complete: wrote 10 buffers (0.1%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.002 s, sync=0.003 s, total=0.008 s; sync files=10, longest=0.001 s, average=0.001 s; distance=4170 kB, estimate=7541 kB
2023-06-13T19:27:26.4792037Z 2023-06-13 19:27:26.478 UTC [2370] LOG:  checkpoint starting: immediate force wait
2023-06-13T19:27:26.4842384Z 2023-06-13 19:27:26.483 UTC [2370] LOG:  checkpoint complete: wrote 4 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.001 s, sync=0.002 s, total=0.006 s; sync files=4, longest=0.001 s, average=0.001 s; distance=4165 kB, estimate=7204 kB
2023-06-13T19:27:26.5821996Z 2023-06-13 19:27:26.581 UTC [2370] LOG:  checkpoint starting: immediate force wait
2023-06-13T19:27:26.5871177Z 2023-06-13 19:27:26.586 UTC [2370] LOG:  checkpoint complete: wrote 4 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.002 s, sync=0.002 s, total=0.006 s; sync files=4, longest=0.001 s, average=0.001 s; distance=4167 kB, estimate=6900 kB
2023-06-13T19:27:26.6043793Z 2023-06-13 19:27:26.604 UTC [2370] LOG:  checkpoint starting: immediate force wait
2023-06-13T19:27:26.6093243Z 2023-06-13 19:27:26.608 UTC [2370] LOG:  checkpoint complete: wrote 2 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.001 s, sync=0.001 s, total=0.005 s; sync files=2, longest=0.001 s, average=0.001 s; distance=2 kB, estimate=6210 kB

Testing

Passes Github actions