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: cleanup test require symlink #8305

Closed
wants to merge 2 commits into from

Conversation

paulgrock
Copy link
Contributor

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

test

Description of change
  • Changed indexOf to includes for clarity.
  • Switched to assert.strictEqual from assert.equal
  • Changed some var to const
  • Test cleanup with common.refreshTmpDir

* Changed `==` to `includes` for clarity.
* Switched to `assert.strictEqual` from `assert.equal`
* Changed some `var` to `const`
* Test cleanup with `common.refreshTmpDir`
@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Aug 27, 2016
@Trott
Copy link
Member

Trott commented Aug 27, 2016

@Trott
Copy link
Member

Trott commented Aug 27, 2016

Changes LGTM if CI is happy.

There's an additional potential improvement around avoiding writing to the fixture directory. But that can be a separate good first contribution for someone else. It would involve copying the fixture to the temp directory or otherwise recreating the directory structure in the temp directory. The price for the do-not-write-to-the-fixture-dir purity will be increased text complexity. I'm OK with leaving that out of this PR.

@Trott
Copy link
Member

Trott commented Aug 27, 2016

CI is green.

@mscdex mscdex added the module Issues and PRs related to the module subsystem. label Aug 28, 2016
if (err || o.indexOf('SeCreateSymbolicLinkPrivilege') == -1) {
console.log('Skipped: insufficient privileges');
if (err || !o.includes('SeCreateSymbolicLinkPrivilege')) {
common.skip('Skipped: insufficient privileges');
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you drop the Skipped: part.

Copy link
Contributor

Choose a reason for hiding this comment

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

Might actually be worthwhile to lint for Skipped: in strings in tests come to think of it.

Copy link
Contributor Author

@paulgrock paulgrock Aug 28, 2016

Choose a reason for hiding this comment

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

Sure I can change it. Do you want me to revert it back to console.log or just remove this line?

Copy link
Contributor

Choose a reason for hiding this comment

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

Keep common.skip(). There is just no need to say you're skipping in skip().

Copy link
Member

Choose a reason for hiding this comment

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

In other words, change this:

common.skip('Skipping: insufficient privileges');

to something like this:

common.skip('insufficient privileges');

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Whoops sorry misread the initial comment by @cjihrig. Fixed now

@cjihrig
Copy link
Contributor

cjihrig commented Aug 28, 2016

LGTM with a comment.

@benjamingr
Copy link
Member

LGTM

2 similar comments
@addaleax
Copy link
Member

LGTM

@jasnell
Copy link
Member

jasnell commented Aug 29, 2016

LGTM

jasnell pushed a commit that referenced this pull request Aug 30, 2016
* Changed `==` to `includes` for clarity.
* Switched to `assert.strictEqual` from `assert.equal`
* Changed some `var` to `const`
* Test cleanup with `common.refreshTmpDir`

PR-URL: #8305
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@jasnell
Copy link
Member

jasnell commented Aug 30, 2016

Landed in eca74a9! Thank you!

@jasnell jasnell closed this Aug 30, 2016
@Fishrock123 Fishrock123 mentioned this pull request Sep 6, 2016
Fishrock123 pushed a commit to Fishrock123/node that referenced this pull request Sep 8, 2016
* Changed `==` to `includes` for clarity.
* Switched to `assert.strictEqual` from `assert.equal`
* Changed some `var` to `const`
* Test cleanup with `common.refreshTmpDir`

PR-URL: nodejs#8305
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Fishrock123 pushed a commit that referenced this pull request Sep 9, 2016
* Changed `==` to `includes` for clarity.
* Switched to `assert.strictEqual` from `assert.equal`
* Changed some `var` to `const`
* Test cleanup with `common.refreshTmpDir`

PR-URL: #8305
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module Issues and PRs related to the module subsystem. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants