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

test: rename regression tests with descriptive file names #19212

Closed
wants to merge 10 commits into from

Conversation

ryzokuken
Copy link
Contributor

@ryzokuken ryzokuken commented Mar 7, 2018

Rename the tests appropriately alongside mentioning the subsystem
Also, make a few basic changes to make sure the tests conforms to the standard test structure

Refs: #19105
Refs: https://github.com/nodejs/node/blob/master/doc/guides/writing-tests.md#test-structure

Checklist

  • test/parallel/test-regress-GH-1531.js
  • test/parallel/test-regress-GH-2245.js
  • test/parallel/test-regress-GH-3238.js
  • test/parallel/test-regress-GH-3542.js
  • test/parallel/test-regress-GH-3739.js
  • test/parallel/test-regress-GH-4256.js

Rename the test appropriately alongside mentioning the subsystem
Also, make a few basic changes to make sure the test conforms
to the standard test structure

Refs: nodejs#19105
Refs: https://github.com/nodejs/node/blob/master/doc/guides/writing-tests.md#test-structure
@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Mar 7, 2018
@ryzokuken ryzokuken changed the title test: rename test-regress-GH-1531 [WIP] test: rename regression tests with descriptive file names Mar 7, 2018
Rename the test appropriately alongside mentioning the subsystem
Also, make a few basic changes to make sure the test conforms
to the standard test structure

Refs: nodejs#19105
Refs: https://github.com/nodejs/node/blob/master/doc/guides/writing-tests.md#test-structure
Rename the test appropriately alongside mentioning the subsystem
Also, make a few basic changes to make sure the test conforms
to the standard test structure

Refs: nodejs#19105
Refs: https://github.com/nodejs/node/blob/master/doc/guides/writing-tests.md#test-structure
Rename the test appropriately alongside mentioning the subsystem
Also, make a few basic changes to make sure the test conforms
to the standard test structure

Refs: nodejs#19105
Refs: https://github.com/nodejs/node/blob/master/doc/guides/writing-tests.md#test-structure
Rename the test appropriately alongside mentioning the subsystem
Also, make a few basic changes to make sure the test conforms
to the standard test structure

Refs: nodejs#19105
Refs: https://github.com/nodejs/node/blob/master/doc/guides/writing-tests.md#test-structure
Change test-fs-existssync-false.js to make sure it conforms to
the standard test structure.

Refs: https://github.com/nodejs/node/blob/master/doc/guides/writing-tests.md#test-structure
Rename the test appropriately alongside mentioning the subsystem
Also, make a few basic changes to make sure the test conforms
to the standard test structure

Refs: nodejs#19105
Refs: https://github.com/nodejs/node/blob/master/doc/guides/writing-tests.md#test-structure
@ryzokuken ryzokuken changed the title [WIP] test: rename regression tests with descriptive file names test: rename regression tests with descriptive file names Mar 8, 2018

const assert = require('assert');
const fs = require('fs');
const path = require('path');

if (!common.isWindows)
common.skip('Windows specific test.');
Copy link
Member

Choose a reason for hiding this comment

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

Nit: I don't think this should be moved. I think it should be left where it was.

@@ -1,5 +1,6 @@
'use strict';
const common = require('../common');
const fixtures = require('../common/fixtures');
Copy link
Member

Choose a reason for hiding this comment

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

Nit: I don't think this should be moved either. I think it should be left where it was.

@Trott
Copy link
Member

Trott commented Mar 8, 2018

No objections, seems like a good thing to me.

I do think the shuffling around of unrelated things shouldn't happen in this PR, or even happen at all. I think this is probably the most efficient and obvious order of things, which is how these tests already operate:

  • load common
  • check common.isWindows or whatever if we need to skip the test on some platforms
  • then load everything else because:
    • if there is a condition where the test will be skipped, we want that to be super-obvious to someone reading the test so put it right there at the top
    • there's no point in loading a bunch of other modules if we're just going to skip the test

@Trott
Copy link
Member

Trott commented Mar 8, 2018

(Thanks for doing this! Those test names have always been kind of meh to me.)


// Check that cluster works perfectly for both `kill` and `disconnect` cases.
// Also take into account that the `disconnect` event may be received after the
// `exit` event.
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Maybe add a link to the GH issue that this test was named for originally?

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 don't know how I could have missed this, will do.

@ryzokuken
Copy link
Contributor Author

ryzokuken commented Mar 8, 2018

@Trott I totally agree with you on the Windows part, I too agree that if the test is unrelated, it should be skipped as early as possible, even from a performance point of view.

Regarding const fixtures = require('../common/fixtures'); though, I moved it to the top so that it comforms to https://github.com/nodejs/node/blob/master/doc/guides/writing-tests.md#test-structure. Let me know if that's a non-issue and I'd move it right back.

P.S. I totally missed that it was perfectly conforming to the test structure, it was also about the "skipping" part. Fixing that in a sec.

Thanks.

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.

LGTM even though it would be nice if the nits would be addressed but that is not a blocker :-)

const assert = require('assert');
const fs = require('fs');
const path = require('path');

const tmpdir = require('../common/tmpdir');

Copy link
Member

Choose a reason for hiding this comment

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

Nit: I personally would not mode this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Isn't that in conflict with the canonical test structure?

Ref: https://github.com/nodejs/node/blob/master/doc/guides/writing-tests.md#lines-1-3

Copy link
Member

Choose a reason for hiding this comment

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

This is specific to the require('../common'); but it is fine to keep it as is.

const tmpdir = require('../common/tmpdir');

// This test ensures that fs.existsSync doesn't incorrectly return false
// (especially on Windows)
Copy link
Member

Choose a reason for hiding this comment

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

Nit: It would be nice to punctuate the new comments.

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.

Still LG

@joyeecheung
Copy link
Member

@BridgeAR BridgeAR added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Mar 10, 2018
BridgeAR pushed a commit to BridgeAR/node that referenced this pull request Mar 11, 2018
Rename the tests appropriately alongside mentioning the subsystem.
Also, make a few basic changes to make sure the test conforms
to the standard test structure.

This renames:
- test-regress-nodejsGH-1531
- test-regress-nodejsGH-2245
- test-regress-nodejsGH-3238
- test-regress-nodejsGH-3542
- test-regress-nodejsGH-3739
- test-regress-nodejsGH-4256

PR-URL: nodejs#19212
Refs: nodejs#19105
Refs: https://github.com/nodejs/node/blob/master/doc/guides/writing-tests.md#test-structure
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
@BridgeAR
Copy link
Member

Landed in 580ad01 🎉

@BridgeAR BridgeAR closed this Mar 11, 2018
targos pushed a commit that referenced this pull request Mar 17, 2018
Rename the tests appropriately alongside mentioning the subsystem.
Also, make a few basic changes to make sure the test conforms
to the standard test structure.

This renames:
- test-regress-GH-1531
- test-regress-GH-2245
- test-regress-GH-3238
- test-regress-GH-3542
- test-regress-GH-3739
- test-regress-GH-4256

PR-URL: #19212
Refs: #19105
Refs: https://github.com/nodejs/node/blob/master/doc/guides/writing-tests.md#test-structure
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
@targos targos mentioned this pull request Mar 18, 2018
MylesBorins pushed a commit that referenced this pull request Mar 20, 2018
Rename the tests appropriately alongside mentioning the subsystem.
Also, make a few basic changes to make sure the test conforms
to the standard test structure.

This renames:
- test-regress-GH-1531
- test-regress-GH-2245
- test-regress-GH-3238
- test-regress-GH-3542
- test-regress-GH-3739
- test-regress-GH-4256

PR-URL: #19212
Refs: #19105
Refs: https://github.com/nodejs/node/blob/master/doc/guides/writing-tests.md#test-structure
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
MayaLekova pushed a commit to MayaLekova/node that referenced this pull request May 8, 2018
Rename the tests appropriately alongside mentioning the subsystem.
Also, make a few basic changes to make sure the test conforms
to the standard test structure.

This renames:
- test-regress-nodejsGH-1531
- test-regress-nodejsGH-2245
- test-regress-nodejsGH-3238
- test-regress-nodejsGH-3542
- test-regress-nodejsGH-3739
- test-regress-nodejsGH-4256

PR-URL: nodejs#19212
Refs: nodejs#19105
Refs: https://github.com/nodejs/node/blob/master/doc/guides/writing-tests.md#test-structure
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
BethGriggs pushed a commit that referenced this pull request Oct 2, 2018
Rename the tests appropriately alongside mentioning the subsystem.
Also, make a few basic changes to make sure the test conforms
to the standard test structure.

This renames:
- test-regress-GH-1531
- test-regress-GH-2245
- test-regress-GH-3238
- test-regress-GH-3542
- test-regress-GH-3739
- test-regress-GH-4256

PR-URL: #19212
Refs: #19105
Refs: https://github.com/nodejs/node/blob/master/doc/guides/writing-tests.md#test-structure
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
@BethGriggs BethGriggs mentioned this pull request Oct 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants