Skip to content

test: expand v4→v5 upgrade test matrix with clustering config and hdb_status sub-cases#1207

Open
kriszyp wants to merge 3 commits into
mainfrom
kris/integration-test-upgrade-matrix
Open

test: expand v4→v5 upgrade test matrix with clustering config and hdb_status sub-cases#1207
kriszyp wants to merge 3 commits into
mainfrom
kris/integration-test-upgrade-matrix

Conversation

@kriszyp

@kriszyp kriszyp commented Jun 9, 2026

Copy link
Copy Markdown
Member

Closes #1187.

Summary

  • Adds a version matrix comment block documenting HARPER_LEGACY_V43_PATH through HARPER_LEGACY_V47_PATH env vars, with a note on how to run the CI matrix across v4 minors.
  • Adds v4→v5: hdb_status GTM table backward-compat suite: seeds a data.hdb_status record via v4, upgrades to v5, and verifies the record is readable — checking both data and system databases in case v5 migrates the table location.
  • Adds v4.3.x→v5: clustering: config key suite: starts v4.3, seeds data, then appends the old-style clustering: { enabled: true, ... } YAML block directly to the on-disk config file (bypassing HARPER_SET_CONFIG, which is a v5-only mechanism predating v4.3), then upgrades to v5 and asserts no crash + data survives.

Areas for reviewer attention

  • hdb_status database location: The test tries data.hdb_status then falls back to system.hdb_status. The actual v4 schema location is not confirmed from source alone — if v4 stored it in system from the start, the data leg never seeds anything meaningful and the test is effectively a no-op. A reviewer with v4 knowledge should confirm.
  • Config file name after v4.3 startup: The clustering test writes to whichever of harperdb-config.yaml / harper-config.yaml exists after v4 starts. If v4.3 uses a different filename or writes no config file, writeFileSync(..., { flag: 'a' }) will create a new file at the newConfigPath path — which may or may not be where v5 looks.
  • Module-level hdbStatusSeeded flag: This is safe for the current single-process test runner, but could cause issues if tests are ever run in parallel workers sharing module state (unlikely given the current setup).

All three suites skip cleanly when the relevant env vars are absent (verified locally).

Generated by Claude Sonnet 4.6

…us sub-cases

Closes #1187.

- Adds version matrix comment documenting HARPER_LEGACY_V43_PATH through
  V47_PATH env vars so CI can run the same suite against each v4 minor.
- Adds hdb_status GTM table backward-compat suite: seeds a record via v4,
  upgrades to v5, verifies the record is readable (checks both data and
  system databases in case v5 migrated the table).
- Adds v4.3.x clustering: config key suite: starts v4.3, seeds data, appends
  the old-style `clustering:` YAML block directly to the on-disk config file
  (bypassing HARPER_SET_CONFIG, which predates v4.3), then upgrades to v5 and
  asserts no crash and data survival.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request expands the upgrade compatibility test suite (v4.x to v5) by adding tests for the hdb_status GTM table backward compatibility and verifying that legacy clustering configuration keys do not cause silent startup failures in v5. The feedback suggests scoping the hdbStatusSeeded flag inside the suite callback to prevent state pollution, and writing the legacy clustering configuration to both potential configuration files (harperdb-config.yaml and harper-config.yaml) to ensure robust configuration resolution during the upgrade.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +291 to +297
let hdbStatusSeeded = false;

suite(
'v4->v5: hdb_status GTM table backward-compat',
{ skip: !legacyPath || testsBun || process.platform === 'win32' },
(ctx: ContextWithHarper) => {
before(async () => {

This comment was marked as resolved.

Comment on lines +425 to +441
const legacyConfigPath = join(ctx.harper.dataRootDir, 'harperdb-config.yaml');
const newConfigPath = join(ctx.harper.dataRootDir, 'harper-config.yaml');
const configPath = existsSync(legacyConfigPath) ? legacyConfigPath : newConfigPath;

// Append the old-style clustering block to the existing config file.
// YAML block append: a trailing newline then a top-level clustering key.
const clusteringYaml = [
'',
'# v4.3 legacy clustering key — injected by upgrade compat test',
'clustering:',
' enabled: true',
' nodeName: test-node',
' server:',
' port: 12345',
'',
].join('\n');
writeFileSync(configPath, clusteringYaml, { flag: 'a' });

This comment was marked as resolved.

@claude

claude Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Reviewed; no blockers found.

…d, write config to both filenames

- Move `hdbStatusSeeded` flag from module scope into the suite callback
  to prevent state pollution between suites
- Write the legacy clustering config block to both `harperdb-config.yaml`
  and `harper-config.yaml` so the test works across all v4.3.x minor
  versions regardless of which config filename convention they use

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@kriszyp kriszyp marked this pull request as ready for review June 9, 2026 14:14
kriszyp added a commit that referenced this pull request Jun 11, 2026
Creates database/, resources/, and mqtt/ directories under integrationTests/
as placeholder structure ahead of merging #1207#1211. Updates the top-level
integrationTests/README.md with a directory map mirroring the Harper v5 docs
and pointing new tests away from the legacy apiTests/ bucket (see #1215).
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.

Expand v4→v5 upgrade tests: v4.3, v4.4, v4.5, v4.6, v4.7 starting versions + clustering→replication config rename

1 participant