fix(test): make external model fixtures hermetic - #154
Conversation
|
Hi @mttrbrts, the fix follows the Concerto-style cached external model pattern. What changed:
I also verified the full suite locally after the change: npm test -- --runInBand --coverage=false |
Signed-off-by: Rishabh Jain <rishabhj2005@email.com>
61df9ad to
f675fe7
Compare
|
This PR is stale because it has been open with no activity. Remove the stale label or comment to keep it active. Only items with maintainer engagement are auto-closed. |
|
@github unstale |
|
Hey @Rishabh060105, thanks for the PR! One suggestion before merge: take a look at how cicero-template-library handles this same problem in test/render.test.mjs — it might be a cleaner pattern than fetch-mocking here. Instead of intercepting fetch and vendoring copies of the external model files, it forces offline: true at the loader boundary: Template.fromDirectory(path, { offline: true }). That routes cicero-core to mm.validateModelFiles() (a local-only check) instead of mm.updateExternalModels() (the network call), so no HTTP request is ever made in the first place. It goes a step further and globally monkeypatches Template.prototype.validate to always pass offline: true, which protects against any internal validate() call elsewhere in the chain, not just the one call site you know about. Might be worth considering here instead of (or alongside) the mockExternalModelFetches approach , curious what you think. |
4104bd3 to
f675fe7
Compare
Signed-off-by: Rishabh Jain <rishabhj2005@email.com>
Signed-off-by: Rishabh Jain <rishabhj2005@email.com>
|
Hi @devanshi00, |
Closes #153
Summary
This change makes the test suite hermetic for the remaining external-model paths.
It replaces live model downloads in the affected tests with cached
@models...fixtures, following the same naming pattern already used in Concerto tests and existing Accord Project archive fixtures.Changes
test/modelsModelManagerTemplateMarkInterpreter.test.tsto stop callingupdateExternalModels()at runtimeTemplateArchiveProcessor.test.tsto resolve external model fetches from local cached fixturesTest
npm test -- --runInBand --coverage=falseResults: