All files / web/src/db/schema coverage-results.ts

100% Statements 33/33
100% Branches 0/0
100% Functions 0/0
100% Lines 33/33

Press n or j to go to the next uncovered block, b, p or k for the previous block.

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 342x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x  
import { integer, real, sqliteTable, text } from 'drizzle-orm/sqlite-core'
 
/**
 * Coverage results table
 *
 * Stores unit test coverage percentages reported by CI.
 * Used to drive Prometheus gauges and Grafana dashboards.
 */
export const coverageResults = sqliteTable('coverage_results', {
  /** Auto-increment primary key */
  id: integer('id').primaryKey({ autoIncrement: true }),
 
  /** When the coverage run was recorded */
  timestamp: integer('timestamp', { mode: 'timestamp' }).notNull(),
 
  /** Git commit SHA */
  commitSha: text('commit_sha'),
 
  /** Line coverage percentage (0-100) */
  linesPct: real('lines_pct').notNull(),
 
  /** Branch coverage percentage (0-100) */
  branchesPct: real('branches_pct').notNull(),
 
  /** Function coverage percentage (0-100) */
  functionsPct: real('functions_pct').notNull(),
 
  /** Statement coverage percentage (0-100) */
  statementsPct: real('statements_pct').notNull(),
})
 
export type CoverageResult = typeof coverageResults.$inferSelect
export type NewCoverageResult = typeof coverageResults.$inferInsert