Skip to content

Commit ece6948

Browse files
committed
add a note on how to change Rake::TestTask when using minitest without ruby on rails
1 parent 84ad5bc commit ece6948

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

README.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ You need it when Test Impact Analysis shrinks the test workload but CI still lau
66

77
Currently supported languages and frameworks:
88

9-
- Ruby (RSpec)
9+
- Ruby (RSpec, Minitest)
1010

1111
## Installation
1212

@@ -115,7 +115,7 @@ In CI‑node mode, DDTest also fans out across local CPUs on that node and furth
115115
| CLI flag | Environment variable | Default | What it does |
116116
| ------------------- | --------------------------------------------- | ---------: | --------------------------------------------------------------------------------------------------------------------- |
117117
| `--platform` | `DD_TEST_OPTIMIZATION_RUNNER_PLATFORM` | `ruby` | Language/platform (currently supported values: `ruby`). |
118-
| `--framework` | `DD_TEST_OPTIMIZATION_RUNNER_FRAMEWORK` | `rspec` | Test framework (currently supported values: `rspec`). |
118+
| `--framework` | `DD_TEST_OPTIMIZATION_RUNNER_FRAMEWORK` | `rspec` | Test framework (currently supported values: `rspec`, `minitest`). |
119119
| `--min-parallelism` | `DD_TEST_OPTIMIZATION_RUNNER_MIN_PARALLELISM` | vCPU count | Minimum workers to use for the split. |
120120
| `--max-parallelism` | `DD_TEST_OPTIMIZATION_RUNNER_MAX_PARALLELISM` | vCPU count | Maximum workers to use for the split. |
121121
| `--ci-node` | `DD_TEST_OPTIMIZATION_RUNNER_CI_NODE` | `-1` (off) | Restrict this run to the slice assigned to node **N** (0‑indexed). Also parallelizes within the node across its CPUs. |
@@ -202,6 +202,21 @@ matrix={"include":[{"ci_node_index":0},{"ci_node_index":1},{"ci_node_index":2}]}
202202
203203
You can cat it to `$GITHUB_OUTPUT` to make it available for the test job.
204204
205+
### Minitest support in non-rails projects
206+
207+
We use `bundle exec rake test` command when we don't detect `rails` command to run tests.
208+
This command doesn't have a built in way to pass the list of files to execute, so we pass
209+
them as a space-separated list of files in `TEST_FILES` environment variable.
210+
211+
You need to use this environment variable in your project to integrate your tests with
212+
`ddtest run`. Example when using `Rake::TestTask`:
213+
214+
```ruby
215+
Rake::TestTask.new(:test) do |test|
216+
test.test_files = ENV["TEST_FILES"] ? ENV["TEST_FILES"].split : ["test/**/*.rb"]
217+
end
218+
```
219+
205220
## Development
206221

207222
### Prerequisites

0 commit comments

Comments
 (0)