From b71ae2aed1fa4913dc23c64cb2520f05064402fe Mon Sep 17 00:00:00 2001 From: Anatoly Popov Date: Fri, 21 Sep 2018 23:15:02 +0300 Subject: [PATCH 1/8] Split build and test since macOs does not have docker installed. Signed-off-by: Anatoly Popov --- .azure/build.yml | 26 ++++++++++++++++++++++++++ .azure/tests.yml | 23 ----------------------- azure-pipelines.yml | 6 +++++- 3 files changed, 31 insertions(+), 24 deletions(-) create mode 100644 .azure/build.yml diff --git a/.azure/build.yml b/.azure/build.yml new file mode 100644 index 00000000..caee82d6 --- /dev/null +++ b/.azure/build.yml @@ -0,0 +1,26 @@ +parameters: + netcore1Global: true + +steps: +- task: DotNetCoreCLI@2 + displayName: dotnet build + inputs: + command: build + projects: progaudi.tarantool.sln + arguments: -c Release + verbosityRestore: minimal + +- task: Bash@3 + displayName: set version variable + inputs: + targetType: inline + script: echo "##vso[task.setvariable variable=NugetPackageVersion]$(git describe --tags | sed 's/-/./')" + +- task: DotNetCoreCLI@2 + displayName: pack nuget package + inputs: + command: pack + versioningScheme: byEnvVar + versionEnvVar: NugetPackageVersion + arguments: --no-build -c Release /property:PackageOutputPath=$(Build.ArtifactStagingDirectory) + verbosityPack: minimal diff --git a/.azure/tests.yml b/.azure/tests.yml index 41508c17..058959b9 100644 --- a/.azure/tests.yml +++ b/.azure/tests.yml @@ -2,29 +2,6 @@ parameters: netcore1Global: true steps: -- task: DotNetCoreCLI@2 - displayName: dotnet build - inputs: - command: build - projects: progaudi.tarantool.sln - arguments: -c Release - verbosityRestore: minimal - -- task: Bash@3 - displayName: set version variable - inputs: - targetType: inline - script: echo "##vso[task.setvariable variable=NugetPackageVersion]$(git describe --tags | sed 's/-/./')" - -- task: DotNetCoreCLI@2 - displayName: pack nuget package - inputs: - command: pack - versioningScheme: byEnvVar - versionEnvVar: NugetPackageVersion - arguments: --no-build -c Release /property:PackageOutputPath=$(Build.ArtifactStagingDirectory) - verbosityPack: minimal - - task: Bash@3 inputs: targetType: inline diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d7553568..d52a1a82 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -3,14 +3,17 @@ jobs: pool: name: Hosted macOS steps: - - template: .azure/tests.yml + - template: .azure/build.yml - job: linux pool: name: Hosted Ubuntu 1604 steps: + - template: .azure/build.yml + - script: curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin -channel 1.1 displayName: Installing .netcore 1.1 + - template: .azure/tests.yml parameters: netcore1Global: false @@ -22,6 +25,7 @@ jobs: pool: name: Hosted VS2017 steps: + - template: .azure/build.yml - template: .azure/tests.yml - ${{ if ne(variables['Build.Reason'], 'PullRequest') }}: From d5a81b115b9bf2635fe4763997f1c28183fa6489 Mon Sep 17 00:00:00 2001 From: Anatoly Popov Date: Fri, 21 Sep 2018 23:39:16 +0300 Subject: [PATCH 2/8] Tests for Call --- tarantool/testdata.lua | 5 ++++- .../progaudi.tarantool.tests/Box/Call_Should.cs | 17 +++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/tarantool/testdata.lua b/tarantool/testdata.lua index 6cfcf676..41240b77 100644 --- a/tarantool/testdata.lua +++ b/tarantool/testdata.lua @@ -152,7 +152,6 @@ function return_tuple() return { 1, 2 } end - function return_array() log.info('return_array called') return {{ "abc", "def" }} @@ -167,6 +166,10 @@ function return_nothing() log.info('return_nothing called') end +function replace(t) + return box.space.with_scalar_index:replace(t) +end + local truncate_space = function(name) local space = box.space[name] diff --git a/tests/progaudi.tarantool.tests/Box/Call_Should.cs b/tests/progaudi.tarantool.tests/Box/Call_Should.cs index 1ed60829..1a89852c 100644 --- a/tests/progaudi.tarantool.tests/Box/Call_Should.cs +++ b/tests/progaudi.tarantool.tests/Box/Call_Should.cs @@ -131,5 +131,22 @@ public async Task return_nothing_should_not_throw() Should.NotThrow(async () => await tarantoolClient.Call("return_nothing")); } } + + [Fact] + public async Task replace_via_call() + { + using (var tarantoolClient = await Client.Box.Connect(ConnectionStringFactory.GetReplicationSource_1_8())) + { + var tuple = ("123", new byte[] { 1, 2, 3 }); + var result = await tarantoolClient.Call[], ValueTuple>( + "replace", + new [] { tuple }); + + var firstTuple = result.Data[0]; + + tuple.Item1.ShouldBe(firstTuple.Item1); + tuple.Item2.ShouldBe(firstTuple.Item2); + } + } } } \ No newline at end of file From dd8b03c61e1f232a9c9b274d9ad6198bf67636af Mon Sep 17 00:00:00 2001 From: Anatoly Popov Date: Fri, 21 Sep 2018 23:39:35 +0300 Subject: [PATCH 3/8] Try to apply nat stuff --- .azure/tests.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.azure/tests.yml b/.azure/tests.yml index 058959b9..2c158af3 100644 --- a/.azure/tests.yml +++ b/.azure/tests.yml @@ -2,6 +2,11 @@ parameters: netcore1Global: true steps: +- task: PowerShell@2 + inputs: + targetType: inline + script: Get-NetNat | Remove-NetNat + - task: Bash@3 inputs: targetType: inline From e34b551948bbc736834eeef3e22fbaeae8ebb101 Mon Sep 17 00:00:00 2001 From: Anatoly Popov Date: Fri, 21 Sep 2018 23:45:16 +0300 Subject: [PATCH 4/8] Man, nat stuff is needed only for windows. --- .azure/tests.yml | 5 ----- azure-pipelines.yml | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.azure/tests.yml b/.azure/tests.yml index 2c158af3..058959b9 100644 --- a/.azure/tests.yml +++ b/.azure/tests.yml @@ -2,11 +2,6 @@ parameters: netcore1Global: true steps: -- task: PowerShell@2 - inputs: - targetType: inline - script: Get-NetNat | Remove-NetNat - - task: Bash@3 inputs: targetType: inline diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d52a1a82..75a1f610 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -26,6 +26,11 @@ jobs: name: Hosted VS2017 steps: - template: .azure/build.yml + + - task: PowerShell@2 + inputs: + targetType: inline + script: Get-NetNat | Remove-NetNat - template: .azure/tests.yml - ${{ if ne(variables['Build.Reason'], 'PullRequest') }}: From 3bb469bcd1147e16f5ce281a709719e80613cebe Mon Sep 17 00:00:00 2001 From: Anatoly Popov Date: Sat, 22 Sep 2018 00:17:31 +0300 Subject: [PATCH 5/8] -Confirm script. --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 75a1f610..d3bb5994 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -30,7 +30,7 @@ jobs: - task: PowerShell@2 inputs: targetType: inline - script: Get-NetNat | Remove-NetNat + script: Get-NetNat | Remove-NetNat -Confirm - template: .azure/tests.yml - ${{ if ne(variables['Build.Reason'], 'PullRequest') }}: From aaa490e9ea5e10e40a9b8d997e517c76e8973da9 Mon Sep 17 00:00:00 2001 From: Anatoly Popov Date: Sat, 22 Sep 2018 00:20:15 +0300 Subject: [PATCH 6/8] Let's try dotnet --info for triggering cache population --- .azure/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.azure/test.yml b/.azure/test.yml index 3c527e3c..c34444b7 100644 --- a/.azure/test.yml +++ b/.azure/test.yml @@ -5,6 +5,7 @@ parameters: steps: - ${{ if eq(parameters.frameworkGlobal, 'false') }}: + - script: dotnet --info - script: ${{ format('/home/vsts/.dotnet/dotnet test -f {0} --no-build --logger trx -c Release {1}', parameters.framework, parameters.path) }} displayName: ${{ format('dotnet test -f {0}', parameters.framework) }} From aaffe5e5d3adb324cf66a35f331549a21278c4a5 Mon Sep 17 00:00:00 2001 From: Anatoly Popov Date: Sat, 22 Sep 2018 01:07:46 +0300 Subject: [PATCH 7/8] Disable tests on windows --- .azure/test.yml | 1 - azure-pipelines.yml | 6 ------ 2 files changed, 7 deletions(-) diff --git a/.azure/test.yml b/.azure/test.yml index c34444b7..3c527e3c 100644 --- a/.azure/test.yml +++ b/.azure/test.yml @@ -5,7 +5,6 @@ parameters: steps: - ${{ if eq(parameters.frameworkGlobal, 'false') }}: - - script: dotnet --info - script: ${{ format('/home/vsts/.dotnet/dotnet test -f {0} --no-build --logger trx -c Release {1}', parameters.framework, parameters.path) }} displayName: ${{ format('dotnet test -f {0}', parameters.framework) }} diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d3bb5994..82c99b4a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -27,12 +27,6 @@ jobs: steps: - template: .azure/build.yml - - task: PowerShell@2 - inputs: - targetType: inline - script: Get-NetNat | Remove-NetNat -Confirm - - template: .azure/tests.yml - - ${{ if ne(variables['Build.Reason'], 'PullRequest') }}: - task: NuGetCommand@2 displayName: push nuget packages From 94df6ca6d928ae472b1f6ff1bd5fd17ca4ca5716 Mon Sep 17 00:00:00 2001 From: Anatoly Popov Date: Sat, 22 Sep 2018 02:34:01 +0300 Subject: [PATCH 8/8] Update msgpack to 1.6.1 and produce release builds --- .azure/build.yml | 15 --------------- azure-pipelines.yml | 8 ++++++++ src/progaudi.tarantool/progaudi.tarantool.csproj | 2 +- 3 files changed, 9 insertions(+), 16 deletions(-) diff --git a/.azure/build.yml b/.azure/build.yml index caee82d6..6779f719 100644 --- a/.azure/build.yml +++ b/.azure/build.yml @@ -9,18 +9,3 @@ steps: projects: progaudi.tarantool.sln arguments: -c Release verbosityRestore: minimal - -- task: Bash@3 - displayName: set version variable - inputs: - targetType: inline - script: echo "##vso[task.setvariable variable=NugetPackageVersion]$(git describe --tags | sed 's/-/./')" - -- task: DotNetCoreCLI@2 - displayName: pack nuget package - inputs: - command: pack - versioningScheme: byEnvVar - versionEnvVar: NugetPackageVersion - arguments: --no-build -c Release /property:PackageOutputPath=$(Build.ArtifactStagingDirectory) - verbosityPack: minimal diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 82c99b4a..38f422a7 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -27,6 +27,14 @@ jobs: steps: - template: .azure/build.yml + - task: PowerShell@2 + displayName: pack nuget package + inputs: + targetType: inline + script: | + $version = $(git describe --tags | %{$_ -replace '-([^g])', '.$1'}) + dotnet pack --no-build -v minimal -c Release /property:Version=$version /property:PackageOutputPath=$(Build.ArtifactStagingDirectory) + - ${{ if ne(variables['Build.Reason'], 'PullRequest') }}: - task: NuGetCommand@2 displayName: push nuget packages diff --git a/src/progaudi.tarantool/progaudi.tarantool.csproj b/src/progaudi.tarantool/progaudi.tarantool.csproj index 2eaa0b7e..214b92dc 100644 --- a/src/progaudi.tarantool/progaudi.tarantool.csproj +++ b/src/progaudi.tarantool/progaudi.tarantool.csproj @@ -28,7 +28,7 @@ - +