Closed p-mcgowan closed 4 years ago
Cannot run the tests on this one
How so - can't run at all or they fail?
:) sorry was whizzing through stuff.. the output could have been helpful:
git:(i11/always-handle-root-hash-resolution) npm run test
> boats@1.18.0 test /home/carmichael/code/opensource/boats
> npm run lint:fix && npm run clean:build && NODE_ENV=test npm run test:builds && npm run test:unit
> boats@1.18.0 lint:fix /home/carmichael/code/opensource/boats
> eslint 'src/**/*.{js,ts,tsx}' --quiet --fix
> boats@1.18.0 clean:build /home/carmichael/code/opensource/boats
> rm -fR ./test-build/*
> boats@1.18.0 test:builds /home/carmichael/code/opensource/boats
> npm run test:build-cli:asyncapi:std && npm run test:build-cli:oa2:std && npm run test:build-cli:oa2:readonly && npm run test:build-cli:oa2:std:exclude-version && npm run test:build-cli:oa3:std && npm run test:build-cli:oa3:std:exclude-version && npm run test:build-cli:oa2:inject
> boats@1.18.0 test:build-cli:asyncapi:std /home/carmichael/code/opensource/boats
> node ./bin/cli.js -i ./srcASYNC2/index.yml.njk -o ./test-build/srcASYNC2/srcASYNC2.yml -s srcASYNC2/channels/
/home/carmichael/code/opensource/boats/.boatsrc
Completed, the files were rendered, validated and bundled to: test-build/srcASYNC2/srcASYNC2_1.0.1.yml
> boats@1.18.0 test:build-cli:oa2:std /home/carmichael/code/opensource/boats
> node ./bin/cli.js -i ./srcOA2/index.yml.njk -o ./test-build/builtOA2_std/builtOA2_std.yml -s srcOA2/paths/
/home/carmichael/code/opensource/boats/.boatsrc
undefined
Trace: {
stack: 'MissingPointerError: Token "PathId" does not exist.\n' +
' at Pointer.resolve (/home/carmichael/code/opensource/boats/node_modules/json-schema-ref-parser/node_modules/@apidevtools/json-schema-ref-parser/lib/pointer.js:89:13)\n' +
' at $Ref.resolve (/home/carmichael/code/opensource/boats/node_modules/json-schema-ref-parser/node_modules/@apidevtools/json-schema-ref-parser/lib/ref.js:113:20)\n' +
' at $Refs._resolve (/home/carmichael/code/opensource/boats/node_modules/json-schema-ref-parser/node_modules/@apidevtools/json-schema-ref-parser/lib/refs.js:156:15)\n' +
' at inventory$Ref (/home/carmichael/code/opensource/boats/node_modules/json-schema-ref-parser/node_modules/@apidevtools/json-schema-ref-parser/lib/bundle.js:99:23)\n' +
' at crawl (/home/carmichael/code/opensource/boats/node_modules/json-schema-ref-parser/node_modules/@apidevtools/json-schema-ref-parser/lib/bundle.js:74:11)\n' +
' at crawl (/home/carmichael/code/opensource/boats/node_modules/json-schema-ref-parser/node_modules/@apidevtools/json-schema-ref-parser/lib/bundle.js:77:11)\n' +
' at inventory$Ref (/home/carmichael/code/opensource/boats/node_modules/json-schema-ref-parser/node_modules/@apidevtools/json-schema-ref-parser/lib/bundle.js:138:3)\n' +
' at crawl (/home/carmichael/code/opensource/boats/node_modules/json-schema-ref-parser/node_modules/@apidevtools/json-schema-ref-parser/lib/bundle.js:74:11)\n' +
' at crawl (/home/carmichael/code/opensource/boats/node_modules/json-schema-ref-parser/node_modules/@apidevtools/json-schema-ref-parser/lib/bundle.js:77:11)\n' +
' at inventory$Ref (/home/carmichael/code/opensource/boats/node_modules/json-schema-ref-parser/node_modules/@apidevtools/json-schema-ref-parser/lib/bundle.js:138:3)',
code: 'EMISSINGPOINTER',
message: 'Token "PathId" does not exist.',
source: '/home/carmichael/code/opensource/boats/test-build/builtOA2_std/paths/v1/weather/id/delete.yml',
path: [],
toJSON: [Function: toJSON],
name: 'MissingPointerError',
toString: [Function: toString]
}
at catchHandle (/home/carmichael/code/opensource/boats/build/src/cli.js:44:13)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! boats@1.18.0 test:build-cli:oa2:std: `node ./bin/cli.js -i ./srcOA2/index.yml.njk -o ./test-build/builtOA2_std/builtOA2_std.yml -s srcOA2/paths/`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the boats@1.18.0 test:build-cli:oa2:std script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/carmichael/.npm/_logs/2020-07-20T10_02_46_755Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! boats@1.18.0 test:builds: `npm run test:build-cli:asyncapi:std && npm run test:build-cli:oa2:std && npm run test:build-cli:oa2:readonly && npm run test:build-cli:oa2:std:exclude-version && npm run test:build-cli:oa3:std && npm run test:build-cli:oa3:std:exclude-version && npm run test:build-cli:oa2:inject`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the boats@1.18.0 test:builds script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/carmichael/.npm/_logs/2020-07-20T10_02_46_765Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! boats@1.18.0 test: `npm run lint:fix && npm run clean:build && NODE_ENV=test npm run test:builds && npm run test:unit`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the boats@1.18.0 test script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/carmichael/.npm/_logs/2020-07-20T10_02_46_773Z-debug.log
Interesting - does your file structure look like this?
Add helper to convert root ref (eg
'#/definitions/ThingDefinition'
) within templates.This would make moving files around or copy pasting them across projects much simpler, as you wouldn't need to add / remove some number of
../
to get the right path, just always refer to the root (assuming the defs exist)Seee delete.yml.njk for an example.
It seems a bit goofy doing this, since the relative path is required for the bundler, but it converts it to the root ref, so we essentially reverse the process before sending it to the bundler, but it has the desired result and render time