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

wrong path reported by k6 with transpiled test #5

Closed
pablochacin opened this issue Apr 17, 2024 · 1 comment · Fixed by #6
Closed

wrong path reported by k6 with transpiled test #5

pablochacin opened this issue Apr 17, 2024 · 1 comment · Fixed by #6

Comments

@pablochacin
Copy link

pablochacin commented Apr 17, 2024

I created a test which is located at k6tests/abort.ts

import exec from 'k6/execution';

export default function(){
     exec.test.abort("failed")
}

I'm compiling it into a tmp file and running it with k6

k6pack --sourcemap k6tests/abort.ts > /tmp/abort.js

k6 run /tmp/abort.js

I get this error message from k6: (some output omitted)

     execution: local
        script: /tmp/abort.js
        output: -

ERRO[0000] test aborted: failed at abort_default (file:///tmp/k6tests/abort.ts:5:0(7))

So, the path to the error is almost right, except that it is adding /tmp/ which is the directory where the js file is.

Interestingly, if I pipe k6pack's output to k6 I get this error: (some output omitted)


k6pack --sourcemap k6tests/abort.ts | k6 run -

     execution: local
        script: -
        output: -

ERRO[0000] test aborted: failed at abort_default (file:///k6tests/abort.ts:5:0(7)) 

So apparently k6 is adding the path to the input js file to the path to the original typescript file. I'm not sure if this a problem with the source map or with k6.

@szkiba
Copy link
Collaborator

szkiba commented Apr 17, 2024

@pablochacin thank you for reporting this (and for a detailed description). I'll investigate it soon...

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 a pull request may close this issue.

2 participants