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

File resolution should print the filepath on error messages #3615

Open
ORESoftware opened this issue Feb 27, 2024 · 1 comment
Open

File resolution should print the filepath on error messages #3615

ORESoftware opened this issue Feb 27, 2024 · 1 comment

Comments

@ORESoftware
Copy link

ORESoftware commented Feb 27, 2024

Brief summary

I am sorry to report that this is a bug, and you probably won't believe me, I think k6 can locate the file, but some other immediate error happens:


#!/usr/bin/env bash

cd "$(dirname "$BASH_SOURCE")";

k6 run --config config.json test-js.js  ## this one fails

exit 0;
k6 run --config config.json test.js   ## this file works

the result:


          /\      |‾‾| /‾‾/   /‾‾/   
     /\  /  \     |  |/  /   /  /    
    /  \/    \    |     (   /   ‾‾\  
   /          \   |  |\  \ |  (‾)  | 
  / __________ \  |__| \__\ \_____/ .io

ERRO[0000] The moduleSpecifier "test-js.js" couldn't be found on local disk. Make sure that you've specified the right path to the file. If you're running k6 using the Docker image make sure you have mounted the local directory (-v /local/path/:/inside/docker/path) containing your script and modules so that they're accessible by k6 from inside of the container, see https://grafana.com/docs/k6/latest/using-k6/modules/#using-local-modules-with-docker. 

Please put the path(s) where it is searching for in the error message:

̶E̶R̶R̶O̶[̶0̶0̶0̶0̶]̶ ̶T̶h̶e̶ ̶m̶o̶d̶u̶l̶e̶S̶p̶e̶c̶i̶f̶i̶e̶r̶ ̶"̶t̶e̶s̶t̶-̶j̶s̶.̶j̶s̶"̶ ̶c̶o̶u̶l̶d̶n̶'̶t̶ ̶b̶e̶ ̶f̶o̶u̶n̶d̶ ̶o̶n̶ ̶l̶o̶c̶a̶l̶ ̶d̶i̶s̶k̶.̶

instead, please:

ERRO[0000] The moduleSpecifier "test-js.js" couldn't be found on local disk, here: <the path>

k6 version

k6 v0.49.0 (go1.21.6, darwin/amd64)

OS

k6 v0.49.0 (go1.21.6, darwin/amd64)

Docker version and image (if applicable)

n/a

Steps to reproduce the problem

the script above

Expected behaviour

expect to load file

Actual behaviour

must be something about -js.js idk

@ORESoftware
Copy link
Author

ok update, the file name was wrong, all I can ask is to print the file directory that is being searched

Please put the path(s) where it is searching for in the error message:

̶E̶R̶R̶O̶[̶0̶0̶0̶0̶]̶ ̶T̶h̶e̶ ̶m̶o̶d̶u̶l̶e̶S̶p̶e̶c̶i̶f̶i̶e̶r̶ ̶"̶t̶e̶s̶t̶-̶j̶s̶.̶j̶s̶"̶ ̶c̶o̶u̶l̶d̶n̶'̶t̶ ̶b̶e̶ ̶f̶o̶u̶n̶d̶ ̶o̶n̶ ̶l̶o̶c̶a̶l̶ ̶d̶i̶s̶k̶.̶

instead, please:

ERRO[0000] The moduleSpecifier "test-js.js" couldn't be found on local disk, we searched here: <the path>

@codebien codebien changed the title file path resolution fail File resolution should print the filepath on error messages Feb 29, 2024
@codebien codebien removed their assignment Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants