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

Adding where does test go section in writing-test.md #18802

Closed

Conversation

juggernaut451
Copy link
Contributor

@juggernaut451 juggernaut451 commented Feb 15, 2018

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

doc

Fixes: #18774

@nodejs-github-bot nodejs-github-bot added the doc Issues and PRs related to the documentations. label Feb 15, 2018
@vsemozhetbyt vsemozhetbyt added the test Issues and PRs related to the tests. label Feb 15, 2018
Copy link
Contributor

@vsemozhetbyt vsemozhetbyt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @juggernaut451!
I've made some tiny notes, but they can be addressed by a comment lander if it is more easy for you.

@@ -18,6 +18,13 @@ Add tests when:
- Fixing regressions and bugs.
- Expanding test coverage.

## Where does the test go
One can refer [test directory structure](https://github.com/nodejs/node/tree/master/test)
to decide where to put your test cases. If you want to find any current test that exist then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exist -> exists

One can refer [test directory structure](https://github.com/nodejs/node/tree/master/test)
to decide where to put your test cases. If you want to find any current test that exist then
go to the defined [test directory structure](https://github.com/nodejs/node/tree/master/test)
and search for similar APIs and see if there is similar file available
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A nit: missing period.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did not get this one. Can you please elaborate

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry. I think file available should be file available. (with a dot).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved :)

Copy link
Member

@apapirovski apapirovski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking this on @juggernaut451 — some small feedback below.

@@ -18,6 +18,13 @@ Add tests when:
- Fixing regressions and bugs.
- Expanding test coverage.

## Where does the test go
One can refer [test directory structure](https://github.com/nodejs/node/tree/master/test)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General nit: please keep lines to 80 chars. I think URLs can, maybe, be excepted.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks 👍

@@ -18,6 +18,13 @@ Add tests when:
- Fixing regressions and bugs.
- Expanding test coverage.

## Where does the test go
Copy link
Member

@apapirovski apapirovski Feb 15, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would sound better as "Where are tests located" (maybe "Where are the..." but that's getting clunky) or even "Test directory structure".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changing it to "Test directory structure"

One can refer [test directory structure](https://github.com/nodejs/node/tree/master/test)
to decide where to put your test cases. If you want to find any current test that exists then
go to the defined [test directory structure](https://github.com/nodejs/node/tree/master/test)
and search for similar APIs and see if there is similar file available.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, this is a bit too verbose and repeats the same information twice. We also do our best to avoid using "you", "your", "one" and similar. We could communicate the same thought in a shorter sentence:

See the test directory structure overview for an outline of existing test types and their locations.

That could probably be improved further. (Note that the link above goes directly to the README rather than the test folder.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does above description answers #18774 second issue?

Copy link
Member

@apapirovski apapirovski Feb 15, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It probably doesn't but I don't think the current one does either. I would go with something like:

When deciding on whether to expand an existing test file or create a new one, consider going through the files related to the subsystem (e.g. ones starting with "test-streams" for lib/streams.js) and assessing whether a related test already exists.

It's possible that should be even more detailed, like for example explaining the difference between parallel and sequential, but that could get quite tricky and complicated.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks making changes with the above one. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes made.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for feedback.

See the test [directory structure overview](https://github.com/nodejs/node/blob/master/test/README.md)
for an outline of existing test types and their locations.
When deciding on whether to expand an existing test file or create a new one,
consider going through the files related to the subsystem (e.g. ones starting with "test-streams" for `lib/streams.js`)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: can you wrap this to 80-chars? Also maybe ones starting with `test-streams-` for `lib/streams.js`

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixing 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.

@joyeecheung fixed. Kindly have a look

@mmarchini
Copy link
Contributor

@BridgeAR
Copy link
Member

BridgeAR commented Feb 18, 2018

Copy link
Member

@BridgeAR BridgeAR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few nits, LG otherwise.

For example, take a look at tests starting with "test-streams"
when writing tests for `lib/streams.js`


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep this consistent with the other places in the doc and only use a single new line :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes made.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, this does not seem to be addressed?

@@ -18,6 +18,15 @@ Add tests when:
- Fixing regressions and bugs.
- Expanding test coverage.

## Test directory structure
See the test [directory structure overview](https://github.com/nodejs/node/blob/master/test/README.md)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is longer than 80 characters, please move the reference down to the end of the file and only keep [directory structure overview][].

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes made.

When deciding on whether to expand an existing test file or create a new one,
consider going through the files related to the subsystem.
For example, take a look at tests starting with "test-streams"
when writing tests for `lib/streams.js`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The line breaks in this paragraph are actually not visible when viewing this not in raw form. Therefore it would be good to wrap each line around 80 characters.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes made.

@@ -18,6 +18,15 @@ Add tests when:
- Fixing regressions and bugs.
- Expanding test coverage.

## Test directory structure
See the test [directory structure overview](https://github.com/nodejs/node/blob/master/test/README.md)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding a new line after the header would be good for consistency as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes made.

Copy link
Member

@BridgeAR BridgeAR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please make sure the lines do not exceed 80 characters? :-)

## Test directory structure

See the test [directory structure overview][] for an outline of existing test types and their locations.
When deciding on whether to expand an existing test file or create a new one.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The punctuation at the end should be ,

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes made :)

See the test [directory structure overview][] for an outline of existing test types and their locations.
When deciding on whether to expand an existing test file or create a new one.
Consider going through the files related to the subsystem.
For example looking at tests starting with `test-streams` when writing tests for `lib/streams.js`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing . at the end.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes made :)

## Test directory structure

See [directory structure overview][] for outline of existing test & locations,
When deciding on whether to expand an existing test file or create a new one.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for not being clear, I meant the punctuation at the end of this line should be ,, so it should be

See [directory structure overview][] for outline of existing test & locations.
When deciding on whether to expand an existing test file or create a new one,
consider going through the files related to the subsystem.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When deciding on whether to expand an existing test file or create a new one, consider going through the files related to the subsystem.
@joyeecheung it will exceed 80 characters.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think @joyeecheung meant it to be a text block (without exceeding 80 characters by using new lines in the correct places), not as being in a single line.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok got it.

@juggernaut451
Copy link
Contributor Author

@BridgeAR @joyeecheung can you please review it now

See [directory structure overview][] for outline of existing test & locations.
When deciding on whether to expand an existing test file or create a new one,
consider going through the files related to the subsystem.
For example viewing tests for `test-streams` when writing for `lib/streams.js`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...when writing a test for..?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes made.

@joyeecheung
Copy link
Member

See [directory structure overview][] for outline of existing test & locations.
When deciding on whether to expand an existing test file or create a new one,
consider going through the files related to the subsystem.
For example viewing tests for `test-streams` when writing a test for `lib/streams.js`.
Copy link
Member

@BridgeAR BridgeAR Mar 1, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should fail in the linter as it is above 80 characters.

@mmarchini
Copy link
Contributor

@juggernaut451
Copy link
Contributor Author

@mmarchini I can't find any issue with the above CI.

@gibfahn
Copy link
Member

gibfahn commented Mar 5, 2018

@mmarchini I can't find any issue with the above CI.

Yep, CI was green.

Copy link
Member

@gibfahn gibfahn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with suggestion

@@ -381,3 +388,4 @@ will depend on what is being tested if this is required or not.
[all maintained branches]: https://github.com/nodejs/lts
[node.green]: http://node.green/
[test fixture]: https://github.com/google/googletest/blob/master/googletest/docs/Primer.md#test-fixtures-using-the-same-data-configuration-for-multiple-tests
[directory structure overview]: https://github.com/nodejs/node/blob/master/test/README.md
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be a good idea to change this to:

https://github.com/nodejs/node/blob/master/test/README.md#test-directories

so it links directly to the correct section.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes made :)

@gibfahn
Copy link
Member

gibfahn commented Mar 9, 2018

@juggernaut451
Copy link
Contributor Author

Resolved :)

Copy link
Member

@trivikr trivikr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@trivikr
Copy link
Member

trivikr commented Mar 25, 2018

@trivikr
Copy link
Member

trivikr commented Mar 25, 2018

Landed in 59b5d77

@trivikr trivikr closed this Mar 25, 2018
trivikr pushed a commit that referenced this pull request Mar 25, 2018
PR-URL: #18802
Fixes: #18774
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matheus Marchini <matheus@sthima.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
targos pushed a commit that referenced this pull request Mar 27, 2018
PR-URL: #18802
Fixes: #18774
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matheus Marchini <matheus@sthima.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
BethGriggs pushed a commit that referenced this pull request Dec 3, 2018
PR-URL: #18802
Fixes: #18774
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matheus Marchini <matheus@sthima.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
@BethGriggs BethGriggs mentioned this pull request Dec 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.