Skip to content

test(integration): port terminology-alias suite to harperLifecycle - #647

Merged
kriszyp merged 2 commits into
mainfrom
claude/api-tests-terminology
May 21, 2026
Merged

test(integration): port terminology-alias suite to harperLifecycle#647
kriszyp merged 2 commits into
mainfrom
claude/api-tests-terminology

Conversation

@kriszyp

@kriszyp kriszyp commented May 20, 2026

Copy link
Copy Markdown
Member

Summary

  • Ports 16_terminologyUpdates.mjs to the isolated @harperfast/integration-testing framework
  • Validates that database is accepted as an alias for schema and primary_key for hash_attribute across all CRUD, search, attribute-management, and async-job operations
  • Replaces legacy setTimeout polling with awaitJobCompleted; CSV fixture resolved via import.meta.url
  • S3 and csv_url_load tests remain skipped (require external infrastructure, same as legacy)

Test plan

  • CI passes on Node (all tests)
  • CI passes on Bun

🤖 Generated with Claude Code

Ports 16_terminologyUpdates.mjs — validates that `database` is accepted
as an alias for `schema` and `primary_key` for `hash_attribute` across
all CRUD, search, attribute, and async-job operations. Uses awaitJobCompleted
instead of raw sleeps.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@kriszyp
kriszyp requested a review from a team as a code owner May 20, 2026 17:52
@kriszyp
kriszyp requested a review from DavidCockerill May 20, 2026 17:52

// Resolve the CSV fixture path relative to this file so Harper can read it.
const SUPPLIERS_CSV = path.join(fileURLToPath(import.meta.url), '../../data/Suppliers.csv');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The path is wrong. fileURLToPath(import.meta.url) returns the file path, not its directory, so path.join treats terminology.test.mjs as a path segment and ../../ walks two levels up — landing at integrationTests/data/Suppliers.csv, which doesn't exist. The CSV is at integrationTests/apiTests/data/Suppliers.csv.

Use path.dirname first (the same idiom used in envConfig.mjs):

Suggested change
const SUPPLIERS_CSV = path.join(path.dirname(fileURLToPath(import.meta.url)), 'data/Suppliers.csv');

Without this fix the three csv_file_load tests will fail with a file-not-found error.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed: changed to path.join(path.dirname(fileURLToPath(import.meta.url)), 'data/Suppliers.csv'). — Claude

@claude

claude Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

Reviewed; no blockers found. The CSV path fix from the prior run (path.dirname()) was applied correctly in commit 619fcf22f.

@kriszyp
kriszyp requested review from Ethan-Arrowood and removed request for a team May 20, 2026 18:04
fileURLToPath(import.meta.url) returns the file, not its directory;
path.join on a file path produces a wrong CSV location. Use
path.dirname() first so the CSV resolves to integrationTests/apiTests/data/.
Also apply prettier formatting.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@kriszyp
kriszyp merged commit 56cebcf into main May 21, 2026
38 of 39 checks passed
@kriszyp
kriszyp deleted the claude/api-tests-terminology branch May 21, 2026 21:10
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