Skip to content

Conversation

cristiand391
Copy link
Member

What does this PR do?

Fix a bug where project convert mdapi --output-dir path/to/output would save the converted metadata to path instead of path/to/output if the path didn't exist before.

When the dir doesn't exist we create it for the user but the code was returning fs.promises.mkdir response which only returned the first dir in the path:
https://nodejs.org/api/fs.html#fspromisesmkdirpath-options

Updated convert NUT to check that the filepath starts with the full output path.

What issues does this PR fix or reference?

@W-15097291@

expect(fs.existsSync(convertedToSrcPath)).to.be.true;
expect(result.jsonOutput).to.not.be.undefined;
result.jsonOutput?.result.forEach((md) => {
expect(md.filePath.startsWith(convertedToSrcPath)).to.be.true;
Copy link
Member Author

Choose a reason for hiding this comment

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

This NUT was testing that the output dir was created in L92 (which is true) but the metadata was still written to the first dir in the path.

Screenshot 2024-07-15 at 7 29 28 PM

@WillieRuemmele
Copy link
Contributor

QA Notes


the NUT should suffice...

✅ : validated source format was extracted to nested output-dir
image

path from current
path2 from local

@WillieRuemmele WillieRuemmele merged commit d1aa2a3 into main Jul 18, 2024
@WillieRuemmele WillieRuemmele deleted the cd/fix-output-dir branch July 18, 2024 16:47
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