Closed baelter closed 3 years ago
Could you rebase this now that the other PR is merged? I assume you're using the VSCode-Ruby extension as the Ruby debugger?
Could you rebase this now that the other PR is merged? I assume you're using the VSCode-Ruby extension as the Ruby debugger?
Yes, ruby-debug-ide. Can be made configurable in the future.
Rebased, this PR also adds support for filePattern config for rspec.
ping @connorshea :)
@connorshea merging this PR will be awesome
Looking forward for this one :+1:
Hi @baelter !
I was trying to use this PR and debug works really good, but I stumbled upon an issue for running single test. When I try to start it, then all other tests were also running.
I suspect this change can cause a problem:
protected getTestCommand(): string {
let command: string = (vscode.workspace.getConfiguration('rubyTestExplorer', null).get('rspecCommand') as string);
- return command || 'bundle exec rspec';
+ const dir = this.getTestDirectory();
+ let pattern = this.getFilePattern().map(p => `${dir}/**/${p}`).join(',')
+ if (command && / (--pattern|-P) /.test(command)) {
+ return command
+ }
+ command = command || `bundle exec rspec`
+ return `${command} --pattern '${pattern}'`;
}
I think it is something related to --pattern
option for rspec
and maybe it overwrites default pattern and that's why all tests are run.
Here are logs from Ruby Test Explorer
for master branch:
[2020-05-21 15:19:07.077] [INFO] Running single test: /xxxxxxxx/spec/par_map_spec.rb:46
[2020-05-21 15:19:07.077] [INFO] Running command: bundle exec rspec --require /home/xxxxxxxx/.vscode/extensions/connorshea.vscode-ruby-test-adapter-0.7.1/custom_formatter.rb --format CustomFormatter '/xxxxxxxx/spec/par_map_spec.rb:46'
and for your PR:
[2020-05-21 15:21:24.523] [INFO] Running single test: /xxxxxxxx/par_map_spec.rb:46
[2020-05-21 15:21:24.524] [INFO] Running command: bundle exec rspec --pattern './spec//**/*_spec.rb,./spec//**/spec_*.rb' --require /home/xxxxxxxx/.vscode/extensions/connorshea.vscode-ruby-test-adapter-0.7.1/custom_formatter.rb --format CustomFormatter '/xxxxxxxx/par_map_spec.rb:46'
As you can see there is additional --pattern
option which can cause a problem.
Can you look at this. Maybe only I have this problem in my configuration :).
Looking forward to use debug test option in the next release :).
Thanks @CezaryGapinski, feel free to make a new PR based on what I wrote. I stopped using this extension.
Closing this since #51 continues it.
Add support for debugging tests. Branched based on #37