Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass project name and version from daml.yaml to daml test when not using --files #18528

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

akrmn
Copy link
Contributor

@akrmn akrmn commented Feb 20, 2024

The core of the change here is that we set optMbPackage{Name,Version} in the cliOptions passed to execTest to the values from daml.yaml, but only when running daml test in "project" mode (i.e. when not using --files). I also took the freedom to refactor this a bit, since I had a hard time following the logic as it was.

Status: a bunch of tests are failing with errors like the one below, which points to the scenario service not expecting the package name to be present. I'm making this a draft PR until I have time to fix that.

Script execution failed:
  CRASH: Unexpected conversion exception: Unknown package <package-name>-0.0.1

@akrmn akrmn changed the title Pass project name and version from daml.yaml to daml test when not using --files` Pass project name and version from daml.yaml to daml test when not using --files Feb 20, 2024
Copy link
Collaborator

@remyhaemmerle-da remyhaemmerle-da left a comment

Choose a reason for hiding this comment

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

Thanks.

@akrmn akrmn marked this pull request as draft February 20, 2024 14:47
Copy link
Contributor

@samuel-williams-da samuel-williams-da left a comment

Choose a reason for hiding this comment

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

Nice refactor :D

@samuel-williams-da
Copy link
Contributor

This is a right pain to debug, as stack traces are thrown away in several places, but I've tracked it down to:
com.daml.lf.engine.script.Converter:311, when trying to create a stack trace. This happens because the unit id of the package sent to the scenario service when a test runs default to "main" when no package name is set, and as such, is resolved to this -homePackageId- which exists in the map. The knownPackages map does not contain the full package name that we now know - the <package-name>-<version> that is reported missing. It does however also contain -dummy-package-name--0.0.0 -> -homePackageId-, so maybe this could be altered to match your unit id, or you could find a way to send up the "main" dummy id without losing the package id on the values.

@moisesackerman-da
Copy link
Contributor

@remyhaemmerle-da, I think you had requested this, do we still need it?

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.

None yet

4 participants