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: use common.fixturesDir almost everywhere #6997

Closed
wants to merge 1 commit into from

Conversation

bengl
Copy link
Member

@bengl bengl commented May 26, 2016

Checklist
  • tests and code linting passes
  • a test and/or benchmark is included
  • the commit message follows commit guidelines
Affected core subsystem(s)

test

Description of change

Updating tests to use common.fixturesDir whenever possible/reasonable.
Left out things like tests for path and require.resolve.

@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label May 26, 2016
@@ -13,7 +14,7 @@ assert.equal('bar',
baseBar, // eslint-disable-line no-undef
'global.x -> x in base level not working');

var module = require('../fixtures/global/plain');
var module = require(path.join(common.fixturesDir, 'global/plain'));
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 do this: path.join(common.fixturesDir, 'global', 'plain')

@jasnell
Copy link
Member

jasnell commented May 26, 2016

LGTM with @cjihrig's nits addressed.

@bengl
Copy link
Member Author

bengl commented May 26, 2016

@cjihrig Ok, path.resolve is now gone from all of those, and split it up where there were slashes.

Also, CI: https://ci.nodejs.org/job/node-test-pull-request/2814/

@Fishrock123
Copy link
Contributor

CI doesn't seem happy. I see errors besides the regular address failures in there.

Concept seems fine though.

@@ -1,10 +1,10 @@
'use strict';
require('../common');
var common = require('../common');
Copy link
Member

Choose a reason for hiding this comment

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

Nit: const

Copy link
Member

Choose a reason for hiding this comment

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

It's a nit so you can ignore it, of course, but if you do want to const-ify common here, you can also do it in the other files too. (Looks like you used var where the file was doing that for other modules and const where it was already using that. Which is also just fine. Like I said: nit.)

Copy link
Member Author

Choose a reason for hiding this comment

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

Right, I kept with whatever was being used in the file, for least-confusion/impact.

I think const-ifying tests makes more sense in separate PR(s)/commit(s). SGTY?

@Trott
Copy link
Member

Trott commented May 27, 2016

At least some of the CI problems look like things that might be addressed by a9492f5 which isn't in this branch (and the CI wasn't run to rebase against master--aside: should we change that to be the default in node-test-pull-request?).

In short, rebase against master might help with the CI results a bit.

EDIT: Whoops, used the wrong commit hash, updated it. But if you clicked on it in your email and got a puzzling result, that's why.

@@ -43,7 +44,7 @@ assert.strictEqual(internalUtil.getHiddenValue(obj, 'foo'), 'bar');
let arrowMessage;

try {
require('../fixtures/syntax/bad_syntax');
require(path.join(common.fixturesDir, 'syntax/bad_syntax'));
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 make 'syntax' and 'bad_syntax' separate arguments.

@cjihrig
Copy link
Contributor

cjihrig commented May 27, 2016

LGTM pending nits and the CI.

Updating tests to use `common.fixturesDir` whenever possible/reasonable.
Left out things like tests for `path` and `require.resolve`.
@bengl
Copy link
Member Author

bengl commented May 27, 2016

Alright, nits addressed and new CI: https://ci.nodejs.org/job/node-test-pull-request/2828/

@Trott
Copy link
Member

Trott commented May 27, 2016

Looks like FreeBSD on CI might have a stray process hogging common.PORT. Just got on IRC and jbergstroem took care of it so that should fix that at least...

One more CI run because the last two have been Not Good: https://ci.nodejs.org/job/node-test-pull-request/2829/

@cjihrig
Copy link
Contributor

cjihrig commented Jun 1, 2016

@cjihrig
Copy link
Contributor

cjihrig commented Jun 2, 2016

@bengl the CI is green. Feel free to move forward with this.

bengl added a commit that referenced this pull request Jun 6, 2016
Updating tests to use `common.fixturesDir` whenever possible/reasonable.
Left out things like tests for `path` and `require.resolve`.

PR-URL: #6997
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@bengl
Copy link
Member Author

bengl commented Jun 6, 2016

Landed in cc2a88a

@bengl bengl closed this Jun 6, 2016
evanlucas pushed a commit that referenced this pull request Jun 15, 2016
Updating tests to use `common.fixturesDir` whenever possible/reasonable.
Left out things like tests for `path` and `require.resolve`.

PR-URL: #6997
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@evanlucas evanlucas mentioned this pull request Jun 16, 2016
@MylesBorins
Copy link
Contributor

@bengl would you be willing to backport to v4.x?

@MylesBorins
Copy link
Contributor

ping @bengl

@MylesBorins
Copy link
Contributor

I'm going to label this don't land. @bengl please feel free to backport

targos pushed a commit that referenced this pull request Dec 28, 2016
Updating tests to use `common.fixturesDir` whenever possible/reasonable.
Left out things like tests for `path` and `require.resolve`.

PR-URL: #6997
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
targos pushed a commit that referenced this pull request Jan 23, 2017
Updating tests to use `common.fixturesDir` whenever possible/reasonable.
Left out things like tests for `path` and `require.resolve`.

PR-URL: #6997
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
MylesBorins pushed a commit that referenced this pull request Jan 24, 2017
Updating tests to use `common.fixturesDir` whenever possible/reasonable.
Left out things like tests for `path` and `require.resolve`.

PR-URL: #6997
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@MylesBorins MylesBorins mentioned this pull request Jan 24, 2017
MylesBorins pushed a commit that referenced this pull request Feb 1, 2017
Updating tests to use `common.fixturesDir` whenever possible/reasonable.
Left out things like tests for `path` and `require.resolve`.

PR-URL: #6997
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants