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

CallerInfo change prints sandbox path in error trace when using Bazel #1230

Closed
OscarVanL opened this issue Jul 14, 2022 · 1 comment · Fixed by #1288
Closed

CallerInfo change prints sandbox path in error trace when using Bazel #1230

OscarVanL opened this issue Jul 14, 2022 · 1 comment · Fixed by #1288

Comments

@OscarVanL
Copy link

OscarVanL commented Jul 14, 2022

When I run my tests via Bazel, after the 1.8.0 change where CallerInfo displays the full path to the terminal I now get quite spammy outputs. Looks to be from #1201

This is because Bazel runs your code within a sandbox, and this change is now printing the path to the sandbox location rather than the sources location.

Eg:

bazel test --test_output=errors //...

--- FAIL: TestFooUnitTestSuite (0.01s)
    --- FAIL: TestFooUnitTestSuite/TestBar(0.00s)
        --- FAIL: TestFoo/TestBar/When_there_is_an_error (0.00s)
            foo_test.go:1694: 
                        Error Trace:    /private/var/tmp/_bazel_oscar/5dc9f0e710b2578b352c533d7f70060e/sandbox/darwin-sandbox/929/execroot/my_bazel_workspace/bazel-out/darwin-fastbuild/bin/src/foo/internal/datastore/datastore_test_/datastore_test.runfiles/my_bazel_workspace/src/foo/internal/datastore/foo_test.go:1694

Ideally, instead of this huge string it would just print src/foo/internal/datastore/foo_test.go:1694 as the path

As a result of this change, I can no longer CTRL+Click on the error trace path to find the responsible source code as VSCode doesn't understand this huge path.

Is there any way to switch to the old error trace path in this case? Thanks!

@twelvelabs
Copy link

Same issue - it's really hard to parse test failures w/ text wrapping.

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