Skip to content

Commit ce1b5a7

Browse files
Update release testing instructions to include DPM (#21990)
DPM releases aren't weekly automated, so there is no consistent version string, or PR to comment on. For these instructions, part of the work is to find/ensure a relevant DPM version exists. Success notes will be on the Daml PR for now. The weekly testing now covers multi-package functionality, by building a multi-package project, running the multi-ide, altering project structure and jumping across bounds. DPM testing uses `dpm sandbox --dar ...` over `daml sandbox`, which requires building explicitly first. This is a small regression that we're aware of. Codegen commands are slightly different (`daml codegen java` vs `dpm codegen-java`)
1 parent 157aadd commit ce1b5a7

File tree

4 files changed

+242
-34
lines changed

4 files changed

+242
-34
lines changed

sdk/release/RELEASE.md

Lines changed: 239 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,9 @@ using the steps in the previous section.
7777
This testing procedure starts once the release is listed on the [releases
7878
page]. That is, _after_ the [assembly] step has finished.
7979

80-
In the following notes, we assume that `$VERSION` contains the full version tag
81-
for the release you are testing - in other words, the full version as recorded
82-
on the Slack `#team-daml` message that is generated by the assembly repo.
83-
Remember that these steps are for testing the SDK within a Daml release.
80+
### Windows (Daml Assistant)
8481

85-
### Windows
82+
1. Set $VERSION as the release version listed in the PR you approved, and in the `#team-daml` slack message.
8683

8784
> ## Tips for Windows testing in an ad-hoc machine
8885
>
@@ -132,11 +129,6 @@ windows` inside the `daml-language-ad-hoc` project. This command prints IP
132129
> it is fully initialized; initialization is finished when the Firefox icon
133130
> appears on the Desktop.
134131
>
135-
> Once the Windows machine is up and running, use Firefox (in Windows) to
136-
> download and install `daml-sdk-$VERSION-windows.exe` from the [releases
137-
>
138-
> > page] (please ensure `$VERSION` is expanded correctly!.
139-
>
140132
> Ad-hoc machines come with VSCode and OpenJDK preinstalled.
141133
>
142134
> NOTE 2: After logging in, **it takes some time for the machine to be
@@ -162,27 +154,95 @@ windows` inside the `daml-language-ad-hoc` project. This command prints IP
162154
1. Run `daml version --assistant=yes` and verify that the new version is
163155
selected as the assistant version and the default version for new projects.
164156

165-
1. Run `daml new myproject` to create a new project and switch to it using
166-
`cd myproject`.
157+
1. Run `daml new myproject --template multi-package-example` to create a new project and switch to its main package using
158+
`cd myproject/main`.
167159

168160
1. Run `daml start`. Wait for the yellow message confirming the sandbox is ready for use.
169161

170162
1. Kill `daml start` with `Ctrl-C` (followed by "y" because Windows).
171163

172-
1. Run `daml studio --replace=always` and open `daml/Main.daml`. Verify that
173-
there is a `Script results` link on top of the script, click on it, and
164+
1. Build all packages by moving out of the main package (`cd ..`) and running `daml build --all`.
165+
(The first line should say `Running multi-package build of all packages in <location>`)
166+
167+
1. Run `daml studio --replace=always` and open `test/daml/Test.daml`. Verify that there is a `Script results` link above `main` (in the code), click on it, and
174168
verify that the script result appears within 30 seconds.
175169

176-
1. Add `+` at the end of line 26 after `(PartyIdHint "Alice")` and verify that
177-
you get an error on line 27.
170+
1. Add `+` at the end of line 11 after `allocateParty "Alice"`, verify that
171+
you get an error on line 12, then remove the `+`.
172+
173+
1. Right click `IOU` in `... createCmd Main.IOU with ...` on line 12 and click Go to definition.
174+
1. Verify you are taken to main/daml/Main.daml (and not somewhere in a `.daml` directory)
175+
176+
1. Close the `Main.daml` tab, open `multi-package.yaml`, remove `- ./main`, save the file, then go to definition on IOU again as per previous instruction.
177+
1. Verify that now (after a small delay), you are taken to a copy of `Main.daml` in a `.daml` directory at the root of the workspace.
178+
179+
1. Close VSCode and delete the `myproject` directory ready for DPM testing using:
180+
`cd .. && rmdir /S /Q myproject`
181+
182+
1. On the [assembly] PR, add the comment:
183+
184+
> Manual tests passed on Windows using Daml Assistant.
185+
186+
# Windows (DPM)
187+
188+
You will now also need to test the release using DPM, please follow the instructions below (they look similar, but have small tweaks, don't reuse commands from the Daml Assistant section above).
189+
**ONLY RUN THESE STEPS FOR 3.4+ VERSIONS RELEASED AFTER 2025/09/22**
190+
191+
1. DPM snapshots are usually published under a different name, and via a different mechanism. For weekly testing, you may not know what this different version string is.
192+
Use the following to install the DPM sdk on windows.
193+
If you do not know the version string, and are testing the weekly release, go to this URL for the latest SDK:
194+
```
195+
https://get.digitalasset-staging.com/install/latest-windows.html
196+
```
197+
If you do know the version string, interpolate it into this string as `${version}` and go to the resulting URL:
198+
```
199+
https://get.digitalasset.com/install/windows/dpm-${version}-windows-amd64.exe
200+
201+
```
202+
If running `dpm` fails with a "cannot find command" error, inform the language team on #team-daml-language, and then proceed with testing by running `setx /M PATH "%PATH%;%APPDATA%\dpm\bin"` in an administrator command prompt and restarting your existing terminals.
203+
204+
1. Run `dpm versions` and verify the (green) version is what you expect. If you used the latest-download URL to get DPM and thus don't know what version to expect, ensure it is less than a week old for weekly testing.
205+
206+
1. Run `dpm versions` and verify the (green) version is what you expect. If you did not know what version to expect, ensure it is less than a week old for weekly testing.
207+
(If it is too old, leave a message about this in #project-dpm and pause testing until you get a response. #project-dpm is US based so consider this for timezones.)
208+
209+
1. On the [assembly] PR, add the comment (replacing $VERSION with the active DPM version string from above):
210+
211+
> Testing using DPM Version: $VERSION
212+
213+
1. Run `dpm new myproject --template multi-package-example` to create a new project and switch to it
214+
`cd myproject`.
215+
216+
1. Build all packages by running `dpm build --all`.
217+
(The first line should say `Running multi-package build of all packages in <location>`)
218+
219+
1. Run `dpm sandbox --dar ./main/.daml/dist/myproject-main-1.0.0.dar`. Wait for "Canton sandbox is ready." (it may take up to around 2 minutes)
220+
221+
1. Kill `dpm sandbox` with `Ctrl-C` (followed by "y" because Windows).
222+
223+
1. Run `dpm studio --replace=always` and open `test/daml/Test.daml`. Verify that there is a `Script results` link above `main` (in the code), click on it, and
224+
verify that the script result appears within 30 seconds.
225+
226+
1. Add `+` at the end of line 11 after `allocateParty "Alice"`, verify that
227+
you get an error on line 12, then remove the `+`.
228+
229+
1. Right click `IOU` in `... createCmd Main.IOU with ...` on line 12 and click Go to definition.
230+
1. Verify you are taken to main/daml/Main.daml (and not somewhere in a `.daml` directory)
231+
232+
1. Close the `Main.daml` tab, open `multi-package.yaml`, remove `- ./main`, save the file, then go to definition on IOU again as per previous instruction
233+
1. Verify that now (after a small delay), you are taken to a copy of `Main.daml` in a `.daml` directory at the root of the workspace.
234+
235+
1. Close VSCode
178236

179237
1. On the [assembly] PR, add the comment:
180238

181-
> Manual tests passed on Windows.
239+
> Manual tests passed on Windows using DPM.
182240
183241
1. Destroy your Windows VM.
184242

185-
### Linux/macOS
243+
### Linux/macOS (Daml Assistant)
244+
245+
1. Set $VERSION as the release version listed in the PR you approved, and in the `#team-daml` slack message.
186246

187247
1. Run:
188248

@@ -271,11 +331,21 @@ windows` inside the `daml-language-ad-hoc` project. This command prints IP
271331
272332
1. Kill the processes running in Terminals 1 and 2 using CTRL-C.
273333
334+
1. Delete the quickstart project, create a new project using
335+
```
336+
daml new myproject --template multi-package-example
337+
```
338+
then cd into it.
339+
340+
1. Build it using `daml build --all`
341+
(The first line should say `Running multi-package build of all packages in <location>`)
342+
274343
1. Run `daml studio --replace=always`. This should open VSCode and trigger the
275344
Daml extension that's bundled with the new SDK version (the new VSCode
276345
extension will not be in the marketplace at this point). Verify by checking
277346
the version listed under "Installation" matches the version of the sdk bundled
278-
in the snapshot.
347+
in the snapshot (described in the description of the overall release
348+
here https://github.com/digital-asset/daml/releases).
279349
280350
> Note: when running `daml studio --replace=always`, you force the installation
281351
> of the VSCode extension bundled with the Daml SDK, and _disable the
@@ -286,28 +356,166 @@ windows` inside the `daml-language-ad-hoc` project. This command prints IP
286356
> daml studio --replace=published
287357
> ```
288358
289-
1. Open `daml/Main.daml`.
359+
1. Open `test/daml/Test.daml`.
290360
291-
1. Click on `Script results` above `initialize` (in the code) and wait for the
361+
1. Click on `Script results` above the script and wait for the
292362
script results to appear.
293363
294-
1. Add `+` at the end of line 14, after `(PartyIdHint "Alice")` and confirm you
295-
get an error in line 15.
364+
1. Add `+` at the end of line 11 after `allocateParty "Alice"` and verify that
365+
you get an error on line 12.
366+
367+
1. Right click `IOU` in `... createCmd Main.IOU with ...` on line 12 and click Go to definition.
368+
1. Verify you are taken to main/daml/Main.daml (and not somewhere in a `.daml` directory)
369+
370+
1. Close the `Main.daml` tab, open `multi-package.yaml`, remove `- ./main`, save the file, then go to definition on IOU again as per previous instruction.
371+
1. Verify that now (after a small delay), you are taken to a copy of `Main.daml` in a `.daml` directory at the root of the workspace.
372+
373+
1. Close VSCode and delete the `myproject` directory ready for DPM testing using:
374+
`cd .. && rm -rf myproject`
375+
376+
1. On the [assembly] PR, add the comment:
377+
378+
> Manual tests passed on [Linux/macOS] using Daml Assistant.
379+
380+
specifying which platform you tested on.
381+
382+
### Linux/macOS (DPM)
383+
384+
You will now also need to test the release using DPM, please follow the instructions below (they look similar, but have small tweaks, don't reuse commands from the Daml Assistant section above).
385+
**ONLY RUN THESE STEPS FOR 3.4+ VERSIONS RELEASED AFTER 2025/09/22**
386+
387+
1. DPM snapshots are usually published under a different name, and via a different mechanism. For weekly testing, you may not know what this different version string is.
388+
Use the following to install the DPM sdk on windows.
389+
If you do not know the version string, and are testing the weekly release, use this command to install the latest SDK
390+
```
391+
curl -sSL https://get.digitalasset.com/install/install.sh
392+
```
393+
If you do know the version string, interpolate it into this string as `$VERSION` and run the resulting command:
394+
```
395+
curl -sSL https://get.digitalasset.com/install/install.sh | sh -s "$VERSION"
396+
```
397+
398+
1. Make sure you have the prerequisites for running the tests:
399+
400+
- [Visual Studio Code, Java-SDK](https://docs.daml.com/getting-started/installation.html)
401+
- [Maven](https://maven.apache.org)
402+
403+
1. Run `dpm versions` and verify the (green) version is what you expect. If you did not know what version to expect, ensure it is less than a week old for weekly testing.
404+
(If it is too old, leave a message about this in #project-dpm and pause testing until you get a response. #project-dpm is US based so consider this for timezones.)
405+
(If the version you need is listed but not green, run `rm -rf ~/.dpm` then run the installation again)
406+
407+
1. Create a new project with `dpm new quickstart --template quickstart-java`
408+
and switch to it using `cd quickstart`.
409+
410+
1. Verify the new version is specified in `daml.yaml` as the `sdk-version`.
411+
412+
1. Build the package by running `dpm build`.
413+
414+
1. In 3 separate terminals (each being in the `quickstart-java` project directory), run:
415+
416+
1. In Terminal 1, run:
417+
418+
```sh
419+
dpm sandbox --dar ./.daml/dist/quickstart-0.0.1.dar
420+
```
421+
Wait for "Canton sandbox is ready."
422+
423+
1. In Terminal 2, run each of the following:
424+
425+
```sh
426+
dpm script --ledger-host localhost --ledger-port 6865 --dar .daml/dist/quickstart-0.0.1.dar --script-name Main:initialize --output-file output.json
427+
```
428+
429+
```sh
430+
dpm codegen-java && mvn compile exec:java@run-quickstart -Dparty=$(cat output.json | sed 's/\[\"//' | sed 's/".*//')
431+
```
432+
433+
1. In Terminal 3, run:
434+
435+
```sh
436+
cat output.json
437+
```
438+
439+
and verify that the output looks like this:
440+
441+
```json
442+
["Alice::NAMESPACE", "EUR_Bank::NAMESPACE"]
443+
```
444+
445+
where `NAMESPACE` is some randomly generated series of hex digits.
446+
447+
Note that this step scrapes the `Alice::NAMESPACE` party name from the `output.json` produced in the previous steps.
448+
449+
1. Still in Terminal 3, run:
450+
451+
```sh
452+
curl http://localhost:8080/iou
453+
```
454+
455+
and verify that the output looks like:
456+
457+
```json
458+
{
459+
"0": {
460+
"issuer": "EUR_Bank::NAMESPACE",
461+
"owner": "Alice::NAMESPACE",
462+
"currency": "EUR",
463+
"amount": 100.0,
464+
"observers": []
465+
}
466+
}
467+
```
468+
469+
where NAMESPACE is the same series of hex digits as in the previous step.
470+
471+
1. Kill the processes running in Terminals 1 and 2 using CTRL-C.
472+
473+
1. Delete the quickstart project, create a new project using
474+
```
475+
dpm new myproject --template multi-package-example
476+
```
477+
then cd into it.
478+
479+
1. Build it using `dpm build --all`
480+
(The first line should say `Running multi-package build of all packages in <location>`)
481+
482+
1. Run `dpm studio --replace=always`. This should open VSCode and trigger the
483+
Daml extension that's bundled with the new SDK version (the new VSCode
484+
extension will not be in the marketplace at this point). Verify by checking
485+
the version listed under "Installation". It is difficult to find the exact
486+
version string this should be, simply verify it is within a few days
487+
of the SDK version you installed. (using the YYYYMMDD timestamp in the string)
488+
489+
> Note: when running `dpm studio --replace=always`, you force the installation
490+
> of the VSCode extension bundled with the Daml SDK, and _disable the
491+
> auto-upgrade mechanism in VSCode_. To instruct VSCode to go back to the
492+
> published version of the extension, including auto-upgrades, you can run
493+
>
494+
> ```
495+
> dpm studio --replace=published
496+
> ```
497+
> Also note that Studio will use `Daml` or `Dpm` based on the last studio command you ran
498+
> If you want to switch your default assistant back to `Daml`, run `daml studio --replace=published`.
499+
500+
1. Open `test/daml/Test.daml`.
501+
502+
1. Click on `Script results` above the script and wait for the
503+
script results to appear.
296504
297-
1. Add `1` after the `+` and confirm you get a type error in line 14, which
298-
says that `Script Party` does not match `Int`.
505+
1. Add `+` at the end of line 11 after `allocateParty "Alice"` and verify that
506+
you get an error on line 12.
299507
300-
1. Delete the `+1` and the `e` in `"Alice"` and verify that the
301-
script results are updated to the misspelled name.
508+
1. Right click `IOU` in `... createCmd Main.IOU with ...` on line 12 and click Go to definition.
509+
1. Verify you are taken to main/daml/Main.daml (and not somewhere in a `.daml` directory)
302510
303-
1. Right click on `eurBank` in line 28 and verify that "Go to Definition" takes
304-
you to the definition in line 17.
511+
1. Close the `Main.daml` tab, open `multi-package.yaml`, remove `- ./main`, save the file, then go to definition on IOU again as per previous instruction.
512+
1. Verify that now (after a small delay), you are taken to a copy of `Main.daml` in a `.daml` directory at the root of the workspace.
305513
306-
1. Close VS Code.
514+
1. Close VSCode.
307515
308516
1. On the [assembly] PR, add the comment:
309517
310-
> Manual tests passed on [Linux/macOS].
518+
> Manual tests passed on [Linux/macOS] using DPM.
311519
312520
specifying which platform you tested on.
313521

sdk/templates/multi-package-example/interfaces/daml.yaml.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ version: 1.0.0
88
dependencies:
99
- daml-prim
1010
- daml-stdlib
11-
- daml-script-lts
11+
- daml-script

sdk/templates/multi-package-example/main/daml.yaml.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ version: 1.0.0
88
dependencies:
99
- daml-prim
1010
- daml-stdlib
11-
- daml-script-lts
11+
- daml-script
1212
data-dependencies:
1313
- ../interfaces/.daml/dist/__PROJECT_NAME__-interfaces-1.0.0.dar

sdk/templates/multi-package-example/test/daml.yaml.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ version: 1.0.0
88
dependencies:
99
- daml-prim
1010
- daml-stdlib
11-
- daml-script-lts
11+
- daml-script
1212
data-dependencies:
1313
- ../interfaces/.daml/dist/__PROJECT_NAME__-interfaces-1.0.0.dar
1414
- ../main/.daml/dist/__PROJECT_NAME__-main-1.0.0.dar

0 commit comments

Comments
 (0)