Skip to content
CCPEDIAby Unity Nodes
#23524OPEN Issue

Add a multi-package mode to `dpm test`, similar to `dpm build --all`

0xNeshi21-10-2026
<!-- I confirm that, if this is a feature request that has security implications, I already contacted security@digitalasset.com and followed the [responsible disclosure policy](https://digitalasset.com/security/). I confirm that this is not a question or a request for technical support by the community, for which the [Daml forum](https://discuss.daml.com/) is available. -->

What is the problem you want to solve?

In a multi-package project, no single command runs the tests of all the packages in multi-package.yaml.

dpm build --all builds all the packages in multi-package.yaml. But dpm test --all has a different meaning: it runs the tests of the current package and its dependencies only. Thus, to run all the testSettle scripts in the project, I must go to each package and run dpm test --test-pattern testSettle.

IMPORTANT: the fact that dpm test --all includes dependency tests in a test run is very counterintuitive. This flag should have been reserved for the multi-package mode, similar to dpm build --all. A different flag like dpm test --include-dependencies would be more appropriate, but this would be a breaking change.

What is the solution you would propose?

Add a way to run the tests of all the packages in multi-package.yaml from the root of the project, for example:

dpm test --all-packages --test-pattern testSettle

The flag name is only an example. As noted previously, if you change the meaning of --all to match dpm build --all, this breaks the current behavior, so a new flag is possibly better.

The command should:

  • Build each package one time.
  • Run the tests of each package one time, also if other packages depend on it.
  • Print one summary for the project.

Describe alternatives you've considered

  1. A shell loop over the packages:
dpm build --all
in_packages=false
while IFS= read -r -u 3 line; do
  if [[ $line =~ ^packages:[[:space:]]*$ ]]; then
    in_packages=true
  elif $in_packages && [[ $line =~ ^[[:space:]]*-[[:space:]]+([^#[:space:]]+) ]]; then
    pkg=${BASH_REMATCH[1]//[\"\']/}
    (cd "$pkg" && dpm test --test-pattern testSettle) || exit 1
  elif [[ $line =~ ^[^[:space:]#-] ]]; then
    in_packages=false
  fi
done 3< multi-package.yaml

This parses multi-package.yaml with a simple line match, prints one summary for each package, and does not give one coverage report.

  1. Run dpm test --all in a test package that depends on all the other packages. This misses the packages that are not dependencies of that package.

Additional context

SDK version: 3.5.8 dpm version: 1.0.22

Rust's cargo has this behavior: cargo test --workspace test_settle runs the matching tests in all the workspace members, and cargo test -p <package> selects one package from the root.

← Back to Proposals