Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#303 Change mssql image on fixed #304

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ jobs:
# Label used to access the service container
mssql:
# Docker Hub image
image: mcr.microsoft.com/mssql/server:2022-latest
image: mcr.microsoft.com/mssql/server:2022-CU10-ubuntu-20.04
# Provide the password for mssql
env:
ACCEPT_EULA: Y
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net45;net461;netcoreapp3.1;netstandard2.0;net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net45;net461;netcoreapp3.1;netstandard2.0;net6.0;net7.0;net8.0</TargetFrameworks>
<Configurations>Debug;Release</Configurations>
<LangVersion>latest</LangVersion>
<RootNamespace>NewPlatform.Flexberry.ORM.ODataService.Files</RootNamespace>
Expand Down Expand Up @@ -40,7 +40,7 @@
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.2.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1' Or '$(TargetFramework)' == 'net6.0' Or '$(TargetFramework)' == 'net7.0' ">
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1' Or '$(TargetFramework)' == 'net6.0' Or '$(TargetFramework)' == 'net7.0' Or '$(TargetFramework)' == 'net8.0'">
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>

Expand Down
15 changes: 15 additions & 0 deletions NewPlatform.Flexberry.ORM.ODataService.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@
<dependency id="NewPlatform.Flexberry.LockService" version="3.0.0" />
<dependency id="NewPlatform.Flexberry.ORM" version="7.2.0" />
<dependency id="Newtonsoft.Json" version="13.0.1" />
</group>
<group targetFramework=".NET8.0">
<dependency id="NewPlatform.Flexberry.AspNetCore.OData" version="7.6.2" />
<dependency id="NewPlatform.Flexberry.LockService" version="3.0.0" />
<dependency id="NewPlatform.Flexberry.ORM" version="7.2.0" />
<dependency id="Newtonsoft.Json" version="13.0.1" />
</group>
</dependencies>
</metadata>
Expand Down Expand Up @@ -111,5 +117,14 @@
<file src="NewPlatform.Flexberry.ORM.ODataServiceCore.Common\bin\$configuration$\net7.0\NewPlatform.Flexberry.ORM.ODataServiceCore.Common.xml" target="lib\net7.0\NewPlatform.Flexberry.ORM.ODataServiceCore.Common.xml" />
<file src="NewPlatform.Flexberry.ORM.ODataServiceCore.WebApi\bin\$configuration$\net7.0\NewPlatform.Flexberry.ORM.ODataServiceCore.WebApi.dll" target="lib\net7.0\NewPlatform.Flexberry.ORM.ODataServiceCore.WebApi.dll" />
<file src="NewPlatform.Flexberry.ORM.ODataServiceCore.WebApi\bin\$configuration$\net7.0\NewPlatform.Flexberry.ORM.ODataServiceCore.WebApi.xml" target="lib\net7.0\NewPlatform.Flexberry.ORM.ODataServiceCore.WebApi.xml" />

<file src="NewPlatform.Flexberry.ORM.ODataService\bin\$configuration$\net8.0\NewPlatform.Flexberry.ORM.ODataService.dll" target="lib\net8.0\NewPlatform.Flexberry.ORM.ODataService.dll" />
<file src="NewPlatform.Flexberry.ORM.ODataService\bin\$configuration$\net8.0\NewPlatform.Flexberry.ORM.ODataService.xml" target="lib\net8.0\NewPlatform.Flexberry.ORM.ODataService.xml" />
<file src="NewPlatform.Flexberry.ORM.ODataService.Files\bin\$configuration$\net8.0\NewPlatform.Flexberry.ORM.ODataService.Files.dll" target="lib\net8.0\NewPlatform.Flexberry.ORM.ODataService.Files.dll" />
<file src="NewPlatform.Flexberry.ORM.ODataService.Files\bin\$configuration$\net8.0\NewPlatform.Flexberry.ORM.ODataService.Files.xml" target="lib\net8.0\NewPlatform.Flexberry.ORM.ODataService.Files.xml" />
<file src="NewPlatform.Flexberry.ORM.ODataServiceCore.Common\bin\$configuration$\net8.0\NewPlatform.Flexberry.ORM.ODataServiceCore.Common.dll" target="lib\net8.0\NewPlatform.Flexberry.ORM.ODataServiceCore.Common.dll" />
<file src="NewPlatform.Flexberry.ORM.ODataServiceCore.Common\bin\$configuration$\net8.0\NewPlatform.Flexberry.ORM.ODataServiceCore.Common.xml" target="lib\net8.0\NewPlatform.Flexberry.ORM.ODataServiceCore.Common.xml" />
<file src="NewPlatform.Flexberry.ORM.ODataServiceCore.WebApi\bin\$configuration$\net8.0\NewPlatform.Flexberry.ORM.ODataServiceCore.WebApi.dll" target="lib\net8.0\NewPlatform.Flexberry.ORM.ODataServiceCore.WebApi.dll" />
<file src="NewPlatform.Flexberry.ORM.ODataServiceCore.WebApi\bin\$configuration$\net8.0\NewPlatform.Flexberry.ORM.ODataServiceCore.WebApi.xml" target="lib\net8.0\NewPlatform.Flexberry.ORM.ODataServiceCore.WebApi.xml" />
</files>
</package>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net45;net461;netcoreapp3.1;netstandard2.0;net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net45;net461;netcoreapp3.1;netstandard2.0;net6.0;net7.0;net8.0</TargetFrameworks>
<Configurations>Debug;Release</Configurations>
<LangVersion>latest</LangVersion>
<RootNamespace>NewPlatform.Flexberry.ORM.ODataService</RootNamespace>
Expand All @@ -15,7 +15,7 @@
<FileVersion>1.0.0.0</FileVersion>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1' Or '$(TargetFramework)' == 'net6.0' Or '$(TargetFramework)' == 'net7.0' ">
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1' Or '$(TargetFramework)' == 'net6.0' Or '$(TargetFramework)' == 'net7.0' Or '$(TargetFramework)' == 'net8.0'">
<!-- TODO: remove, fast hack. -->
<DefineConstants>$(DefineConstants);NETSTANDARD</DefineConstants>
</PropertyGroup>
Expand Down Expand Up @@ -46,15 +46,15 @@
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' Or '$(TargetFramework)' == 'netcoreapp3.1' Or '$(TargetFramework)' == 'net6.0' Or '$(TargetFramework)' == 'net7.0' ">
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' Or '$(TargetFramework)' == 'netcoreapp3.1' Or '$(TargetFramework)' == 'net6.0' Or '$(TargetFramework)' == 'net7.0' Or '$(TargetFramework)' == 'net8.0'">
<PackageReference Include="NewPlatform.Flexberry.AspNetCore.OData" Version="7.6.2" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\NewPlatform.Flexberry.ORM.ODataService.Files\NewPlatform.Flexberry.ORM.ODataService.Files.csproj" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' Or '$(TargetFramework)' == 'netcoreapp3.1' Or '$(TargetFramework)' == 'net6.0' Or '$(TargetFramework)' == 'net7.0' ">
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' Or '$(TargetFramework)' == 'netcoreapp3.1' Or '$(TargetFramework)' == 'net6.0' Or '$(TargetFramework)' == 'net7.0' Or '$(TargetFramework)' == 'net8.0'">
<ProjectReference Include="..\NewPlatform.Flexberry.ORM.ODataServiceCore.Common\NewPlatform.Flexberry.ORM.ODataServiceCore.Common.csproj" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;netstandard2.0;net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>netcoreapp3.1;netstandard2.0;net6.0;net7.0;net8.0</TargetFrameworks>
<Configurations>Debug;Release</Configurations>
<LangVersion>latest</LangVersion>
<RootNamespace>NewPlatform.Flexberry.ORM.ODataServiceCore.Common</RootNamespace>
Expand All @@ -15,7 +15,7 @@
<FileVersion>1.0.0.0</FileVersion>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1' Or '$(TargetFramework)' == 'net6.0' Or '$(TargetFramework)' == 'net7.0' ">
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1' Or '$(TargetFramework)' == 'net6.0' Or '$(TargetFramework)' == 'net7.0' Or '$(TargetFramework)' == 'net8.0'">
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;netstandard2.0;net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>netcoreapp3.1;netstandard2.0;net6.0;net7.0;net8.0</TargetFrameworks>
<Configurations>Debug;Release</Configurations>
<LangVersion>latest</LangVersion>
<RootNamespace>NewPlatform.Flexberry.ORM.ODataService.WebApi</RootNamespace>
Expand All @@ -15,7 +15,7 @@
<FileVersion>1.0.0.0</FileVersion>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1' Or '$(TargetFramework)' == 'net6.0' Or '$(TargetFramework)' == 'net7.0' ">
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1' Or '$(TargetFramework)' == 'net6.0' Or '$(TargetFramework)' == 'net7.0' Or '$(TargetFramework)' == 'net8.0'">
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

### Доработка

Исправление ошибок приветствуется, технические детали можно выяснить в [чате](https://gitter.im/Flexberry/PlatformDevelopment) или непосредственно в описании Issue.
Исправление ошибок приветствуется, технические детали можно выяснить в [чате](https://t.me/flexberry) или непосредственно в описании Issue.
Добавление новой функциональности рекомендуется согласовывать с авторами, поскольку принятие Pool Request в этом случае может быть затруднено.

### Техническая поддержка
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net461;netcoreapp3.1;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net461;netcoreapp3.1;net7.0;net8.0</TargetFrameworks>
<Configurations>Debug;Release</Configurations>
<LangVersion>latest</LangVersion>
<RootNamespace>NewPlatform.Flexberry.ORM.ODataService.Tests</RootNamespace>
Expand All @@ -12,6 +12,7 @@
<CodeAnalysisRuleSet>..\..\Flexberry.ruleset</CodeAnalysisRuleSet>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<FileVersion>1.0.0.0</FileVersion>
<EnableUnsafeBinaryFormatterSerialization>true</EnableUnsafeBinaryFormatterSerialization>
</PropertyGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net461' ">
Expand Down Expand Up @@ -57,7 +58,7 @@
<PackageReference Include="Unity.Microsoft.DependencyInjection" Version="5.11.5" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' Or '$(TargetFramework)' == 'net7.0' ">
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' Or '$(TargetFramework)' == 'net7.0' Or '$(TargetFramework)' == 'net7.0' Or '$(TargetFramework)' == 'net8.0' ">
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix duplicate framework condition in ItemGroup.

There's a duplicate net7.0 in the condition which should be removed:

-  <ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' Or '$(TargetFramework)' == 'net7.0' Or '$(TargetFramework)' == 'net7.0' Or '$(TargetFramework)' == 'net8.0' ">
+  <ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' Or '$(TargetFramework)' == 'net7.0' Or '$(TargetFramework)' == 'net8.0' ">
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' Or '$(TargetFramework)' == 'net7.0' Or '$(TargetFramework)' == 'net7.0' Or '$(TargetFramework)' == 'net8.0' ">
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' Or '$(TargetFramework)' == 'net7.0' Or '$(TargetFramework)' == 'net8.0' ">

<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="6.0.5" />
</ItemGroup>

Expand Down
78 changes: 52 additions & 26 deletions Tests/NewPlatform.Flexberry.ORM.ODataService.Tests/README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,52 @@
# Integration Tests

## Tests run

Before start test run please fill connection string `ConnectionStringPostgres` in `App.config` like this:

```xml
<add name="ConnectionStringPostgres" connectionString="SERVER=localhost;User ID=postgres;Password=p@ssw0rd;Port=5432;" />
```
Install [Docker](https://docker.com) if it not installed yet and start Docker.

Then start Docker container with PostgreSQL by command from root folder this repository:

```sh
docker-compose up
```

Tests ready to run. Do it now.

When the database is no longer needed for tests, run the command:

```sh
docker-compose down
```

Also perform undo in App.config before commit changes.
# Integration Tests

## Tests run Postgres

Before start test run please fill connection string `ConnectionStringPostgres` in `App.config` like this:

```xml
<add name="ConnectionStringPostgres" connectionString="SERVER=localhost;User ID=postgres;Password=p@ssw0rd;Port=5432;" />
```
Install [Docker](https://docker.com) if it not installed yet and start Docker.

Then start Docker container with PostgreSQL by command from root folder this repository:

```sh
docker-compose up -d
```

Tests ready to run. Do it now.

When the database is no longer needed for tests, run the command:

```sh
docker-compose down
```

Also perform undo in App.config before commit changes.

## Test run MSSQL

Before start test run please fill connection string `ConnectionStringMssql` in `App.config` like this:

```xml
<add name="ConnectionStringMssql" connectionString="SERVER=localhost;User ID=sa;Password=p@ssw0rd;" />
```

Install [Docker](https://docker.com) if it not installed yet and start Docker.

Then start Docker container with Microsoft SQL Server by command from root folder this repository:

```sh
docker-compose -f docker-compose-mssql.yml up -d
```

Tests ready to run. Do it now.

Comment on lines +41 to +44
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add MSSQL readiness check before running tests.

Microsoft SQL Server takes some time to initialize. Add a note about checking the container's readiness:

Add this section after the docker-compose command:

 docker-compose -f docker-compose-mssql.yml up -d
+
+# Wait for MSSQL to be ready (typically 10-15 seconds)
+# You can check the container logs to ensure MSSQL is ready:
+docker-compose -f docker-compose-mssql.yml logs mssql
+# Look for the message: "SQL Server is now ready for client connections"
 
 Tests ready to run. Do it now.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
docker-compose -f docker-compose-mssql.yml up -d
```
Tests ready to run. Do it now.
docker-compose -f docker-compose-mssql.yml up -d
# Wait for MSSQL to be ready (typically 10-15 seconds)
# You can check the container logs to ensure MSSQL is ready:
docker-compose -f docker-compose-mssql.yml logs mssql
# Look for the message: "SQL Server is now ready for client connections"
Tests ready to run. Do it now.

When the database is no longer needed for tests, run the command:

```sh
docker-compose down
```

Also perform undo in App.config before commit changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: '3.2'

services:
mssql:
image: mcr.microsoft.com/mssql/server:2022-CU10-ubuntu-20.04
environment:
- ACCEPT_EULA=Y
- MSSQL_SA_PASSWORD=p@ssw0rd
ports:
- 1433:1433
volumes:
- mssqldb:/var/opt/mssql

volumes:
mssqldb:
Loading