Skip to content

Alternative lib directory for tests#8390

Merged
eaydingol merged 7 commits into
mainfrom
eag/mvtests-preso-workflow
Dec 31, 2025
Merged

Alternative lib directory for tests#8390
eaydingol merged 7 commits into
mainfrom
eag/mvtests-preso-workflow

Conversation

@eaydingol
Copy link
Copy Markdown
Collaborator

@eaydingol eaydingol commented Dec 19, 2025

Adds support for loading citus and columnar so files from a different directory during tests.

usage:
CITUSLIBDIR=/tmp/opt/citus_versions/v13.2.1 make check-minimal
CITUSLIBDIR=/tmp/opt/citus_versions/v13.2.1 citus_tests/run_test.py columnar_create

Note to reviewer:
The sample test in build_and_test.yml will be removed before merge (using a dev image from citusdata/the-process#180).
It generates the following test, see logs in Checks tab.
[Build & Test / Test Citus Lib N-1 / PG17 - check-minimal - lib-v13.2.0 (pull_request)]

@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.78%. Comparing base (851c9cd) to head (4e76d62).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8390      +/-   ##
==========================================
- Coverage   88.80%   88.78%   -0.03%     
==========================================
  Files         287      287              
  Lines       63236    63237       +1     
  Branches     7927     7927              
==========================================
- Hits        56155    56143      -12     
- Misses       4750     4764      +14     
+ Partials     2331     2330       -1     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@eaydingol eaydingol force-pushed the eag/mvtests-preso-workflow branch from 16b7478 to b4269b6 Compare December 19, 2025 06:41
@eaydingol eaydingol changed the title CI/CD test using alternative citus library directory Alternative lib directory for tests Dec 19, 2025
eaydingol added a commit to citusdata/the-process that referenced this pull request Dec 25, 2025
Add the library files from the latest minor release to exttester image. 
These files will be used in mixed version testing, see draft PR
citusdata/citus#8369

Tested locally for 17.7

```
make build-exttester-17.7
// in container
ls /opt/citus-versions/v13.2.0/
citus.so  citus_columnar.so  citus_decoders  citus_pgoutput.so  citus_wal2json.so

```
Slight increase in the image size:
```
ghcr.io/citusdata/exttester            17.7-dev-15cd08f      ae73e573b28d   7 seconds ago   3.02GB   
ghcr.io/citusdata/exttester            17.7-dev-076d6fb      be3fc5177d09   3 minutes ago   3.05GB  // from this PR
```

See related PR in citus repo, testing the dev image as well :
citusdata/citus#8390
@alperkocatas alperkocatas self-requested a review December 30, 2025 11:03
Copy link
Copy Markdown
Contributor

@alperkocatas alperkocatas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Any specific things that you need me to check? I guess it won't be practical to test this locally, right?

@eaydingol eaydingol enabled auto-merge (squash) December 30, 2025 12:27
@eaydingol eaydingol merged commit 2e64eb0 into main Dec 31, 2025
218 of 219 checks passed
@eaydingol eaydingol deleted the eag/mvtests-preso-workflow branch December 31, 2025 07:05
eaydingol added a commit that referenced this pull request Mar 6, 2026
Adds support for loading citus and columnar so files from a different
directory during tests.

usage:
CITUSLIBDIR=/tmp/opt/citus_versions/v13.2.1 make check-minimal
CITUSLIBDIR=/tmp/opt/citus_versions/v13.2.1 citus_tests/run_test.py
columnar_create


The sample removed in the last commit from build_and_test.yml illustrates the use case. Similar tests will be added in following PRs
(using a dev image from
citusdata/the-process#180).
It generates the following test, see logs in Checks tab. 
[Build & Test / Test Citus Lib N-1 / PG17 - check-minimal - lib-v13.2.0
(pull_request)]
eaydingol added a commit that referenced this pull request Mar 9, 2026
## Backport mixed-version test infrastructure to release-13.2

This PR cherry-picks a series of commits from `main` that introduce
mixed-version testing support and related fixes to the `release-13.2`
branch. These changes enable running regression tests against different
Citus versions (N/N-1 scenarios), which is essential for validating
backward compatibility during phased upgrades.

### Cherry-picked commits

1. **Relax version check
([#8356](#8356 —
`c125b9bec563`
Relaxes the Citus version compatibility check to allow the installed
extension to differ by at most one minor version from the loaded
library. This enables replicas to lag by a single minor version during
phased upgrades without triggering a version mismatch for distributed
queries.

2. **Workflow refactor
([#8361](#8361 —
`b8ab8aac554c`
Refactors `.github/workflows/build_and_test.yml` to use a shared
reusable workflow (`run_tests.yml`) for the main, failure, and CDC test
suites. Introduces the `CITUSVERSION` environment variable so tests can
create the Citus extension at a specific version (e.g.,
`CITUSVERSION=13.2-1 make check`).

3. **Test refactor for columnar separation
([#8420](#8420 —
`b7a5f698ab77`
Minor test adjustments to prepare for columnar module separation, adding
necessary setup/teardown steps in several test files.

4. **Alternative lib directory for tests
([#8390](#8390 —
`2e64eb020268`
Adds support for loading `citus.so` and `columnar.so` from an
alternative directory during tests via the `CITUSLIBDIR` environment
variable (e.g., `CITUSLIBDIR=/path/to/v13.2.0 make check-minimal`).

5. **Store/restore exit status
([#8436](#8436 —
`1c5b304feeef`
Fixes regression test exit status being lost after test cleanup steps,
ensuring the correct exit code is propagated.

6. **Mixed version tests for citus
([#8431](#8431 —
`08a27ddc0579`
The core mixed-version testing infrastructure. Extends
`pg_regress_multi.pl` to support:
- Creating the Citus extension at a specific version for coordinator
and/or workers
   - Swapping the Citus shared library for specific nodes
- Running N/N-1 compatibility tests in multiple configurations (SQL N-1,
Lib N-1, Worker N-1, Coordinator N-1)

Separates tests that drop/create the Citus extension into a new
`multi_1_create_citus_schedule` to allow safe reuse of remaining
multi-node tests in N-1 scenarios.

7. **Fix IsTenantSchema when version checks are disabled
([#8480](#8480 —
`546f20661a3b`
Fixes `IsTenantSchema()` incorrectly returning `false` when
`citus.enable_version_checks` was off. The previous guard completely
disabled schema-based sharding during mixed-version testing, causing 5
test failures. The fix replaces the guard with a `CheckCitusVersion()`
call, which returns `true` unconditionally when version checks are
disabled.

### Conflicts resolved

- **`build_and_test.yml`** (commits 2 and 6): Resolved by accepting the
incoming reusable workflow pattern and the new
`check-multi-1-create-citus` / `check-tap` make targets.
- **`Makefile`** (commit 6): Resolved by accepting the new
`check-multi-1-create-citus` and `check-tap` targets in `check-full`.

### Files changed

29 files changed, +699 / -210 lines across CI workflows, test
infrastructure (`pg_regress_multi.pl`, `Makefile`), core version
checking logic (`metadata_cache.c`, `columnar_tableam.c`), tenant schema
handling, and regression test SQL/expected output files.
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.

2 participants