-
-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#2 More CLI Tests #42
Conversation
Doesn't seem to act as i'd expect with cwd, check usage isn't incorrect
@phated Just got some questions with some things as I was working on these few (of course feedback is appreciated!). 1. The require opts doesn't seem to do anything, I've worked out that it comes from liftoff but can't find any explict require of modules from the given path. Please let me know if I'm incorrect, I've chucked a placeholder test there for the moment to come back to. Let me know if there's anything glaring I'm doing wrong |
@@ -53,7 +53,7 @@ Command Line Utility for Gulp | |||
<td>Manually set the CWD. The search for the gulpfile, as well as the relativity of all requires will be from here.</td> | |||
</tr> | |||
<tr> | |||
<td>--verify</td> | |||
<td>--verify [path (optional)]</td> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you also update this in the cli-options.js? I totally forgot we accepted a path
I'm really liking this PR. I'll answer your list:
|
|
If cwd is set we should be using that to find the given package as liftoff sets cwd to the configBase already if cwd is falsey
See cwd change
I looked at the cwd problem. It seemed to be that it was using configBase as you suggested but that config base was being set to the path of the found gulpfile.js (in this case test/fixtures) as opposed to the passed cwd. After looking at the code in liftoff I found this so as the cwd (if undefined) was getting set the configBase which we were using anyway I updated the usage of verify to use the Another problem I spotted while down that rabbit hole was that by passing verify string arguments we can no longer use it as a bool flag from yargs unless i'm missing some docs from them. We can expect a value of The only options I can see is forcing an argument to always be passed, have an empty string be the condition for using the default package.json or adding a separate flag like |
Please see https://github.com/js-cli/js-liftoff/blob/master/README.md#optsconfigpath and let me know if that isn't clear? |
@tkellen it seems that I am looking for https://github.com/js-cli/js-liftoff/blob/master/README.md#callbackenv because |
@phated Hey, i've updated the branch with tests for requiring a module which seems to work as expected. I'm having problems testing Any suggestions on how to test it? It'd be a little silly to just remove the 3.8.10 package as then we can't test that case. I've seen this and we could perform some hackery by targeting I'll continue to work on others until I get a response |
@Romanx yeah, this is something we need to solve. I would ideally like to have integration tests for both code paths and have them both run on travis. I've been trying to think of the best solution... maybe we need to write a |
@Romanx maybe you can just update that reference to gulpjs/gulp#4.0 to get these to pass for the time being |
@phated sounds good. I'll do that now and work on |
I'm considering not testing |
Temporary fix until we can work out a way to test different version of gulp
Added fs-extra to handle cleanup before and after. Possibly this should be moved internally to gulp-cli
Had to change gulpfile 4.0 to add failing test. Updated json tasks to reflect change. May cause others to fail, already failing due to 4.0 bump
@phated I found what was failing the linting, i'm on windows and it was adding window line endings to the file and the jscs config only considers unix line endings acceptable, fixed now. I've finished the Underneath writing to a path seems to use writeFileSync which is fine one I realised this was the case (from the error given) however it didn't work as I originally expected as all gulp outputs seem to write the path and create the file themselves. Perhaps this should do the same or we should document it in the readme? Until then i've added fs-extra to make it easier to create the output directory and tear it down after use. Hopefully this shouldn't cause issues. There's a new things left to do but i think I've documented all the flags but here are the things left that i can see:
|
@phated bump |
@Romanx sorry, I just gave a talk at Thunder Plains Conf so the past few days have been prepping that. I am still traveling but I plan to look at gulp issues tomorrow. |
@phated No problem just wanted to check you'd seen it! |
@Romanx the tests still seem to be failing on travis, can you take a look at that? As for your list:
I will fully review everything once travis can complete successfully (I think it might just be updating some fixtures). |
Previous gulpfile changed to gulpfile-3.8.10
Hopefully should fix CI issues due to enviroment differnces
Can't fix enviroment differences between unix and windows in the output. Seems to be adding an extra space only in CI (on unix) and not on windows.
Should hopefully remove the extra spaces causing the problems during CI processing
@phated I've updated the fixtures that broke the tests due to the 4.0 upgrade. Had some issues with yargs options adding an extra space in the CI environment as opposed to my dev environment, took me a few commits and different methods of trying to normalise the outputs. Hopefully you're happy with this, any changes you want just post and i'll get them done. |
Awesome work. Thanks! |
A pull for feedback as I work on more CLI tests on my fork