postman-code-generators icon indicating copy to clipboard operation
postman-code-generators copied to clipboard

Converted test.sh bash script to Javascript

Open sastava007 opened this issue 4 years ago • 9 comments

What this PR does This PR converts the test.sh bash script file to javascript making it the platform agnostic. This PR is part of a series of PRs trying to solve issue #174

Changes you made Converted the bash commands into it's closely equivalent JS commands using shellJS package.

Screenshot/ CodeSnippet Not required

Test Configuration: Tried to test locally for various codegens by running npm test <codegen-name> and comparing the result obtained with that generated from the similar bash script.

Follow up Not required

Thanks for contributing! ❤️

sastava007 avatar Mar 07 '20 08:03 sastava007

@umeshp7 Please review.

sastava007 avatar Mar 07 '20 08:03 sastava007

@umeshp7 @shreys7 Can you please restart the build for this PR, as it failed because of some internal issue with shellJS which I think can be passed by trying for one more time.

sastava007 avatar Mar 07 '20 18:03 sastava007

I tried running it twice, but it failed with the same errors @sastava007

shreys7 avatar Mar 09 '20 09:03 shreys7

@shreys7 Any hint, on what I might be doing wrong? I'm not able to figure out.

sastava007 avatar Mar 11 '20 11:03 sastava007

@sastava007 You could try removing shell.config.fatal=true; This is preventing from the console.log(commandOut.stderr) to be printed. Once you do that you will know what is the error.

Warning: Could not find any test files matching pattern: ./test/codegen/structure.test.js
Warning: Could not find any test files matching pattern: curl

umeshp7 avatar Mar 15 '20 11:03 umeshp7

@sastava007 I have tried running this locally. There are issues while running npm run test. Can you address them?

umeshp7 avatar Mar 17 '20 15:03 umeshp7

@umeshp7 Okay, I'll try to fix them once I complete the draft for my proposal.

sastava007 avatar Mar 17 '20 15:03 sastava007

@shreys7 Any hint, on what I might be doing wrong? I'm not able to figure out.

This might be a problem with shelljs. Checkout this. Try updating to shelljs 0.8.2 or above, currently latest stable release is 0.8.4. @sastava007

someshkoli avatar May 06 '20 22:05 someshkoli

This might be a problem with shelljs. Checkout this. Try updating to shelljs 0.8.2 or above, currently latest stable release is 0.8.4. @sastava007

@someshkoli Yeah, I've figured it out. I will update and submit by weekend.

sastava007 avatar May 08 '20 15:05 sastava007