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: add regex to assert in test_cyclic_link_protection #11622

Closed
wants to merge 8 commits into from
Closed

test: add regex to assert in test_cyclic_link_protection #11622

wants to merge 8 commits into from

Conversation

clarenced
Copy link
Contributor

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 Feb 28, 2017
@mscdex mscdex added the fs Issues and PRs related to the fs subsystem / file system. label Feb 28, 2017
@Trott
Copy link
Member

Trott commented Mar 1, 2017

@clarenced
Copy link
Contributor Author

@Trott Any idea how to fix the failing tests ?

@Trott
Copy link
Member

Trott commented Mar 2, 2017

@clarenced It looks like you've uncovered a small bug in the test! Aggravating as that may be to you, I say: Well done! Let's fix it!

The problem is that line 209 on your test is asserting on Windows. Here's line 209:

assert.strictEqual(err.path, entry);

If we look at the error output, we see that err.path is this:

c:\workspace\node-test-binary-windows\RUN_SUBSET\3\VS_VERSION\vcbt2015\label\win10\test\tmp.0\cycles\realpath-3a

...while entry is this:

c:\workspace\node-test-binary-windows\RUN_SUBSET\3\VS_VERSION\vcbt2015\label\win10\test\tmp.0/cycles/realpath-3a

If you scroll all the way to the right on the entry value, you'll see that it stops using the Windows separator \ and starts using the POSIX separator /! Whoops!

This is a bug in the test but we only found it because you made the test more strict!

To fix this, you need to take things like line 194:

const entry = common.tmpDir + '/cycles/realpath-3a';

...and fix them up to use path so that separators get normalized:

const entry = path.join(common.tmpDir, '/cycles/realpath-3a');

(path.join() is smart enough to treat / as a separator in input, even on Windows so the above could should be fine.)

Basically, anywhere that strings with / are being joined together as paths using +, you need to replace it with path.join().

Sorry about this change being a bit more work than I realized when I suggested it! Still, I think this is totally do-able. Thanks for sticking with it!

@clarenced
Copy link
Contributor Author

Hi @Trott, I am trying to push my modifications on my branch, but I have an error

To https://github.com/clarenced/node.git
 ! [rejected]        test_11498 -> test_11498 (non-fast-forward)
error: failed to push some refs to 'https://github.com/USERNAME/REPOSITORY.git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes (e.g. 'git pull') before pushing again.  See the
'Note about fast-forwards' section of 'git push --help' for details.

Should I do a pull --rebase before pushing?

@addaleax
Copy link
Member

addaleax commented Mar 4, 2017

@clarenced I guess you git commit --amended your changes or did something like that?

In any case, you should be able to push using git push --force-with-lease :)

@clarenced
Copy link
Contributor Author

Hi @Trott I have the changes as suggested, is there anything else to do ?

@addaleax
Copy link
Member

addaleax commented Mar 9, 2017

Copy link
Member

@Trott Trott left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for doing this!

@addaleax
Copy link
Member

Landed in 7a4adb5! 🎉 Thanks for doing this!

@addaleax addaleax closed this Mar 10, 2017
addaleax pushed a commit that referenced this pull request Mar 10, 2017
PR-URL: #11622
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
italoacasas pushed a commit to italoacasas/node that referenced this pull request Mar 13, 2017
PR-URL: nodejs#11622
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
jungx098 pushed a commit to jungx098/node that referenced this pull request Mar 21, 2017
PR-URL: nodejs#11622
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
@MylesBorins
Copy link
Contributor

This uses api's that don't exist in v6.x

Please manually backport or add do-not-land label

gibfahn pushed a commit that referenced this pull request Jun 19, 2017
PR-URL: #11622
Backport-PR-URL: #13785
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
gibfahn pushed a commit that referenced this pull request Jun 20, 2017
PR-URL: #11622
Backport-PR-URL: #13785
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
MylesBorins pushed a commit that referenced this pull request Jul 11, 2017
PR-URL: #11622
Backport-PR-URL: #13785
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
@MylesBorins MylesBorins mentioned this pull request Jul 18, 2017
abhishekumar-tyagi pushed a commit to abhishekumar-tyagi/node that referenced this pull request May 5, 2024
PR-URL: nodejs/node#11622
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fs Issues and PRs related to the fs subsystem / file system. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants