mirror of
https://github.com/digital-asset/daml.git
synced 2024-09-17 15:57:21 +03:00
run compatibility tests on macos (#5723)
This PR extends the existing Linux compatibility tests to run on macOS too. Fixes #5692. CHANGELOG_BEGIN CHANGELOG_END Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
This commit is contained in:
parent
172e913520
commit
7ceda5678a
@ -174,12 +174,27 @@ jobs:
|
|||||||
trigger_sha: '$(trigger_sha)'
|
trigger_sha: '$(trigger_sha)'
|
||||||
- template: ci/report-end.yml
|
- template: ci/report-end.yml
|
||||||
|
|
||||||
- job: compatibility
|
- job: compatibility_linux
|
||||||
dependsOn:
|
dependsOn:
|
||||||
- check_for_release
|
- check_for_release
|
||||||
timeoutInMinutes: 60
|
timeoutInMinutes: 60
|
||||||
pool:
|
pool:
|
||||||
name: 'linux-pool'
|
name: linux-pool
|
||||||
|
steps:
|
||||||
|
- template: ci/report-start.yml
|
||||||
|
- checkout: self
|
||||||
|
- template: ci/compatibility.yml
|
||||||
|
parameters:
|
||||||
|
test_flags: '--quick'
|
||||||
|
- template: ci/tell-slack-failed.yml
|
||||||
|
- template: ci/report-end.yml
|
||||||
|
|
||||||
|
- job: compatibility_macos
|
||||||
|
dependsOn:
|
||||||
|
- check_for_release
|
||||||
|
timeoutInMinutes: 60
|
||||||
|
pool:
|
||||||
|
name: macos-pool
|
||||||
steps:
|
steps:
|
||||||
- template: ci/report-start.yml
|
- template: ci/report-start.yml
|
||||||
- checkout: self
|
- checkout: self
|
||||||
@ -361,6 +376,8 @@ jobs:
|
|||||||
- release
|
- release
|
||||||
- write_ledger_dump
|
- write_ledger_dump
|
||||||
- git_sha
|
- git_sha
|
||||||
|
- compatibility_macos
|
||||||
|
- compatibility_linux
|
||||||
pool:
|
pool:
|
||||||
name: "linux-pool"
|
name: "linux-pool"
|
||||||
variables:
|
variables:
|
||||||
@ -384,6 +401,14 @@ jobs:
|
|||||||
dump.machine: $[ dependencies.write_ledger_dump.outputs['start.machine'] ]
|
dump.machine: $[ dependencies.write_ledger_dump.outputs['start.machine'] ]
|
||||||
dump.end: $[ dependencies.write_ledger_dump.outputs['end.time'] ]
|
dump.end: $[ dependencies.write_ledger_dump.outputs['end.time'] ]
|
||||||
dump.status: $[ dependencies.write_ledger_dump.result ]
|
dump.status: $[ dependencies.write_ledger_dump.result ]
|
||||||
|
compatibility_linux.start: $[ dependencies.compatibility_linux.outputs['start.time'] ]
|
||||||
|
compatibility_linux.machine: $[ dependencies.compatibility_linux.outputs['start.machine'] ]
|
||||||
|
compatibility_linux.end: $[ dependencies.compatibility_linux.outputs['end.time'] ]
|
||||||
|
compatibility_linux.status: $[ dependencies.compatibility_linux.result ]
|
||||||
|
compatibility_macos.start: $[ dependencies.compatibility_macos.outputs['start.time'] ]
|
||||||
|
compatibility_macos.machine: $[ dependencies.compatibility_macos.outputs['start.machine'] ]
|
||||||
|
compatibility_macos.end: $[ dependencies.compatibility_macos.outputs['end.time'] ]
|
||||||
|
compatibility_macos.status: $[ dependencies.compatibility_macos.result ]
|
||||||
|
|
||||||
branch_sha: $[ dependencies.git_sha.outputs['out.branch'] ]
|
branch_sha: $[ dependencies.git_sha.outputs['out.branch'] ]
|
||||||
master_sha: $[ dependencies.git_sha.outputs['out.master'] ]
|
master_sha: $[ dependencies.git_sha.outputs['out.master'] ]
|
||||||
@ -422,7 +447,15 @@ jobs:
|
|||||||
"release": {"start": "$(release.start)",
|
"release": {"start": "$(release.start)",
|
||||||
"machine": "$(release.machine)",
|
"machine": "$(release.machine)",
|
||||||
"end": "$(release.end)",
|
"end": "$(release.end)",
|
||||||
"status": "$(release.status)"}},
|
"status": "$(release.status)"},
|
||||||
|
"compatibility_linux": {"start": "$(compatibility_linux.start)",
|
||||||
|
"machine": "$(compatibility_linux.machine)",
|
||||||
|
"end": "$(compatibility_linux.end)",
|
||||||
|
"status": "$(compatibility_linux.status)"},
|
||||||
|
"compatibility_macos": {"start": "$(compatibility_macos.start)",
|
||||||
|
"machine": "$(compatibility_macos.machine)",
|
||||||
|
"end": "$(compatibility_macos.end)",
|
||||||
|
"status": "$(compatibility_macos.status)"}},
|
||||||
"id": "$(Build.BuildId)",
|
"id": "$(Build.BuildId)",
|
||||||
"url": "https://dev.azure.com/digitalasset/daml/_build/results?buildId=$(Build.BuildId)",
|
"url": "https://dev.azure.com/digitalasset/daml/_build/results?buildId=$(Build.BuildId)",
|
||||||
"name": "$(Build.DefinitionName)",
|
"name": "$(Build.DefinitionName)",
|
||||||
@ -470,6 +503,8 @@ jobs:
|
|||||||
if [[ "$(Linux.status)" != "Succeeded"
|
if [[ "$(Linux.status)" != "Succeeded"
|
||||||
|| "$(macOS.status)" != "Succeeded"
|
|| "$(macOS.status)" != "Succeeded"
|
||||||
|| "$(Windows.status)" != "Succeeded"
|
|| "$(Windows.status)" != "Succeeded"
|
||||||
|
|| "$(compatibility_linux.status)" != "Succeeded"
|
||||||
|
|| "$(compatibility_macos.status)" != "Succeeded"
|
||||||
|| "$(dump.status)" == "Canceled"
|
|| "$(dump.status)" == "Canceled"
|
||||||
|| "$(release.status)" == "Canceled" ]]; then
|
|| "$(release.status)" == "Canceled" ]]; then
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -8,6 +8,7 @@ cpu_value = "{CPU_VALUE}"
|
|||||||
is_darwin = cpu_value == "darwin"
|
is_darwin = cpu_value == "darwin"
|
||||||
is_linux = cpu_value == "k8"
|
is_linux = cpu_value == "k8"
|
||||||
is_windows = cpu_value == "x64_windows"
|
is_windows = cpu_value == "x64_windows"
|
||||||
|
os_name = "macos" if is_darwin else "linux" if is_linux else "windows"
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def _os_info_impl(repository_ctx):
|
def _os_info_impl(repository_ctx):
|
||||||
|
@ -26,27 +26,6 @@ steps:
|
|||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
./compatibility/build-release-artifacts.sh $(Build.StagingDirectory)
|
./compatibility/build-release-artifacts.sh $(Build.StagingDirectory)
|
||||||
displayName: 'Build release artifacts'
|
displayName: 'Build release artifacts'
|
||||||
# At the moment the indirection of first publishing and then downloading
|
|
||||||
# artifacts is not strictly necessary. However, we have some artifacts
|
|
||||||
# that are platform independent where this could come in handy
|
|
||||||
# (e.g. build the typescript libraries on Linux and fetch them on
|
|
||||||
# windows) so we use this from the start.
|
|
||||||
- task: PublishPipelineArtifact@0
|
|
||||||
inputs:
|
|
||||||
targetPath: $(Build.StagingDirectory)/sdk-release-tarball.tar.gz
|
|
||||||
artifactName: sdk-release-tarball.tar.gz
|
|
||||||
- task: PublishPipelineArtifact@0
|
|
||||||
inputs:
|
|
||||||
targetPath: $(Build.StagingDirectory)/ledger-api-test-tool_deploy.jar
|
|
||||||
artifactName: ledger-api-test-tool_deploy.jar
|
|
||||||
- task: DownloadPipelineArtifact@0
|
|
||||||
inputs:
|
|
||||||
artifactName: sdk-release-tarball.tar.gz
|
|
||||||
targetPath: compatibility/head_sdk
|
|
||||||
- task: DownloadPipelineArtifact@0
|
|
||||||
inputs:
|
|
||||||
artifactName: ledger-api-test-tool_deploy.jar
|
|
||||||
targetPath: compatibility/head_sdk
|
|
||||||
- bash: |
|
- bash: |
|
||||||
set -eou pipefail
|
set -eou pipefail
|
||||||
./compatibility/test.sh ${{ parameters.test_flags }}
|
./compatibility/test.sh ${{ parameters.test_flags }}
|
||||||
|
@ -29,8 +29,8 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
linux:
|
linux:
|
||||||
pool: 'linux-pool'
|
pool: 'linux-pool'
|
||||||
# macos:
|
macos:
|
||||||
# pool: 'macOS-pool'
|
pool: 'macOS-pool'
|
||||||
# windows:
|
# windows:
|
||||||
# pool: 'windows-pool'
|
# pool: 'windows-pool'
|
||||||
pool:
|
pool:
|
||||||
|
@ -5,7 +5,7 @@ load(
|
|||||||
"@daml//bazel_tools/client_server:client_server_test.bzl",
|
"@daml//bazel_tools/client_server:client_server_test.bzl",
|
||||||
"client_server_test",
|
"client_server_test",
|
||||||
)
|
)
|
||||||
load("@os_info//:os_info.bzl", "is_linux")
|
load("@os_info//:os_info.bzl", "is_windows")
|
||||||
load("//bazel_tools:testing.bzl", "sdk_platform_test")
|
load("//bazel_tools:testing.bzl", "sdk_platform_test")
|
||||||
|
|
||||||
config_setting(
|
config_setting(
|
||||||
@ -49,7 +49,7 @@ platform_versions = [
|
|||||||
)
|
)
|
||||||
for sdk_version in sdk_versions
|
for sdk_version in sdk_versions
|
||||||
for platform_version in platform_versions
|
for platform_version in platform_versions
|
||||||
] if is_linux else None
|
] if not is_windows else None
|
||||||
|
|
||||||
test_suite(
|
test_suite(
|
||||||
name = "head-quick",
|
name = "head-quick",
|
||||||
|
@ -12,7 +12,7 @@ load("@daml//bazel_tools:os_info.bzl", "os_info")
|
|||||||
|
|
||||||
os_info(name = "os_info")
|
os_info(name = "os_info")
|
||||||
|
|
||||||
load("@os_info//:os_info.bzl", "is_darwin", "is_linux", "is_windows")
|
load("@os_info//:os_info.bzl", "is_linux", "os_name")
|
||||||
load("@daml//bazel_tools:build_environment.bzl", "build_environment")
|
load("@daml//bazel_tools:build_environment.bzl", "build_environment")
|
||||||
|
|
||||||
build_environment(name = "build_environment")
|
build_environment(name = "build_environment")
|
||||||
@ -138,23 +138,36 @@ local_repository(
|
|||||||
|
|
||||||
daml_sdk_head(
|
daml_sdk_head(
|
||||||
ledger_api_test_tool = "@head_sdk//:ledger-api-test-tool_deploy.jar",
|
ledger_api_test_tool = "@head_sdk//:ledger-api-test-tool_deploy.jar",
|
||||||
|
os_name = os_name,
|
||||||
sdk_tarball = "@head_sdk//:sdk-release-tarball.tar.gz",
|
sdk_tarball = "@head_sdk//:sdk-release-tarball.tar.gz",
|
||||||
)
|
)
|
||||||
|
|
||||||
daml_sdk(
|
daml_sdk(
|
||||||
sdk_sha256 = "ee7e2f50394d44fb3490068de64d37f4f87534e802717bd7e07e8767df2e4e05",
|
os_name = os_name,
|
||||||
|
sdk_sha256 = {
|
||||||
|
"linux": "ee7e2f50394d44fb3490068de64d37f4f87534e802717bd7e07e8767df2e4e05",
|
||||||
|
"macos": "feb2086a9a01048300270c71eb212c8541cdec1082f541408250d6124bc307a8",
|
||||||
|
},
|
||||||
test_tool_sha256 = "cf66efafd9490e1256e825f377b208b8ae90151f56e411b596fbaaef91353e14",
|
test_tool_sha256 = "cf66efafd9490e1256e825f377b208b8ae90151f56e411b596fbaaef91353e14",
|
||||||
version = "1.0.0",
|
version = "1.0.0",
|
||||||
)
|
)
|
||||||
|
|
||||||
daml_sdk(
|
daml_sdk(
|
||||||
sdk_sha256 = "aaf832ceda1a66a8469460d5a4b6c14f681ce692d4e9ef6010896febbaf4b6e1",
|
os_name = os_name,
|
||||||
|
sdk_sha256 = {
|
||||||
|
"linux": "aaf832ceda1a66a8469460d5a4b6c14f681ce692d4e9ef6010896febbaf4b6e1",
|
||||||
|
"macos": "c2f89e394332b6ff19f547ccb399bacd3cd50d2493249c2d3a1ecaad0b87ac8b",
|
||||||
|
},
|
||||||
test_tool_sha256 = "762cd4836a8359dca0fb3271ba2e1d0629138f7d8d914298324418a174c5d22a",
|
test_tool_sha256 = "762cd4836a8359dca0fb3271ba2e1d0629138f7d8d914298324418a174c5d22a",
|
||||||
version = "1.0.1-snapshot.20200417.3908.1.722bac90",
|
version = "1.0.1-snapshot.20200417.3908.1.722bac90",
|
||||||
)
|
)
|
||||||
|
|
||||||
daml_sdk(
|
daml_sdk(
|
||||||
sdk_sha256 = "d3bddaa903ebaebb6f714a3ac39598ba7fd71e8b80636c1275054ed7b883a0d9",
|
os_name = os_name,
|
||||||
|
sdk_sha256 = {
|
||||||
|
"linux": "d3bddaa903ebaebb6f714a3ac39598ba7fd71e8b80636c1275054ed7b883a0d9",
|
||||||
|
"macos": "66f1713057800ed75db1b967a8ea2d9b6c18da1a76b8224abdec0d33ed5533ae",
|
||||||
|
},
|
||||||
test_tool_sha256 = "649ecf7a7e98caef7dac20082526444b33d85dfe79b4b9b66d069ad67aac74fa",
|
test_tool_sha256 = "649ecf7a7e98caef7dac20082526444b33d85dfe79b4b9b66d069ad67aac74fa",
|
||||||
version = "1.1.0-snapshot.20200422.3991.0.6391ee9f",
|
version = "1.1.0-snapshot.20200422.3991.0.6391ee9f",
|
||||||
)
|
)
|
||||||
|
@ -54,7 +54,12 @@ withPostgres f =
|
|||||||
-- com.daml.testing.postgresql.Tool.
|
-- com.daml.testing.postgresql.Tool.
|
||||||
callProcess
|
callProcess
|
||||||
"external/postgresql_nix/bin/initdb"
|
"external/postgresql_nix/bin/initdb"
|
||||||
["--username=" <> T.unpack dbUser, dataDir]
|
[ "--username=" <> T.unpack dbUser
|
||||||
|
, dataDir
|
||||||
|
, "--locale=en_US.UTF-8"
|
||||||
|
, "-E", "UNICODE"
|
||||||
|
, "-A", "trust"
|
||||||
|
]
|
||||||
writeFileUTF8 (dataDir </> "postgresql.conf") (T.unpack $ postgresConfig dbPort)
|
writeFileUTF8 (dataDir </> "postgresql.conf") (T.unpack $ postgresConfig dbPort)
|
||||||
bracket_ (startPostgres dataDir logFile) (stopPostgres dataDir) $ do
|
bracket_ (startPostgres dataDir logFile) (stopPostgres dataDir) $ do
|
||||||
createDatabase
|
createDatabase
|
||||||
|
@ -24,9 +24,12 @@ def _daml_sdk_impl(ctx):
|
|||||||
ctx.download_and_extract(
|
ctx.download_and_extract(
|
||||||
output = "extracted-sdk",
|
output = "extracted-sdk",
|
||||||
# TODO (MK) Make this work on other platforms.
|
# TODO (MK) Make this work on other platforms.
|
||||||
url =
|
url = "https://github.com/digital-asset/daml/releases/download/v{version}/daml-sdk-{version}-{os}.tar.gz"
|
||||||
"https://github.com/digital-asset/daml/releases/download/v{}/daml-sdk-{}-linux.tar.gz".format(ctx.attr.version, ctx.attr.version),
|
.format(
|
||||||
sha256 = ctx.attr.sdk_sha256,
|
version = ctx.attr.version,
|
||||||
|
os = ctx.attr.os_name,
|
||||||
|
),
|
||||||
|
sha256 = ctx.attr.sdk_sha256[ctx.attr.os_name],
|
||||||
stripPrefix = "sdk-{}".format(ctx.attr.version),
|
stripPrefix = "sdk-{}".format(ctx.attr.version),
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
@ -118,10 +121,11 @@ _daml_sdk = repository_rule(
|
|||||||
implementation = _daml_sdk_impl,
|
implementation = _daml_sdk_impl,
|
||||||
attrs = {
|
attrs = {
|
||||||
"version": attr.string(mandatory = True),
|
"version": attr.string(mandatory = True),
|
||||||
"sdk_sha256": attr.string(mandatory = False),
|
"sdk_sha256": attr.string_dict(mandatory = False),
|
||||||
"sdk_tarball": attr.label(allow_single_file = True, mandatory = False),
|
"sdk_tarball": attr.label(allow_single_file = True, mandatory = False),
|
||||||
"test_tool_sha256": attr.string(mandatory = False),
|
"test_tool_sha256": attr.string(mandatory = False),
|
||||||
"test_tool": attr.label(allow_single_file = True, mandatory = False),
|
"test_tool": attr.label(allow_single_file = True, mandatory = False),
|
||||||
|
"os_name": attr.string(mandatory = True),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user