Skip to content

test: apply track_commit_timestamp via Cmd to skip postgres restart#2951

Merged
omer-topal merged 1 commit intomasterfrom
test/postgres-test-skip-restart
May 7, 2026
Merged

test: apply track_commit_timestamp via Cmd to skip postgres restart#2951
omer-topal merged 1 commit intomasterfrom
test/postgres-test-skip-restart

Conversation

@omer-topal
Copy link
Copy Markdown
Contributor

@omer-topal omer-topal commented May 7, 2026

Summary by CodeRabbit

  • Chore
    • Simplified PostgreSQL test database initialization by passing configuration flags directly at container startup, removing an earlier multi-step approach. This streamlines the test setup process with fewer operations required during database initialization.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 7, 2026

Review Change Stack
No actionable comments were generated in the recent review. πŸŽ‰

ℹ️ Recent review info
βš™οΈ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7d2f0f18-0281-4fce-baab-2df349ef04a7

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 78e2cfb and 26af8d8.

πŸ“’ Files selected for processing (1)
  • pkg/testinstance/postgres.go

πŸ“ Walkthrough

Walkthrough

The PostgreSQL test container initialization is simplified by moving from a runtime configuration approach (in-container ALTER SYSTEM with container restart) to a startup flag approach (-c track_commit_timestamp=on). This eliminates unnecessary container manipulation and schema resets during test setup.

Changes

PostgreSQL Test Container Initialization

Layer / File(s) Summary
Startup Configuration
pkg/testinstance/postgres.go
Container Cmd is configured to pass track_commit_timestamp=on directly to the PostgreSQL server at startup.
Removed Legacy Initialization
pkg/testinstance/postgres.go
The in-container psql ALTER SYSTEM execution, container stop/restart sequence, and public schema reset via DROP/CREATE SCHEMA are removed.

Estimated Code Review Effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly Related PRs

  • Permify/permify#2950: Also modifies pkg/testinstance/postgres.go for PostgreSQL test container startup and configuration.

Poem

🐰 A rabbit hops through startup flags so bright,
No more restarts in the container night!
track_commit_timestamp now boots with grace,
Simpler init, a cleaner test space! ✨

πŸš₯ Pre-merge checks | βœ… 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
βœ… Passed checks (4 passed)
Check name Status Explanation
Description Check βœ… Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check βœ… Passed The title accurately and specifically describes the main change: applying track_commit_timestamp via the Cmd flag to skip a postgres restart, which aligns with the code modification shown in the summary.
Linked Issues check βœ… Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check βœ… Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
πŸ“ Generate docstrings
  • Create stacked PR
  • Commit on current branch
πŸ§ͺ Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/postgres-test-skip-restart

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❀️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 7, 2026

Codecov Report

βœ… All modified and coverable lines are covered by tests.
βœ… Project coverage is 82.58%. Comparing base (78e2cfb) to head (26af8d8).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2951      +/-   ##
==========================================
+ Coverage   82.57%   82.58%   +0.02%     
==========================================
  Files          74       74              
  Lines        8300     8300              
==========================================
+ Hits         6853     6854       +1     
+ Misses        911      910       -1     
  Partials      536      536              

β˜” View full report in Codecov by Sentry.
πŸ“’ Have feedback on the report? Share it here.

πŸš€ New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • πŸ“¦ JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@omer-topal omer-topal merged commit ba21b2e into master May 7, 2026
15 checks passed
@omer-topal omer-topal deleted the test/postgres-test-skip-restart branch May 7, 2026 14:12
@github-actions github-actions Bot locked and limited conversation to collaborators May 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant