-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
Conversation
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.
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.
doc/guides/writing-tests.md
Outdated
@@ -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 |
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.
exist -> exists
doc/guides/writing-tests.md
Outdated
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 |
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.
A nit: missing period.
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.
did not get this one. Can you please elaborate
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.
Sorry. I think file available
should be file available.
(with a dot).
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.
resolved :)
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.
Thanks for taking this on @juggernaut451 — some small feedback below.
doc/guides/writing-tests.md
Outdated
@@ -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) |
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.
General nit: please keep lines to 80 chars. I think URLs can, maybe, be excepted.
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.
thanks 👍
doc/guides/writing-tests.md
Outdated
@@ -18,6 +18,13 @@ Add tests when: | |||
- Fixing regressions and bugs. | |||
- Expanding test coverage. | |||
|
|||
## Where does the test go |
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.
This would sound better as "Where are tests located" (maybe "Where are the..." but that's getting clunky) or even "Test directory structure".
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.
changing it to "Test directory structure"
doc/guides/writing-tests.md
Outdated
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. |
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.
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.)
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.
Does above description answers #18774 second 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.
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.
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.
Thanks making changes with the above one. :)
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.
changes made.
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.
Thank you for feedback.
doc/guides/writing-tests.md
Outdated
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`) |
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.
Nit: can you wrap this to 80-chars? Also maybe ones starting with `test-streams-` for `lib/streams.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.
fixing 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.
@joyeecheung fixed. Kindly have a look
7899496
to
0493c0e
Compare
0493c0e
to
ca0448b
Compare
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.
Just a few nits, LG otherwise.
doc/guides/writing-tests.md
Outdated
For example, take a look at tests starting with "test-streams" | ||
when writing tests for `lib/streams.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.
Please keep this consistent with the other places in the doc and only use a single new line :-)
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.
changes made.
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.
Hm, this does not seem to be addressed?
doc/guides/writing-tests.md
Outdated
@@ -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) |
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.
Since this is longer than 80 characters, please move the reference down to the end of the file and only keep [directory structure overview][]
.
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.
changes made.
doc/guides/writing-tests.md
Outdated
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` |
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.
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.
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.
changes made.
doc/guides/writing-tests.md
Outdated
@@ -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) |
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.
Adding a new line after the header would be good for consistency as well.
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.
changes made.
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.
Can you please make sure the lines do not exceed 80 characters? :-)
doc/guides/writing-tests.md
Outdated
## 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. |
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.
The punctuation at the end should be ,
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.
changes made :)
doc/guides/writing-tests.md
Outdated
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` |
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.
Missing .
at the end.
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.
changes made :)
doc/guides/writing-tests.md
Outdated
## 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. |
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.
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.
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.
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.
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 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.
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.
ok got it.
@BridgeAR @joyeecheung can you please review it now |
doc/guides/writing-tests.md
Outdated
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`. |
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.
...when writing a test for..
?
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.
changes made.
doc/guides/writing-tests.md
Outdated
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`. |
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.
This should fail in the linter as it is above 80 characters.
@mmarchini I can't find any issue with the above CI. |
Yep, CI was green. |
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.
LGTM with suggestion
doc/guides/writing-tests.md
Outdated
@@ -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 |
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.
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.
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.
changes made :)
cfe1481
to
fc0c5b4
Compare
Resolved :) |
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.
LGTM
Landed in 59b5d77 |
PR-URL: #18802 Fixes: #18774 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Matheus Marchini <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]> Reviewed-By: Shingo Inoue <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
PR-URL: #18802 Fixes: #18774 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Matheus Marchini <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]> Reviewed-By: Shingo Inoue <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
PR-URL: #18802 Fixes: #18774 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Matheus Marchini <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]> Reviewed-By: Shingo Inoue <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
doc
Fixes: #18774