Skip to content

Commit

Permalink
Merge pull request #138 from progaudi/fix-azure-pipeline
Browse files Browse the repository at this point in the history
Fix azure pipeline
  • Loading branch information
aensidhe authored Sep 22, 2018
2 parents b1856f7 + 94df6ca commit 4a9fd8c
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 27 deletions.
11 changes: 11 additions & 0 deletions .azure/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
parameters:
netcore1Global: true

steps:
- task: DotNetCoreCLI@2
displayName: dotnet build
inputs:
command: build
projects: progaudi.tarantool.sln
arguments: -c Release
verbosityRestore: minimal
23 changes: 0 additions & 23 deletions .azure/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 13 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -22,7 +25,15 @@ jobs:
pool:
name: Hosted VS2017
steps:
- template: .azure/tests.yml
- 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
Expand Down
2 changes: 1 addition & 1 deletion src/progaudi.tarantool/progaudi.tarantool.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MsgPack.Light" Version="1.6.0" />
<PackageReference Include="MsgPack.Light" Version="1.6.1" />
<PackageReference Include="System.Net.NameResolution" Version="4.3.0" />
<PackageReference Include="System.Threading.Thread" Version="4.3.0" />
</ItemGroup>
Expand Down
5 changes: 4 additions & 1 deletion tarantool/testdata.lua
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ function return_tuple()
return { 1, 2 }
end


function return_array()
log.info('return_array called')
return {{ "abc", "def" }}
Expand All @@ -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]

Expand Down
17 changes: 17 additions & 0 deletions tests/progaudi.tarantool.tests/Box/Call_Should.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, byte[]>[], ValueTuple<string, byte[]>>(
"replace",
new [] { tuple });

var firstTuple = result.Data[0];

tuple.Item1.ShouldBe(firstTuple.Item1);
tuple.Item2.ShouldBe(firstTuple.Item2);
}
}
}
}

0 comments on commit 4a9fd8c

Please sign in to comment.