Skip to content

Commit

Permalink
Fix //language-support/hs/bindings:test (#18646)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbrauner-da committed Mar 6, 2024
1 parent 760c278 commit 1d806b4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
5 changes: 4 additions & 1 deletion language-support/hs/bindings/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ da_haskell_library(
daml_compile(
name = "for-tests",
srcs = glob(["test/daml/for-tests/*.daml"]),
# TODO(https://github.com/digital-asset/daml/issues/18457): split the lib
# into modules that use contract keys and those that don't. Revert to the
# default target for those that don't.
target = "2.dev",
)

daml_compile(
Expand Down Expand Up @@ -91,7 +95,6 @@ da_haskell_test(
# try not to overload the machine.
tags = [
"cpu:4",
"main-only",
] + (["manual"] if is_darwin else []),
visibility = ["//visibility:public"],
deps = [
Expand Down
11 changes: 9 additions & 2 deletions language-support/hs/bindings/test/DA/Ledger/Tests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,15 @@ tListPackages :: SandboxTest
tListPackages withSandbox = testCase "listPackages" $ run withSandbox $ \DarMetadata{mainPackageId,manifest} _testId -> do
pids <- listPackages
liftIO $ do
-- Canton loads the `AdminWorkflows` package at boot, hence the + 1
assertEqual "#packages" (length (dalfPaths manifest) + 1) (length pids)
putStrLn ("PIDS" <> show pids)
putStrLn ("dalfPaths manifest" <> show (dalfPaths manifest))
-- Canton loads the `AdminWorkflows` package at boot, hence the + 1.
-- The `AdminWorkflows` package transitively pulls the 2.1 prim and
-- stdlib packages, while our test dar pulls the 2.dev ones, hence the
-- temporary + 2.
-- TODO(https://github.com/digital-asset/daml/issues/18457): revert to
-- just +1 once the test dar targets 2.1 again.
assertEqual "#packages" (length (dalfPaths manifest) + 1 + 2) (length pids)
assertBool "The pid is listed" (mainPackageId `elem` pids)

tGetPackage :: SandboxTest
Expand Down

0 comments on commit 1d806b4

Please sign in to comment.