daml/compatibility/sandbox-migration/util.bzl
Moritz Kiefer 9e6d6f7cf0
Support append-only schema in Sandbox migration tests (#9637)
Note that these tests are switched off for now until Robert has
implemented the migration.

To avoid having to stuff too much in one PR the plan is to merge this
one first and then switch the flag once the migrations work.

changelog_begin
changelog_end
2021-05-12 10:03:36 +02:00

35 lines
1.3 KiB
Python

# Copyright (c) 2021 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
def migration_test(name, versions, tags, **kwargs):
native.sh_test(
name = name,
srcs = ["//sandbox-migration:test.sh"],
deps = ["@bazel_tools//tools/bash/runfiles"],
data = [
"//sandbox-migration:sandbox-migration-runner",
"//sandbox-migration:migration-model.dar",
"//sandbox-migration:migration-step",
] + ["@daml-sdk-{}//:daml".format(ver) for ver in versions],
args = versions,
tags = tags,
**kwargs
)
# TODO (MK) Remove once the append-only schema is the default.
native.sh_test(
name = "{}-append-only".format(name),
srcs = ["//sandbox-migration:test.sh"],
deps = ["@bazel_tools//tools/bash/runfiles"],
tags = [
"manual", # Manual until data migration is implemented
] + tags,
data = [
"//sandbox-migration:sandbox-migration-runner",
"//sandbox-migration:migration-model.dar",
"//sandbox-migration:migration-step",
] + ["@daml-sdk-{}//:daml".format(ver) for ver in versions],
args = ["--append-only"] + versions,
**kwargs
)