Skip to content

Conversation

@anmarchenko
Copy link
Member

@anmarchenko anmarchenko commented Nov 7, 2025

What does this PR do?

Adds support for custom test file discovery patterns via a new --tests-location flag. Users can now specify custom glob patterns to override the default test file locations, enabling DDTest to work with non-standard project structures or to run only some tests.

Motivation

Sometimes tests could located in unexpected location and sometimes we need to parallelize a subset of tests - for example if we are only interested in system tests we could use --tests-location test/system/**/*_test.rb

Additional Notes

  • The flag works for both RSpec and Minitest frameworks
  • Default patterns remain unchanged: spec/**/*_spec.rb for RSpec, test/**/*_test.rb for Minitest
  • The custom pattern is used for both test discovery (DiscoverTests) and test file discovery (DiscoverTestFiles)
  • Environment variable DD_TEST_OPTIMIZATION_RUNNER_TESTS_LOCATION is also supported
  • Documentation updated in README with usage examples
  • Comprehensive test coverage added for both RSpec and Minitest with custom patterns

@anmarchenko anmarchenko requested a review from a team as a code owner November 7, 2025 15:51
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@anmarchenko anmarchenko merged commit dab9a17 into main Nov 11, 2025
4 checks passed
@anmarchenko anmarchenko deleted the anmarchenko/tests_location_parameter branch November 11, 2025 11:07
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 this pull request may close these issues.

3 participants