Skip to content

Commit 07d77aa

Browse files
bergmanianikolajlauridsen
authored andcommitted
Optimize Azure pipeline (#17674)
* Only fetch single commit * Hopefully fixes Nerdbank.GitVersioning.GitException: Shallow clone lacks the objects required to calculate version height. Use full clones or clones with a history at least as deep as the last version height resetting change. * Do not checkout again * More test pipeline * Another attempt * yet another attempt * more attempts * Revert "more attempts" This reverts commit 5694d97. * Test without building backoffice and login explicitly * Fix mem leak in integration tests * Fixes sqlserver lock test
1 parent 3203f64 commit 07d77aa

File tree

3 files changed

+29
-18
lines changed

3 files changed

+29
-18
lines changed

build/azure-pipelines.yml

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -78,24 +78,13 @@ stages:
7878
vmImage: "windows-latest"
7979
steps:
8080
- checkout: self
81-
submodules: true
81+
submodules: false
82+
lfs: false,
83+
fetchDepth: 500
8284
- task: UseDotNet@2
8385
displayName: Use .NET SDK from global.json
8486
inputs:
8587
useGlobalJson: true
86-
- template: templates/backoffice-install.yml
87-
- script: npm run build:for:cms
88-
displayName: Run build (Bellissima)
89-
workingDirectory: src/Umbraco.Web.UI.Client
90-
- script: npm run check:paths
91-
displayName: Run check:paths
92-
workingDirectory: src/Umbraco.Web.UI.Client
93-
- script: npm ci --no-fund --no-audit --prefer-offline
94-
displayName: Run npm ci (Login)
95-
workingDirectory: src/Umbraco.Web.UI.Login
96-
- script: npm run build
97-
displayName: Run npm build (Login)
98-
workingDirectory: src/Umbraco.Web.UI.Login
9988
- task: DotNetCoreCLI@2
10089
displayName: Run dotnet restore
10190
inputs:
@@ -125,7 +114,10 @@ stages:
125114
vmImage: "ubuntu-latest"
126115
steps:
127116
- checkout: self
128-
submodules: true
117+
submodules: false
118+
lfs: false,
119+
fetchDepth: 1
120+
fetchFilter: tree:0
129121
- template: templates/backoffice-install.yml
130122
- script: npm run build:for:npm
131123
displayName: Run build:for:npm
@@ -209,7 +201,10 @@ stages:
209201
BASE_PATH: /v$(umbracoMajorVersion)/ui
210202
steps:
211203
- checkout: self
212-
submodules: true
204+
submodules: false
205+
lfs: false,
206+
fetchDepth: 1
207+
fetchFilter: tree:0
213208
- template: templates/backoffice-install.yml
214209
- script: npm run storybook:build
215210
displayName: Build Storybook
@@ -266,6 +261,11 @@ stages:
266261
pool:
267262
vmImage: $(vmImage)
268263
steps:
264+
- checkout: self
265+
submodules: false
266+
lfs: false,
267+
fetchDepth: 1
268+
fetchFilter: tree:0
269269
- task: DownloadPipelineArtifact@2
270270
displayName: Download build artifacts
271271
inputs:
@@ -306,6 +306,11 @@ stages:
306306
variables:
307307
Tests__Database__DatabaseType: "Sqlite"
308308
steps:
309+
- checkout: self
310+
submodules: false
311+
lfs: false,
312+
fetchDepth: 1
313+
fetchFilter: tree:0
309314
# Setup test environment
310315
- task: DownloadPipelineArtifact@2
311316
displayName: Download build artifacts

src/Umbraco.Cms.Persistence.EFCore/Locking/SqlServerEFCoreDistributedLockingMechanism.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,9 @@ private void ObtainWriteLock()
170170
"A transaction with minimum ReadCommitted isolation level is required.");
171171
}
172172

173-
var rowsAffected = await dbContext.Database.ExecuteSqlAsync(@$"SET LOCK_TIMEOUT {(int)_timeout.TotalMilliseconds};UPDATE umbracoLock WITH (REPEATABLEREAD) SET value = (CASE WHEN (value=1) THEN -1 ELSE 1 END) WHERE id={LockId}");
173+
#pragma warning disable EF1002
174+
var rowsAffected = await dbContext.Database.ExecuteSqlRawAsync(@$"SET LOCK_TIMEOUT {(int)_timeout.TotalMilliseconds};UPDATE umbracoLock WITH (REPEATABLEREAD) SET value = (CASE WHEN (value=1) THEN -1 ELSE 1 END) WHERE id={LockId}");
175+
#pragma warning restore EF1002
174176

175177
if (rowsAffected == 0)
176178
{

tests/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTest.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,11 @@ public void Setup()
8484
}
8585

8686
[TearDown]
87-
public void TearDownAsync() => _host.StopAsync();
87+
public void TearDownAsync()
88+
{
89+
_host.StopAsync();
90+
Services.DisposeIfDisposable();
91+
}
8892

8993
/// <summary>
9094
/// Create the Generic Host and execute startup ConfigureServices/Configure calls

0 commit comments

Comments
 (0)