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 the common/fixtures module to load the fixtures #16823

Closed

Conversation

javierblancosp
Copy link

Use the common/fixtures module to load the fixtures on test-hash-seed file

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

test:

@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Nov 6, 2017
@javierblancosp javierblancosp changed the title 💄 use the common/fixtures module to load the fixtures test: use the common/fixtures module to load the fixtures Nov 6, 2017
@mscdex mscdex added the child_process Issues and PRs related to the child_process subsystem. label Nov 6, 2017
@mscdex
Copy link
Contributor

mscdex commented Nov 6, 2017

Commit message is too long.

@gireeshpunathil gireeshpunathil added the code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. label Nov 6, 2017
@@ -1,20 +1,21 @@
'use strict';

// Check that spawn child don't create duplicated entries
Copy link
Contributor

Choose a reason for hiding this comment

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

don't --> doesn't

Copy link
Member

@joyeecheung joyeecheung left a comment

Choose a reason for hiding this comment

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

Hi, thank you for working on this!

@@ -1,20 +1,21 @@
'use strict';

// Check that spawn child doesn't create duplicated entries
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.

This does not seem to work without relative paths, can you change it to require('../common')?

const cp = require('child_process');
const path = require('path');
const targetScript = path.resolve(common.fixturesDir, 'guess-hash-seed.js');
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.

Can you change this to const fixtures = require('../common/fixtures')?

seeds.push(seed);
}

console.log(`Seeds: ${seeds}`);
const hasDuplicates = (new Set(seeds)).size !== seeds.length;
const hasDuplicates = new Set(seeds).size !== seeds.length;
assert.strictEqual(hasDuplicates, false);
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 this could just be changed to assert.strictEqual(new Set(seeds).size, seeds.length); and drop the hasDuplicates

@gireeshpunathil
Copy link
Member

@joyeecheung - PTAL

@gireeshpunathil
Copy link
Member

@Trott
Copy link
Member

Trott commented Nov 7, 2017

CI is good. I canceled AIX because it's taking hours right now and this is unlikely to trigger something AIX-specific.

Trott pushed a commit to Trott/io.js that referenced this pull request Nov 12, 2017
Replace `common.fixturesDir` with `fixtures.path()` usage in
test/pummel/test-hash-seed.js.

PR-URL: nodejs#16823
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@Trott
Copy link
Member

Trott commented Nov 12, 2017

Landed in 5f398b3.
Thanks for the contribution! 🎉

Because pummel tests do not run in CI, I ran this locally first to make sure it was working. Results were 👍 .

@Trott Trott closed this Nov 12, 2017
evanlucas pushed a commit that referenced this pull request Nov 13, 2017
Replace `common.fixturesDir` with `fixtures.path()` usage in
test/pummel/test-hash-seed.js.

PR-URL: #16823
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@evanlucas evanlucas mentioned this pull request Nov 13, 2017
MylesBorins pushed a commit that referenced this pull request Nov 17, 2017
Replace `common.fixturesDir` with `fixtures.path()` usage in
test/pummel/test-hash-seed.js.

PR-URL: #16823
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this pull request Nov 17, 2017
Replace `common.fixturesDir` with `fixtures.path()` usage in
test/pummel/test-hash-seed.js.

PR-URL: #16823
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@gibfahn gibfahn mentioned this pull request Nov 21, 2017
@MylesBorins MylesBorins mentioned this pull request Nov 21, 2017
MylesBorins pushed a commit that referenced this pull request Nov 21, 2017
Replace `common.fixturesDir` with `fixtures.path()` usage in
test/pummel/test-hash-seed.js.

PR-URL: #16823
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this pull request Nov 28, 2017
Replace `common.fixturesDir` with `fixtures.path()` usage in
test/pummel/test-hash-seed.js.

PR-URL: #16823
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
child_process Issues and PRs related to the child_process subsystem. code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants