-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Update contributing.md #4368
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
Merged
Merged
Update contributing.md #4368
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,11 +6,16 @@ We really want Parse to be yours, to see it grow and thrive in the open source c | |
|
||
##### Please Do's | ||
|
||
* Take testing seriously! Aim to increase the test coverage with every pull request. | ||
* Run the tests for the file you are working on with `npm test spec/MyFile.spec.js` | ||
* Run the tests for the whole project and look at the coverage report to make sure your tests are exhaustive by running `npm test` and looking at (project-root)/lcov-report/parse-server/FileUnderTest.js.html | ||
* Lint your code by running `npm run lint` to make sure all your code is not gonna be rejected by the CI. | ||
* Never publish the lib folder. | ||
* Begin by reading the [Development Guide](http://docs.parseplatform.org/parse-server/guide/#development-guide) to learn how to get started running the parse-server. | ||
* Take testing seriously! Aim to increase the test coverage with every pull request. To obtain the test coverage of the project, run: | ||
* **Windows**: `npm run coverage:win` | ||
* **Unix**: `npm run coverage` | ||
* Run the tests for the file you are working on with the following command: | ||
* **Windows**: `npm run test:win spec/MyFile.spec.js` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same thing here, there are very few underlying differences. |
||
* **Unix**: `npm test spec/MyFile.spec.js` | ||
* Run the tests for the whole project to make sure the code passes all tests. This can be done by running the test command for a single file but removing the test file argument. The results can be seen at *<PROJECT_ROOT>/coverage/lcov-report/index.html*. | ||
* Lint your code by running `npm run lint` to make sure the code is not going to be rejected by the CI. | ||
* **Do not** publish the *lib* folder. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @flovilmart what do you think of the language changes to the contributing here? |
||
|
||
##### Run your tests against Postgres (optional) | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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'm wondering if we should consolidate these so it's just
npm run coverage
rather than one or the other for platform issues. We could keepnpm run coverage:win
and just make it an alias for the former.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.
problem is the env variables that are not processed properly on windows :/
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.
We could modify
npm run coverage
to os detect and run from there? Would be a bit more code underlying, but I don't believe we'd ever need to worry about which command to tell someone to use in the future and we probably wouldn't ever change it.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 would agree that consolidating into one would be great. It's unfortunate that npm doesn't support having scripts for specific OSes but oh well.
I'll give a shot at consolidating this into one 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.
(addressing both :win scripts)
test:win
wouldn't be required if alltest
did was test - this is whattest:win
does - suggesttest
andcoverage
test:win
totest
- this will only perform testingcoverage:win
tocoverage
and ensure works on Unix/Mac by using the correct path for jasmine that works for both platformsCan probably shorten to
cross-env MONGODB_VERSION=${MONGODB_VERSION:=3.2.6} MONGODB_STORAGE_ENGINE=mmapv1 TESTING=1 node nyc ./node_modules/jasmine/bin/jasmine.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.
Actually here's what we use in another project for coverage (on Windows):
cross-env NODE_ENV=test TESTING=1 nyc jasmine