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

Fix parsing of stack traces on windows #183

Closed
wants to merge 1 commit into from
Closed

Fix parsing of stack traces on windows #183

wants to merge 1 commit into from

Conversation

Joris-van-der-Wel
Copy link
Contributor

functionName, file, line, column will now be properly set in result objects (and subsequently tape text output).

I wanted to add a test case, however having to workaround __dirname is probably not worth the effort (and would make the test case itself change behaviour based on the host OS too)

`functionName`, `file`, `line`, `column` will now be properly set in result objects (and subsequently tape text output)
@ljharb
Copy link
Collaborator

ljharb commented Jan 9, 2019

@Joris-van-der-Wel sorry this has been so long; can you click the "allow edits" checkbox on the right hand side of the PR, and i think having a test case - even one that only runs on windows, or that has different expected output based on the OS - is important. Could you add one?

@Joris-van-der-Wel
Copy link
Contributor Author

I will have to see if I can find some time to rebase and add a test case (I do not have any time for this in the next days).

@ljharb
Copy link
Collaborator

ljharb commented Jan 9, 2019

Thanks, much appreciated!

@ljharb
Copy link
Collaborator

ljharb commented Dec 28, 2019

@Joris-van-der-Wel are you still interested in completing this PR? i'd love to get it in.

@Joris-van-der-Wel
Copy link
Contributor Author

It looks to me that this issue has already been accidentally fixed over the last few years:

tmp.js

const test = require('./');
test('foo', function (t) {
    t.plan(1);
    t.equal(1 + 1, 3);
});

Command prompt

E:\projects\node.js\tape> git checkout v4.2.0
E:\projects\node.js\tape> node tmp.js
TAP version 13
# foo
not ok 1 should be equal
  ---
    operator: equal
    expected: 3
    actual:   2
  ...

1..1
# tests 1
# pass  0
# fail  1
E:\projects\node.js\tape> git checkout v4.12.1
E:\projects\node.js\tape> node tmp.js
TAP version 13
# foo
not ok 1 should be equal
  ---
    operator: equal
    expected: 3
    actual:   2
    at: Test.<anonymous> (E:\projects\node.js\tape\tmp.js:5:7)
    stack: |-
      Error: should be equal
          at Test.assert [as _assert] (E:\projects\node.js\tape\lib\test.js:226:54)
          at Test.bound [as _assert] (E:\projects\node.js\tape\lib\test.js:78:32)
          at Test.equal (E:\projects\node.js\tape\lib\test.js:387:10)
          at Test.bound [as equal] (E:\projects\node.js\tape\lib\test.js:78:32)
          at Test.<anonymous> (E:\projects\node.js\tape\tmp.js:5:7)
          at Test.bound [as _cb] (E:\projects\node.js\tape\lib\test.js:78:32)
          at Test.run (E:\projects\node.js\tape\lib\test.js:94:10)
          at Test.bound [as run] (E:\projects\node.js\tape\lib\test.js:78:32)
          at Immediate.next [as _onImmediate] (E:\projects\node.js\tape\lib\results.js:81:19)
          at runCallback (timers.js:693:18)
  ...

1..1
# tests 1
# pass  0
# fail  1

I tried to run a git bisect, but there is a huge merge commit from February that makes it very hard to do so (6209882 ).

@ljharb
Copy link
Collaborator

ljharb commented Dec 29, 2019

eesh, true - that merge commit is just bringing together lots of past published version tags. It might be easier to do the bisect by manually checking out different version tags rather than using git bisect run.

Would you be interested in updating this PR to instead contain a test case? If not, we can close it.

@ljharb
Copy link
Collaborator

ljharb commented Jan 4, 2021

ping @Joris-van-der-Wel

@Joris-van-der-Wel Joris-van-der-Wel closed this by deleting the head repository Jan 2, 2024
@ljharb
Copy link
Collaborator

ljharb commented Jan 2, 2024

@Joris-van-der-Wel unfortunately, you deleted the fork, so this PR is unrecoverable :-(

@Joris-van-der-Wel
Copy link
Contributor Author

Oh oops. I still had a local copy and I managed to recreate the fork, if that helps.

I have not actually used this project in 9 years so it is a bit hard to wrap my head around this issue again.

@ljharb
Copy link
Collaborator

ljharb commented Jan 4, 2024

Makes sense - all I’d really want is a test case; i can try to validate it on windows myself and fix it if needed.

@Joris-van-der-Wel
Copy link
Contributor Author

Continued in a new PR: #602

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants