Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 23 additions & 35 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,33 @@
version: 2.1

commands:
influxdb-onboarding:
steps:
- run:
name: "Post onBoarding request to InfluxDB 2"
command: ./Scripts/influxdb-onboarding.sh
prepare:
description: "Prepare environment to tests"
steps:
- checkout
- influxdb-onboarding

influxdb-onboarding:
steps:
- run:
name: "Post onBoarding request to InfluxDB 2"
command: ./Scripts/influxdb-onboarding.sh

client-test:
parameters:
code-coverage-report:
type: boolean
default: false
dotnet-runtime-versions:
type: string
default: ""
steps:
- run:
name: "Running tests"
command: ./Scripts/ci-test.sh << parameters.code-coverage-report >>
command: ./Scripts/ci-test.sh --dotnet-runtime aspnetcore --dotnet-runtime-versions <<parameters.dotnet-runtime-versions>> <<#parameters.code-coverage-report>>--code-coverage-report<</parameters.code-coverage-report>>
- run:
name: "Converting test results to Junit format"
when: on_fail
name: "Converting test results to JUnit format"
when: always
command: ./trx2junit/trx2junit ./**/TestResults/*.trx

storing-test-results:
Expand Down Expand Up @@ -61,10 +66,7 @@ jobs:
parameters:
dotnet-image:
type: string
default: &default-dotnet-image "mcr.microsoft.com/dotnet/sdk:7.0"
dotnet-target-version:
type: string
default: "netstandard2.1"
default: &default-dotnet-image "mcr.microsoft.com/dotnet/sdk:8.0"
influxdb-image:
type: string
default: &default-influxdb-image "influxdb:latest"
Expand All @@ -73,8 +75,6 @@ jobs:
default: false
docker:
- image: << parameters.dotnet-image >>
environment:
NET_TARGET_VERSION: << parameters.dotnet-target-version >>
- image: &influx-image << parameters.influxdb-image >>
environment:
INFLUXD_HTTP_BIND_ADDRESS: :9999
Expand All @@ -91,6 +91,7 @@ jobs:
steps:
- prepare
- client-test:
dotnet-runtime-versions: "3.1,5.0,6.0,7.0" # Additional runtime versions to install
code-coverage-report: << parameters.code-coverage-report >>
- storing-test-results
- storing-artifacts
Expand Down Expand Up @@ -166,7 +167,7 @@ jobs:
- restore_cache:
name: Restoring reSharper Cache
keys:
- &cache-key reSharper-cache-2022_1_0
- &cache-key reSharper-cache-2022_1_0
- run:
name: Check code formatting
command: |
Expand All @@ -176,7 +177,7 @@ jobs:
name: Saving reSharper Cache
key: *cache-key
paths:
- ./reSharperCLI
- ./reSharperCLI

deploy-preview:
parameters:
Expand Down Expand Up @@ -208,37 +209,24 @@ workflows:
- check-compilation-warnings
- check-code-formatting
- tests-dotnet:
name: dotnet-3.1-nightly
influxdb-image: "quay.io/influxdb/influxdb:nightly"
dotnet-image: "mcr.microsoft.com/dotnet/core/sdk:3.1"
- tests-dotnet:
name: dotnet-3.1
dotnet-image: "mcr.microsoft.com/dotnet/core/sdk:3.1"
- tests-dotnet:
name: dotnet-5.0
name: dotnet-docker
code-coverage-report: true
dotnet-image: "mcr.microsoft.com/dotnet/sdk:5.0"
- tests-dotnet:
name: dotnet-6.0
dotnet-image: "mcr.microsoft.com/dotnet/sdk:6.0"
- tests-dotnet:
name: dotnet-7.0
name: dotnet-docker-nightly
influxdb-image: "quay.io/influxdb/influxdb:nightly"
- tests-windows:
name: dotnet-windows
- deploy-preview:
requires:
- check-compilation-warnings
- check-code-formatting
- dotnet-3.1-nightly
- dotnet-3.1
- dotnet-5.0
- dotnet-6.0
- dotnet-7.0
- dotnet-docker
- dotnet-docker-nightly
- dotnet-windows
filters:
branches:
only: master

nightly:
when:
equal: [ scheduled_pipeline, << pipeline.trigger_source >> ]
Expand Down
23 changes: 8 additions & 15 deletions Client.Core.Test/Client.Core.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,37 +1,30 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0;net7.0</TargetFrameworks>
<LangVersion>8</LangVersion>
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0;net7.0;net8.0</TargetFrameworks>
<LangVersion>12.0</LangVersion>

<IsPackable>false</IsPackable>
<AssemblyName>InfluxDB.Client.Core.Test</AssemblyName>
<RootNamespace>InfluxDB.Client.Core.Test</RootNamespace>

<AssemblyOriginatorKeyFile>../Keys/Key.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="WireMock.Net" Version="1.5.46" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Client.Core\Client.Core.csproj" />
</ItemGroup>

<PropertyGroup>
<NetCore5PlusFrameworks>|net5.0|net6.0|net7.0|</NetCore5PlusFrameworks>
</PropertyGroup>

<ItemGroup Condition="$(NetCore5PlusFrameworks.Contains('|$(TargetFramework)|'))">
<PackageReference Include="coverlet.collector" Version="6.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<ProjectReference Include="..\Client.Core\Client.Core.csproj" />
</ItemGroup>

</Project>
12 changes: 6 additions & 6 deletions Client.Core/Client.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1</TargetFrameworks>
<LangVersion>8</LangVersion>
<LangVersion>12.0</LangVersion>

<Description>InfluxDB Client Core - exceptions, validations, REST client.</Description>
<Authors>influxdb-client-csharp Contributors</Authors>
Expand Down Expand Up @@ -32,11 +32,11 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="CsvHelper" Version="30.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="NodaTime" Version="3.1.10" />
<PackageReference Include="NodaTime.Serialization.JsonNet" Version="3.1.0" />
<PackageReference Include="RestSharp" Version="110.1.0" />
<PackageReference Include="CsvHelper" Version="30.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="NodaTime" Version="3.1.10" />
<PackageReference Include="NodaTime.Serialization.JsonNet" Version="3.1.0" />
<PackageReference Include="RestSharp" Version="110.1.0" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion Client.Core/Flux/Domain/FluxRecord.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public FluxRecord(int table)
{
var time = GetTime();

return time?.InUtc().ToDateTimeUtc() ?? default(DateTime);
return time?.ToDateTimeUtc() ?? default(DateTime);
}

/// <returns>the value of the record</returns>
Expand Down
25 changes: 9 additions & 16 deletions Client.Legacy.Test/Client.Legacy.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,34 +1,27 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0;net7.0</TargetFrameworks>
<LangVersion>8</LangVersion>
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0;net7.0;net8.0</TargetFrameworks>
<LangVersion>12.0</LangVersion>

<IsPackable>false</IsPackable>

<AssemblyOriginatorKeyFile>../Keys/Key.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Client.Legacy\Client.Legacy.csproj" />
<ProjectReference Include="..\Client.Core.Test\Client.Core.Test.csproj" />
</ItemGroup>

<PropertyGroup>
<NetCore5PlusFrameworks>|net5.0|net6.0|net7.0|</NetCore5PlusFrameworks>
</PropertyGroup>

<ItemGroup Condition="$(NetCore5PlusFrameworks.Contains('|$(TargetFramework)|'))">
<PackageReference Include="coverlet.collector" Version="6.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<ProjectReference Include="..\Client.Legacy\Client.Legacy.csproj" />
<ProjectReference Include="..\Client.Core.Test\Client.Core.Test.csproj" />
</ItemGroup>

</Project>
5 changes: 3 additions & 2 deletions Client.Legacy/Client.Legacy.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1</TargetFrameworks>
<TargetFrameworks>netstandard2.0;netstandard2.1</TargetFrameworks>
<LangVersion>12.0</LangVersion>

<Description>The client that allow perform Flux Query against the InfluxDB 1.7+.</Description>
<Description>The client that allow perform Flux Query against the InfluxDB 1.7+.</Description>
<Authors>influxdb-client-csharp Contributors</Authors>
<AssemblyName>InfluxDB.Client.Flux</AssemblyName>
<VersionPrefix>4.15.0</VersionPrefix>
Expand Down
25 changes: 9 additions & 16 deletions Client.Linq.Test/Client.Linq.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,36 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0;net7.0</TargetFrameworks>
<LangVersion>8</LangVersion>
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0;net7.0;net8.0</TargetFrameworks>
<LangVersion>12.0</LangVersion>

<IsPackable>false</IsPackable>

<AssemblyOriginatorKeyFile>../Keys/Key.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="Moq" Version="4.20.69" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="System.Linq.Async" Version="6.0.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Client.Linq\Client.Linq.csproj" />
<ProjectReference Include="..\Client.Core.Test\Client.Core.Test.csproj" />
<ProjectReference Include="..\Client.Linq\Client.Linq.csproj" />
<ProjectReference Include="..\Client.Core.Test\Client.Core.Test.csproj" />
</ItemGroup>

<PropertyGroup>
<NetCore5PlusFrameworks>|net5.0|net6.0|net7.0|</NetCore5PlusFrameworks>
</PropertyGroup>

<ItemGroup Condition="$(NetCore5PlusFrameworks.Contains('|$(TargetFramework)|'))">
<PackageReference Include="coverlet.collector" Version="6.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

</Project>
8 changes: 4 additions & 4 deletions Client.Linq.Test/InfluxDBQueryVisitorTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1026,13 +1026,13 @@ where s.Timestamp.AggregateWindow(TimeSpan.FromSeconds(20), TimeSpan.FromSeconds

var everyAssignment = ((OptionStatement)ast.Body[2]).Assignment as VariableAssignment;
Assert.AreEqual("p3", everyAssignment?.Id.Name);
Assert.AreEqual(20000000, (everyAssignment.Init as DurationLiteral)?.Values[0].Magnitude);
Assert.AreEqual("us", (everyAssignment.Init as DurationLiteral)?.Values[0].Unit);
Assert.AreEqual(20_000_000_000, (everyAssignment.Init as DurationLiteral)?.Values[0].Magnitude);
Assert.AreEqual("ns", (everyAssignment.Init as DurationLiteral)?.Values[0].Unit);

var periodAssignment = ((OptionStatement)ast.Body[3]).Assignment as VariableAssignment;
Assert.AreEqual("p4", periodAssignment?.Id.Name);
Assert.AreEqual(40000000, (periodAssignment.Init as DurationLiteral)?.Values[0].Magnitude);
Assert.AreEqual("us", (periodAssignment.Init as DurationLiteral)?.Values[0].Unit);
Assert.AreEqual(40_000_000_000, (periodAssignment.Init as DurationLiteral)?.Values[0].Magnitude);
Assert.AreEqual("ns", (periodAssignment.Init as DurationLiteral)?.Values[0].Unit);

var fnAssignment = ((OptionStatement)ast.Body[4]).Assignment as VariableAssignment;
Assert.AreEqual("p5", fnAssignment?.Id.Name);
Expand Down
Loading