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

Consumer API: Execute lock statement on the variable updated in the critical area #551

Closed
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
5 changes: 0 additions & 5 deletions .ci/checkFormatting.js

This file was deleted.

3 changes: 3 additions & 0 deletions .ci/checkFormatting.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

dotnet format --verify-no-changes
4 changes: 2 additions & 2 deletions .ci/integrationTest.postgres.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dockerCompose down
dockerCompose build
dockerCompose up -d
dotnet restore "Backbone.sln"
dotnet build /property:WarningLevel=0 --no-restore "Backbone.sln"
dotnet build --no-restore "Backbone.sln"
export CONSUMER_API_BASE_ADDRESS="http://localhost:5000"
export ADMIN_API_BASE_ADDRESS="http://localhost:5173"
dotnet test --no-restore --no-build --filter "Category=Integration&TestCategory!~ignore" "Backbone.sln"
dotnet test --no-restore --no-build --filter "Category=Integration&TestCategory!~ignore" --logger "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true" "Backbone.sln"
4 changes: 2 additions & 2 deletions .ci/integrationTest.sqlserver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dockerCompose down
dockerCompose build
dockerCompose up -d
dotnet restore "Backbone.sln"
dotnet build /property:WarningLevel=0 --no-restore "Backbone.sln"
dotnet build --no-restore "Backbone.sln"
export CONSUMER_API_BASE_ADDRESS="http://localhost:5000"
export ADMIN_API_BASE_ADDRESS="http://localhost:5173"
dotnet test --no-restore --no-build --filter "Category=Integration&TestCategory!~ignore" "Backbone.sln"
dotnet test --no-restore --no-build --filter "Category=Integration&TestCategory!~ignore" --logger "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true" "Backbone.sln"
7 changes: 0 additions & 7 deletions .ci/test.js

This file was deleted.

5 changes: 5 additions & 0 deletions .ci/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

dotnet restore "Backbone.sln"
dotnet build --no-restore "Backbone.sln"
dotnet test --no-restore --no-build --filter "Category!=Integration" --logger "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true" "Backbone.sln"
12 changes: 8 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,22 @@ jobs:
with:
dotnet-version: "8.0.x"
- name: Check formatting
run: ./.ci/checkFormatting.js
run: ./.ci/checkFormatting.sh

test:
runs-on: ubuntu-latest
name: Run Tests
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install script dependencies
run: npm install --prefix ./.ci
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.0.x"
- name: Run tests
run: ./.ci/test.js
run: ./.ci/test.sh
env:
DOTNET_CONSOLE_ANSI_COLOR: true

integration-test-sqlserver:
name: Run Integration Tests (on SQL Server)
Expand All @@ -66,6 +66,8 @@ jobs:
with:
name: integration-test-sqlserver-docker-logs
path: docker-log.txt
env:
DOTNET_CONSOLE_ANSI_COLOR: true

integration-test-postgres:
name: Run Integration Tests (on Postgres)
Expand All @@ -86,6 +88,8 @@ jobs:
with:
name: integration-test-postgres-docker-logs
path: docker-log.txt
env:
DOTNET_CONSOLE_ANSI_COLOR: true

transport-test-sqlserver:
name: Run transport Tests (on SQL Server)
Expand Down
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[xml]": {
"editor.defaultFormatter": "DotJoshJohnson.xml"
},
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"files.autoSave": "off",
Expand Down
2 changes: 1 addition & 1 deletion AdminApi/src/AdminApi/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ RUN dotnet restore "AdminApi/src/AdminApi/AdminApi.csproj"

COPY . .

RUN dotnet publish /property:WarningLevel=0 /p:UseAppHost=false --no-restore --configuration Release --output /app/publish "/src/AdminApi/src/AdminApi/AdminApi.csproj"
RUN dotnet publish /p:UseAppHost=false --no-restore --configuration Release --output /app/publish "/src/AdminApi/src/AdminApi/AdminApi.csproj"
RUN dotnet publish --configuration Release --output /app/publish/health "HealthCheck/HealthCheck.csproj"

