[PR #6224] [MERGED] ci: actually run the PostgreSQL schema and migration tests #6187

Closed
opened 2026-11-02 04:06:58 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/6224
Author: @n0ctal
Created: 8/16/2026
Status: ✅ Merged
Merged: 8/18/2026
Merged by: @MHSanaei

Base: main ← Head: upstream-run-postgres-schema-tests


📝 Commits (2)

  • ac36e60 ci: actually run the PostgreSQL schema and migration tests
  • 5d82d63 ci: make the PostgreSQL guard fail on a renamed test, and self-test the workflow

📊 Changes

2 files changed (+23 additions, -3 deletions)

View changed files

📝 .github/workflows/ci.yml (+23 -3)
➕ internal/web/dist/.gitkeep (+0 -0)

📄 Description

Summary

TestHostAutoMigrateCreatesColumns_Postgres and TestMigrate_Postgres guard the PostgreSQL schema and the migration path, and both t.Skip unless XUI_DB_TYPE / XUI_DB_DSN are set. CI sets those only for the durable-first step, so neither test has ever executed — a green pipeline currently says nothing about either path.

Why

The tests exist and are maintained, so the intent is clearly that they run. Right now a PostgreSQL schema regression reaches a release with CI fully green, and the skip is invisible: go test reports ok for the package either way.

The postgres-durable-first job already provisions a PostgreSQL 16 service, so no new infrastructure is needed — the DSN just has to reach these two tests as well.

Scope

One step added to the existing job, mirroring the pattern already used one step above: run the two tests against the running service and fail if either reports --- SKIP.

The skip guard matters as much as the run: without it, a future rename of a test or of an environment variable would silently return the job to testing nothing, which is the failure mode this PR is fixing.

Validation

Locally, against a PostgreSQL 16 instance:

condition result
no DSN (today's CI) 2 tests SKIP
DSN set (this change) 2 tests PASS, 0 SKIP

Risk

Low. No production code changes, no new services, and the added step can only fail if these tests genuinely fail or silently stop running.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/MHSanaei/3x-ui/pull/6224 **Author:** [@n0ctal](https://github.com/n0ctal) **Created:** 8/16/2026 **Status:** ✅ Merged **Merged:** 8/18/2026 **Merged by:** [@MHSanaei](https://github.com/MHSanaei) **Base:** `main` ← **Head:** `upstream-run-postgres-schema-tests` --- ### 📝 Commits (2) - [`ac36e60`](https://github.com/MHSanaei/3x-ui/commit/ac36e6011d2b65342dca8da9b47f906ae252a5d3) ci: actually run the PostgreSQL schema and migration tests - [`5d82d63`](https://github.com/MHSanaei/3x-ui/commit/5d82d6396b8d5f95c383162889d9ea139d1d2a35) ci: make the PostgreSQL guard fail on a renamed test, and self-test the workflow ### 📊 Changes **2 files changed** (+23 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/ci.yml` (+23 -3) ➕ `internal/web/dist/.gitkeep` (+0 -0) </details> ### 📄 Description ## Summary `TestHostAutoMigrateCreatesColumns_Postgres` and `TestMigrate_Postgres` guard the PostgreSQL schema and the migration path, and both `t.Skip` unless `XUI_DB_TYPE` / `XUI_DB_DSN` are set. CI sets those only for the durable-first step, so neither test has ever executed — a green pipeline currently says nothing about either path. ## Why The tests exist and are maintained, so the intent is clearly that they run. Right now a PostgreSQL schema regression reaches a release with CI fully green, and the skip is invisible: `go test` reports `ok` for the package either way. The `postgres-durable-first` job already provisions a PostgreSQL 16 service, so no new infrastructure is needed — the DSN just has to reach these two tests as well. ## Scope One step added to the existing job, mirroring the pattern already used one step above: run the two tests against the running service and fail if either reports `--- SKIP`. The skip guard matters as much as the run: without it, a future rename of a test or of an environment variable would silently return the job to testing nothing, which is the failure mode this PR is fixing. ## Validation Locally, against a PostgreSQL 16 instance: | condition | result | |---|---| | no DSN (today's CI) | 2 tests SKIP | | DSN set (this change) | 2 tests PASS, 0 SKIP | ## Risk Low. No production code changes, no new services, and the added step can only fail if these tests genuinely fail or silently stop running. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 04:06:58 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#6187
No description provided.