Skip to content

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 3 commits into from
Nov 25, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Copy link
Contributor

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 keep npm run coverage:win and just make it an alias for the former.

Copy link
Contributor

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 :/

Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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 all test did was test - this is what test:win does - suggest

  • Remove test and coverage
  • Rename test:win to test - this will only perform testing
  • Rename coverage:win to coverage and ensure works on Unix/Mac by using the correct path for jasmine that works for both platforms

Can 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

Copy link
Contributor

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

* **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`
Copy link
Contributor

Choose a reason for hiding this comment

The 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.
Copy link
Contributor

Choose a reason for hiding this comment

The 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)

Expand Down