P403n1x87 / austin-vscode

Austin extension for Visual Studio Code
MIT License
21 stars 4 forks source link

VS code extension reports "profiling complete" for non-existent files #65

Open rwarren opened 5 months ago

rwarren commented 5 months ago

Description

If you misconfigure an austin vscode task to run a file that does not exist, it seems to work (saying "Profiling complete")... but clearly does not.

Steps to Reproduce

  1. Define an austin task for a file that does not exist (per below)
  2. Run the task
  3. Check the Terminal output to see the "Profiling complete" message

Here is a sample tasks.json file that shows the behaviour:

{
    "version": "2.0.0",
    "tasks": [
        {
            "type": "austin",
            "file": "does_not_exist.py",
            "args": ["--verbose"],
            "label": "Profile main.py",
        }
    ]
}

Expected behavior:

I expect the extension to provide a clear error that the file to profile does not exist.

Actual behavior:

The Austin extension reports "Profiling complete" as if nothing is wrong, per below:

Starting Profiler in /home/russ/code/possm_tools.
Running 'austin' with args '-i 100 --pipe /home/russ/venvs/austin_testing/bin/python /home/russ/code/austin_testing/does_not_exist.py --verbose'.
Profiling complete.
 *  Terminal will be reused by tasks, press any key to close it. 
 *

Reproduces how often:

100% of the time.

Additional info

On a path-related note... it would also be nice if the vscode extension docs indicates what paths will be used when austin is run as a task. For example:

1, What path is used for the "file": input in the task? Can expansions like ${workspaceFolder} be used?

  1. What working directory will the process being executed by Austin get?

Versions

austin 3.6.0

P403n1x87 commented 5 months ago

@rwarren thanks for the feedback. I'll see if I can improve this with better error reporting!