Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Wrong path taken when using packwerk #36

Open
Simonpedro opened this issue May 8, 2024 · 10 comments
Open

Wrong path taken when using packwerk #36

Simonpedro opened this issue May 8, 2024 · 10 comments
Assignees
Labels
bug Something isn't working

Comments

@Simonpedro
Copy link

In our application we have packs and sometimes we colocate specs inside them.

For example, we have the feature spec packs/test_results/spec/features/review_results_spec.rb, but when running it with the extension it tries to execute bundle exec rspec --color spec/features/review_results_spec.rb, omitting the packs/test_results/ part.

I'l be happy to work on this issue if you think it's a legit one. Thanks!

@thadeu
Copy link
Owner

thadeu commented May 15, 2024

Hey @Simonpedro Thanks for open this issue.

Interesting use case, I've never see this scene. So, instead app/ or /app/app (like devcontainer) you have packs/.

In theory it will be easy fix it, but I'll create a some tests to cover other prefix like your.

If you free feel, open a PR with this change and I'll accept as soon as.

@Simonpedro
Copy link
Author

Thanks for the reply @thadeu. Exactly, since we're using packwerk. Perfect, I'll work on it soon 👍

@traviskroberts
Copy link

@Simonpedro Have you had a chance to look into this? I'm running into the same problem.

@Simonpedro
Copy link
Author

@traviskroberts I started looking into the code but couldn't find the time to work on it. You're more than welcome to give it a try if you'd like. Otherwise I'll see if I can invest some time next week.

@thadeu
Copy link
Owner

thadeu commented Aug 14, 2024

Ok guys, I think that I'll into the problem today, so I would like to you that waiting for a couple time. I'll fix them soon.

@thadeu thadeu added the bug Something isn't working label Aug 14, 2024
@thadeu
Copy link
Owner

thadeu commented Aug 16, 2024

Hey @Simonpedro do you use devcontainer together? I'm has been difficult to simulate your environment. Can you give me more details? Like as:

Do you se devcontainer?
Do you use workspace single or multiple folders?

I'm imagine that you use uri like /packwerk/packs/test_results/spec/features/review_results_spec.rb

Given that, packwerk is a folder inside root devcontainer and packs maybe be project folder, is that right?

@Simonpedro
Copy link
Author

Hey @Simonpedro do you use devcontainer together? I'm has been difficult to simulate your environment. Can you give me more details? Like as:

Do you se devcontainer? Do you use workspace single or multiple folders?

I'm imagine that you use uri like /packwerk/packs/test_results/spec/features/review_results_spec.rb

Given that, packwerk is a folder inside root devcontainer and packs maybe be project folder, is that right?

Hi @thadeu, I'm using VS Code locally. The packs folder is a sibling of app, under to root project directory, and there is no packwerk folder. The file path relative to the project root would be packs/test_results/spec/features/review_results/review_results_spec.rb.

I noticed you opened a PR for this! 🙇

@thadeu
Copy link
Owner

thadeu commented Aug 21, 2024

Hey @Simonpedro do you use devcontainer together? I'm has been difficult to simulate your environment. Can you give me more details? Like as:
Do you se devcontainer? Do you use workspace single or multiple folders?
I'm imagine that you use uri like /packwerk/packs/test_results/spec/features/review_results_spec.rb
Given that, packwerk is a folder inside root devcontainer and packs maybe be project folder, is that right?

Hi @thadeu, I'm using VS Code locally. The packs folder is a sibling of app, under to root project directory, and there is no packwerk folder. The file path relative to the project root would be packs/test_results/spec/features/review_results/review_results_spec.rb.

I noticed you opened a PR for this! 🙇

Ok @Simonpedro I'll run my changes on your file path in order to check if the change will fix this issue.

@alexevanczuk
Copy link

Hi all! I am just running into this problem.

We have tests in two places:

  1. spec/domain/path/to/something_spec.rb
  2. packs/my_pack/spec/domain/path/to/something_spec.rb

Is there a way to configure this extension to simply run the test file that's open, relative to the root directory? Can I turn off the guessing of the folder entirely?

@thadeu
Copy link
Owner

thadeu commented Dec 15, 2024

@alexevanczuk I've a PR working in progress to resolve this issue. I hope next week to release it.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants