Skip to content

VSCode "Debug" test cwd is workspace root, not package root for tests #13022

@Crzyrndm

Description

@Crzyrndm

Setup: https://github.com/Crzyrndm/ra-executing-directory

A package nested in a workspace, the tests (unit + integration) just print std::env::current_dir() and then panic (so that the print is always visible)

  • cargo test --no-fail-fast: prints the package root directory for both unit and integration no matter what directory it is run in
  • VSCode "Run test" button: prints the package root directory
  • VSCode "Debug" button: prints the workspace root directory

This makes debugging tests that need to load a data file quite awkward

image

rust-analyzer version: rust-lang.rust-analyzer 0.3.1170 (current stable)

rustc version: rustc 1.63.0 (4b91a6ea7 2022-08-08)

Tested OS is Windows 10

relevant settings:

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-vscodevscode plugin issuesC-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions