Skip to content
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

Line endings and test files #2801

Closed
ScottFreeCode opened this issue May 14, 2017 · 1 comment
Closed

Line endings and test files #2801

ScottFreeCode opened this issue May 14, 2017 · 1 comment
Labels
status: accepting prs Mocha can use your help with this one! type: chore generally involving deps, tooling, configuration, etc.

Comments

@ScottFreeCode
Copy link
Contributor

ScottFreeCode commented May 14, 2017

Similar to #2800, while the test suite can be run on Windows (e.g. using MinGW make with either Cygwin or Git Shell), certain tests fail if certain files do not have the right line endings:

  • test/acceptance/glob/glob.sh -- this just needs to be Linux line endings, should probably be converted to them by the test run if possible regardless of how they may have been changed
  • something in test/integration/fixtures/diff -- perhaps just the output file? and not sure if the right line endings here are always Linux, or depend on the OS, or depend on whether the tests are being run from a Posixy environment (as is necessary to use the Makefile)

More meta-like, if this ends up requiring per-file fiddling, then it would be really, really helpful to have some way of guaranteeing that our CI runs won't succeed just because they happen to have the right global settings that developers may or may not have. It doesn't make sense to have something that we need to set up correctly for certain tests that won't fail CI if we get it wrong.

@ScottFreeCode ScottFreeCode added type: bug a defect, confirmed by a maintainer type: chore generally involving deps, tooling, configuration, etc. status: accepting prs Mocha can use your help with this one! and removed type: bug a defect, confirmed by a maintainer labels May 14, 2017
@ScottFreeCode
Copy link
Contributor Author

Actually, glob.sh should just be made into a js test file instead, per #2805.

The other, we should consider whether we can refactor the test so expected outputs aren't grouped together and separated from inputs in some other file like this in the first place -- basically, inline stuff into the test file so it's obvious (obvious is better than concise), and a side benefit may be that it would no longer have line-ending problems...? Can't guarantee that though -- the actual output may still vary by environment, in which case we'd have to make the inlined expected output use the line endings of the current environment -- something like this:

var expected = ["first line", "second line", "third line"].join(correctNewlineVariable)

That might still be easier to control than file line endings, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: accepting prs Mocha can use your help with this one! type: chore generally involving deps, tooling, configuration, etc.
Projects
None yet
Development

No branches or pull requests

1 participant