Add test to confirm we can downgrade to older harperdb#406
Add test to confirm we can downgrade to older harperdb#406
Conversation
Review: PR #406 — Add test to confirm we can downgrade to older harperdbSurfaces traced: 1.
|
| env: { | ||
| CONFIRM_DOWNGRADE: 'yes', | ||
| }, | ||
| harperBinPath: join(legacyPath, 'bin', 'harperdb.js'), |
There was a problem hiding this comment.
Bug: TypeError when HARPER_LEGACY_VERSION_PATH is unset
legacyPath was promoted to suite scope so the new test body can reference it — but unlike before(), the test body has no guard. When the env var is absent legacyPath is undefined, and path.join(undefined, 'bin', 'harperdb.js') throws a TypeError rather than gracefully skipping.
| harperBinPath: join(legacyPath, 'bin', 'harperdb.js'), | |
| harperBinPath: join(legacyPath!, 'bin', 'harperdb.js'), |
Or, add an early-return guard consistent with before():
test('downgrade and start', async () => {
if (!legacyPath) return;
await killHarper(ctx);
...The ! non-null assertion is enough if this test file is always run in an environment where the env var is set, but the explicit return guard is safer and matches the pattern already used in before().
Review: PR #406 — Add downgrade test + system DB migration fix1. TypeError in
|
|
Reviewed; no blockers found. |
| let db; | ||
| if (options.dupSort) { | ||
| db = RocksDatabase.open(new RocksIndexStore(path, options)); | ||
| db = new RocksIndexStore(path, options).open(); |
There was a problem hiding this comment.
Good catch, but I now realize that RocksIndexStore isn't a "store" anymore and I approved the PR!
Dependent on https://github.com/HarperFast/harperdb/pull/3114