-
Notifications
You must be signed in to change notification settings - Fork 685
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
Improve tests execution #260
Conversation
👍 |
@@ -1,3 +1,4 @@ | |||
process.env.HOME = "test/fixtures"; |
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.
Note: Moving HOME
here fixes running tests on Windows.
Actually, unless I misunderstood the intent, there is a simpler and more elegant way to do so, with less boilerplate code:
And that's it!
Now, we might still want a single command to run everything with one command, which is something your PR offers. 2 solutions to that:
(I prefer the second solution). Granted, as opposed to your PR, all this makes What do you guys think? |
Well that's the entire reason why I wanted to make this work in the first place. Sometimes I have multiple things going on at the same time, and a few times I opened a PR thinking my CSS was fine and thought I was all good because I only got errors in unrelated JS code, and then Travis yelled at me because of pages of CSS errors. |
Would it not be simplest to just change it to this:
This will both commands whether the first fails or not, and in serial. There is only 1 disadvantage of this, and that's that windows doesn't support ;, but realistically, most people developing on windows are at least using git bash, if not cygwin. It's much simpler, and makes it much more easy to figure out what's happening. Having mocha actually linting things seems... awkward. |
@YaManicKill using |
True, but that's only an issue for travis, and we can get travis to run the scripts individually, as suggested by @astorije, so that it gets the correct exit codes. I don't really like this really complex way of dealing with running the linter. |
I fully agree with @YaManicKill here. As a matter of fact, I have been using this setup on another project of mine, and using @maxpoulin64, are you OK with this solution? |
@astorije Alright, like that for the It's not super great (it would be nice to have |
@@ -13,8 +13,11 @@ | |||
"scripts": { | |||
"start": "node index", | |||
"build": "grunt && handlebars client/views/ -e tpl -f client/js/lounge.templates.js", | |||
"test": "HOME=test/fixtures mocha test/**/*.js && npm run lint", | |||
"lint": "eslint . && stylelint \"**/*.css\"", | |||
"test": "HOME=test/fixtures mocha test/**/*.js", |
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.
Is it possible to keep HOME=test/fixtures
in the according test to keep this?
@astorije @YaManicKill All comments should have been addressed now. |
@@ -18,3 +18,9 @@ deploy: | |||
node: '4' | |||
tags: true | |||
repo: thelounge/lounge | |||
|
|||
script: |
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.
I wonder, perhaps we should be invoking build commands too? They could potentially fail.
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.
They would fail at npm install
time. I think this is good as is for now, we can improve later but this PR already solves @maxpoulin64's (and probably others') issue.
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.
Hmm, it does run it and hides the output. Do we know if travis fails the build if grunt/handlebars build fails at that stage?
🚢 |
Damn. I should have tested the latest version on Windows. Using |
Improve tests execution
As explained in #259, the current way of running the linters makes it so that if one of them errors out, then the next one is never ran. This causes the situation where you are forced to fix all eslint errors before you can see stylelint errors.
This migrates both to mocha tests, so we now have one single test command to run to deal with everything.