Skip to content

ci: measure test coverage and publish it to Coveralls - #3774

Open
nigrosimone wants to merge 1 commit into
brianc:masterfrom
nigrosimone:coverage-script
Open

nigrosimone wants to merge 1 commit into
brianc:masterfrom
nigrosimone:coverage-script

Conversation

@nigrosimone

@nigrosimone nigrosimone commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Only pg-connection-string measures its test coverage today. For the other packages there is no way to see which code the tests do not touch.

This adds a root yarn coverage script that runs the whole test suite under nyc and prints one report for all packages.

---------------------------|---------|----------|---------|---------|-------------------------------
File                       | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s             
---------------------------|---------|----------|---------|---------|-------------------------------
All files                  |   90.37 |    84.33 |   89.27 |   90.88 |                               
 pg-cloudflare/src         |   38.88 |    41.02 |   37.03 |      39 |                               
  empty.ts                 |       0 |        0 |       0 |       0 |                               
  index.ts                 |   38.88 |    41.02 |   37.03 |      39 | ...23,130-148,162-166,173-181 
 pg-connection-string      |     100 |      100 |     100 |     100 |                               
  index.js                 |     100 |      100 |     100 |     100 |                               
 pg-cursor                 |    95.9 |    88.88 |   96.15 |   95.65 |                               
  index.js                 |    95.9 |    88.88 |   96.15 |   95.65 | 204-208,252                   
 pg-native                 |   88.44 |    68.34 |   93.02 |   90.87 |                               
  index.js                 |   88.44 |    68.34 |   93.02 |   90.87 | ...61,370-371,405,418,449-452 
 pg-native/lib             |   84.49 |    59.52 |   86.95 |   85.24 |                               
  build-result.js          |     100 |      100 |     100 |     100 |                               
  copy-stream.js           |    75.6 |    52.77 |      80 |   77.21 | ...07,120-121,128,134,143,147 
 pg-pool                   |   96.72 |     93.5 |   98.33 |   96.59 |                               
  index.js                 |   96.72 |     93.5 |   98.33 |   96.59 | ...14,169,257-260,354,361,457 
 pg-protocol/src           |   99.43 |    91.45 |     100 |   99.41 |                               
  buffer-reader.ts         |     100 |      100 |     100 |     100 |                               
  buffer-writer.ts         |     100 |       90 |     100 |     100 | 53                            
  index.ts                 |     100 |      100 |     100 |     100 |                               
  messages.ts              |     100 |      100 |     100 |     100 |                               
  parser.ts                |   98.63 |     90.9 |     100 |   98.59 | 89,354,377                    
  serializer.ts            |     100 |     92.5 |     100 |     100 | 193,239-240                   
 pg-query-stream/src       |     100 |      100 |     100 |     100 |                               
  index.ts                 |     100 |      100 |     100 |     100 |                               
 pg/lib                    |   92.34 |    89.08 |   87.42 |   92.44 |                               
  client.js                |   89.09 |    86.41 |   84.33 |   89.04 | ...02,652-655,722,740,838-839 
  connection-parameters.js |   97.93 |    93.33 |     100 |   97.91 | 133,165                       
  connection.js            |   94.28 |    93.75 |   87.87 |   94.28 | 35,141,156,238-246            
  defaults.js              |     100 |    83.33 |     100 |     100 | 5                             
  index.js                 |   92.68 |       25 |     100 |   92.68 | 47,61-62                      
  query.js                 |   99.01 |      100 |   88.23 |   99.01 | 251                           
  result.js                |     100 |    91.66 |     100 |     100 | 37,101                        
  stream.js                |      50 |    35.71 |    62.5 |      50 | 41-49,69-75,80                
  type-overrides.js        |   94.44 |     90.9 |     100 |   94.44 | 18                            
  utils.js                 |   95.28 |    93.75 |     100 |      97 | 118-119,173                   
 pg/lib/crypto             |   71.42 |    59.83 |   92.85 |   72.72 |                               
  cert-signatures.js       |   42.85 |    18.91 |      80 |   43.54 | 2,9-17,61-63,67-119           
  sasl.js                  |   86.44 |    80.24 |     100 |   86.84 | ...05,211,232,243,246,249,252 
  utils.js                 |   81.81 |       25 |    87.5 |   81.81 | 42-45                         
 pg/lib/native             |   91.71 |    90.66 |   85.24 |   92.03 |                               
  client.js                |   91.94 |    88.88 |   89.36 |   92.07 | 9,168,211,359-369,404-407,419 
  index.js                 |     100 |      100 |     100 |     100 |                               
  query.js                 |   91.01 |    95.23 |   71.42 |   91.86 | 67,71,75-82                   
---------------------------|---------|----------|---------|---------|-------------------------------
Done in 172.91s.

@nigrosimone
nigrosimone marked this pull request as ready for review September 13, 2026 08:07
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.

1 participant