Closed theworkflow closed 8 years ago
This shouldn't work. The relative path just happens to work because I'm not protecting escaping from the bundle directory. Can you move the common folder to inside the parallel folder? Then use full paths to the file when using dofile. dofile("common/assert.js")
When we use the custom main feature, the bundle root becomes the directory holding the custom main.
@creationix It does work though. My other tests already use it - to access the fixtures
directory from parallel
. (They do not necessarily depend on it, but not having this features makes these things very messy.)
Is there a reason we must use a bundle directory? It seems that is only useful if we are running in zipped mode?
@creationix Should we open a new issue to discuss requiring bundled mode when not using zip files in more detail?
@Fishrock123 that is a good question. I suppose that custom main is already different behavior than running in zip mode. I just don't want people getting the false idea that reading outside the bundle will continue to work when they zip their app.
@ashleygwilliams Think the above may be solvable by clear, visible documentation? Or should we take some other action?
@creationix Could it be possible to make specialized messages for read-out-of-bundle when in "zipped mode"?
@harlanj looks good on the code side minus some minor things!
Might hold this a day to settle https://github.com/creationix/nucleus/issues/7 (license silliness for future-proofing)
I just don't want people getting the false idea that reading outside the bundle will continue to work when they zip their app.
Funny story. Today at work we had an incident with the luvit agent. There was a bug where a path had one too many dots ('..' vs '.') and was reading a file outside the bundle root. It passed all the tests since the tests ran in luvi mode, but when the agent was deployed, it crashed.
So my fear of differing behavior causing trouble wasn't unfounded after all.
I'm fine, however, with adding an explicit flag or something that allows overriding the root path. Or maybe we can have it look for a main.js
in parent directories and automatically finding the app root.
I've been pretty busy. Will open a new issue for this discussion tomorrow.
Looks good, just pending other discussions.
Just wanted to check and see if there was any update on this @creationix @Fishrock123
Sorry, I think it should be merge-able. In the future we'll just run the tests with something like the rustyduk implementation's --no-bundle
.
I'll try to take a full look when I can!
(p.s. There are lots of good issues that could be picked up in rustyduk if you are interested in JS & Rust: https://github.com/nucleus-js/rustyduk/issues)
I'm fine merging this now if @Fishrock123 is ok with it.
yeah looks good to me
I still need to get rustyduk on these days but that is for a different thread..
Cool. Thanks guys!
Pass message to assert functions in
test-nucleus-get-set-env.js
Move assert function to common.js file in test dir