separate running tests with outputs from `dune build @all`
Nobody has claimed this yet.
- Dominant language
- OCaml
- Stars
- 1.9k
- Forks
- 500
- Avg merge
- 15h 21m
- Merged PRs (30d)
- 277
Description
Desired Behavior
Currently when running dune build in a project where there are rules for tests that have an output file:
...
(rule
(action
(with-stdout-to
payloads.out
(run ./test.exe))))
(rule
(alias runtest)
(action
(diff payloads.expected payloads.out)))
...
The first rule is built even when alias runtest is added. It would be good to be able to separate building this rule to only build during dune build @runtest because sometimes these tests are very time-consuming.
Ideally, dune build @all build test executables but do not run the executables.
For the above example, I specified the target in dune build <target.exe> which only builds the executables I want to get the desired behavior.
Example
test/test.ml:
let log = Devkit.Log.from "test"
log#info "test is running"
Printf.print_endline "..."
test/dune
(executables
(libraries devkit)
(names test))
(rule
(action
(with-stdout-to
payloads.out
(run ./test.exe))))
(rule
(alias runtest)
(action
(diff payloads.expected payloads.out)))
current behaviour:
$ dune build @all
[2023-01-04T01:37:01.9572] 001: [test:info] test is running
desired behaviour:
$ dune build @all
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reproduction in test/test.ml and test/dune, then run dune build @all and dune build @runtest to confirm the current separation of behavior. Done means @all builds test executables without running output-producing test rules, while @runtest still runs and checks them.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ocaml
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100