### Final ####
Expand Down
2 changes: 1 addition & 1 deletion AdminApi/src/AdminApi/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ static void ConfigureServices(IServiceCollection services, IConfiguration config
.ConfigureAndValidate<AdminConfiguration>(configuration.Bind)
.ConfigureAndValidate<ApplicationOptions>(options => configuration.GetSection("Modules:Devices:Application").Bind(options));

#pragma warning disable ASP0000 We retrieve the Configuration via IOptions here so that it is validated
#pragma warning disable ASP0000 // We retrieve the Configuration via IOptions here so that it is validated
var parsedConfiguration = services.BuildServiceProvider().GetRequiredService<IOptions<AdminConfiguration>>().Value;

#pragma warning restore ASP0000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@
<PackageReference Include="nunit" Version="4.1.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.3">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\BuildingBlocks\src\SpecFlowCucumberResultsExporter\SpecFlowCucumberResultsExporter.csproj" />
<ProjectReference Include="..\..\..\BuildingBlocks\src\UnitTestTools\UnitTestTools.csproj" />
<ProjectReference Include="..\..\src\AdminApi\AdminApi.csproj" />
</ItemGroup>
Expand Down
16 changes: 0 additions & 16 deletions AdminApi/test/AdminApi.Tests.Integration/Hooks/Hooks.cs

This file was deleted.

7 changes: 0 additions & 7 deletions AdminApi/test/AdminApi.Tests.Integration/specflow.json

This file was deleted.

5 changes: 5 additions & 0 deletions Backbone.Tests.ArchUnit/Backbone.Tests.ArchUnit.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
<PackageReference Include="MediatR" Version="12.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="TngTech.ArchUnitNET.xUnit" Version="0.10.6" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.3">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="xunit" Version="2.7.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
7 changes: 0 additions & 7 deletions Backbone.sln
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Devices.Infrastructure.Test
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Devices.AdminCli", "Modules\Devices\src\Devices.AdminCli\Devices.AdminCli.csproj", "{E7B3FFFA-3B6B-45F9-BFD0-0D3344AF979F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SpecFlowCucumberResultsExporter", "BuildingBlocks\src\SpecFlowCucumberResultsExporter\SpecFlowCucumberResultsExporter.csproj", "{5CD9D570-BC18-47F3-8646-15EC5C7B70AB}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Files.Jobs.SanityCheck", "Modules\Files\src\Files.Jobs.SanityCheck\Files.Jobs.SanityCheck.csproj", "{1BB56A85-74F8-497F-983C-274D51B25CF4}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Files.Jobs.SanityCheck.Tests", "Modules\Files\test\Files.Jobs.SanityCheck.Tests\Files.Jobs.SanityCheck.Tests.csproj", "{6289332A-DBF2-4B99-BEFB-AC01A4C9D262}"
Expand Down Expand Up @@ -535,10 +533,6 @@ Global
{E7B3FFFA-3B6B-45F9-BFD0-0D3344AF979F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E7B3FFFA-3B6B-45F9-BFD0-0D3344AF979F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E7B3FFFA-3B6B-45F9-BFD0-0D3344AF979F}.Release|Any CPU.Build.0 = Release|Any CPU
{5CD9D570-BC18-47F3-8646-15EC5C7B70AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5CD9D570-BC18-47F3-8646-15EC5C7B70AB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5CD9D570-BC18-47F3-8646-15EC5C7B70AB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5CD9D570-BC18-47F3-8646-15EC5C7B70AB}.Release|Any CPU.Build.0 = Release|Any CPU
{1BB56A85-74F8-497F-983C-274D51B25CF4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1BB56A85-74F8-497F-983C-274D51B25CF4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1BB56A85-74F8-497F-983C-274D51B25CF4}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -745,7 +739,6 @@ Global
{40F14114-44B0-4EE0-A653-6C8205F6F28C} = {F31B1655-A11B-4F30-9BC7-7418B8B915D7}
{19BE44FE-8852-40DD-AE70-EFA8B1E28730} = {F31B1655-A11B-4F30-9BC7-7418B8B915D7}
{E7B3FFFA-3B6B-45F9-BFD0-0D3344AF979F} = {AAE79377-8414-4C23-BF0C-678B68A24BC7}
{5CD9D570-BC18-47F3-8646-15EC5C7B70AB} = {06D714AE-EDF4-421C-9340-EDA6FCDF491F}
{1BB56A85-74F8-497F-983C-274D51B25CF4} = {3D324161-C287-4DC0-A9FD-FA3B1A6643FD}
{6289332A-DBF2-4B99-BEFB-AC01A4C9D262} = {2D0BC8E9-ED6B-49D9-937C-1616ED40FB3E}
{360430CE-6850-4A67-88ED-E9508B7D2658} = {06D714AE-EDF4-421C-9340-EDA6FCDF491F}
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading