* Add 1es builds

* fix install-dotnetl ref

* Address feed protection

* Install .net6

* Pack to correct dir

* Increase wait duration

* Use large pool for integration tests

* Build sln for integration tests

* Skip flaky test

* Remove 'large' pool

* Fix whitespace, remove travis ci yml
This commit is contained in:
Jacob Viau 2024-07-08 12:49:52 -07:00 коммит произвёл GitHub
Родитель 5b32229c8e
Коммит feeab9f23b
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
14 изменённых файлов: 303 добавлений и 45 удалений

Просмотреть файл

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://www.nuget.org/api/v2/" />
<add key="buildTools" value="https://www.myget.org/F/30de4ee06dd54956a82013fa17a3accb/" />
</packageSources>
</configuration>

Просмотреть файл

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Web.SkipStrongNames" version="1.0.0" />
</packages>

Просмотреть файл

@ -1,30 +0,0 @@
language: csharp
sudo: false
dist: trusty
dotnet: 2.0.0
env:
global:
- DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
- DOTNET_CLI_TELEMETRY_OPTOUT: 1
addons:
apt:
packages:
- libunwind8
mono: none
os:
- linux
osx_image: xcode9.1
branches:
only:
- master
- dev
- v2.x
- travis
- /^(.*\/)?ci-.*$/
- /^rel\/.*/
before_install:
- if test "$TRAVIS_OS_NAME" == "osx"; then brew update; brew install openssl; ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/; ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/; fi
before_script:
- chmod a+x ./build.sh
script:
- ./build.sh

Просмотреть файл

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="nuget.org" value="https://www.nuget.org/api/v2/" />
<add key="AzureFunctionsTempStaging" value="https://azfunc.pkgs.visualstudio.com/e6a70c92-4128-439f-8012-382fe78d6396/_packaging/AzureFunctionsTempStaging/nuget/v3/index.json" />
</packageSources>

Просмотреть файл

@ -0,0 +1,34 @@
trigger: none # ensure this is not ran as a CI build
pr:
branches:
include:
- dev
resources:
repositories:
- repository: 1es
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release
- repository: eng
type: git
name: engineering
ref: refs/tags/release
variables:
- template: /eng/ci/templates/variables/build.yml@self
- template: /ci/variables/cfs.yml@eng
extends:
template: v1/1ES.Unofficial.PipelineTemplate.yml@1es
parameters:
pool:
name: 1es-pool-azfunc
image: 1es-windows-2022
os: windows
stages:
- stage: Test
jobs:
- template: /eng/ci/templates/jobs/run-integration-tests.yml@self

43
eng/ci/official-build.yml Normal file
Просмотреть файл

@ -0,0 +1,43 @@
trigger:
batch: true
branches:
include:
- dev
# CI only, does not trigger on PRs.
pr: none
resources:
repositories:
- repository: 1es
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release
- repository: eng
type: git
name: engineering
ref: refs/tags/release
variables:
- template: /eng/ci/templates/variables/build.yml@self
- template: /ci/variables/cfs.yml@eng
extends:
template: v1/1ES.Official.PipelineTemplate.yml@1es
parameters:
pool:
name: 1es-pool-azfunc
image: 1es-windows-2022
os: windows
stages:
- stage: Build
jobs:
- template: /eng/ci/templates/jobs/build.yml@self
parameters:
official: true
- stage: Test
dependsOn: '' # Run in parallel
jobs:
- template: /eng/ci/templates/jobs/run-integration-tests.yml@self

38
eng/ci/public-build.yml Normal file
Просмотреть файл

@ -0,0 +1,38 @@
# This build is used for public PR and CI builds.
trigger:
batch: true
branches:
include:
- dev
pr:
branches:
include:
- v3.x
- release/3.*
resources:
repositories:
- repository: 1es
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release
variables:
- template: /eng/ci/templates/variables/build.yml@self
extends:
template: v1/1ES.Unofficial.PipelineTemplate.yml@1es
parameters:
pool:
name: 1es-pool-azfunc-public
image: 1es-windows-2022
os: windows
stages:
- stage: Build
jobs:
- template: /eng/ci/templates/jobs/build.yml@self
parameters:
official: false

Просмотреть файл

@ -0,0 +1,97 @@
parameters:
- name: official
type: boolean
default: false
displayName: Official build
jobs:
- job: build
displayName: Build
variables:
- name: log_dir
value: $(Build.ArtifactStagingDirectory)/log
- name: pack_dir
value: $(Build.ArtifactStagingDirectory)/pkg
- name: buildNumber
value: $[ counter('constant', 12000) ]
- ${{ if and(eq(parameters.official, true), startsWith(variables['Build.SourceBranch'], 'refs/tags')) }}:
- name: version_suffix
value: --version-suffix -$(buildNumber)
- ${{ else }}:
- name: version_suffix
value: ''
templateContext:
outputParentDirectory: $(Build.ArtifactStagingDirectory)
outputs:
- output: pipelineArtifact
displayName: Publish logs
path: $(pack_dir)
artifact: drop
- output: pipelineArtifact
displayName: Publish logs
path: $(log_dir)
artifact: Build_Log
sbomEnabled: false
condition: always()
steps:
- template: /eng/ci/templates/steps/install-dotnet.yml@self
- task: DotNetCoreCLI@2
displayName: Restore $(project)
inputs:
command: custom
custom: restore
projects: $(project)
arguments: -v m -bl:$(log_dir)/restore.binlog
- task: DotNetCoreCLI@2
displayName: Build $(project)
inputs:
command: build
projects: $(project)
arguments: -c $(configuration) -v m -bl:$(log_dir)/build.binlog --no-restore -p:CommitHash=$(Build.SourceVersion)
- task: DotNetCoreCLI@2
displayName: Unit tests
inputs:
command: test
arguments: -c $(configuration) --no-build
projects: |
test\Microsoft.Azure.WebJobs.Extensions.Rpc.UnitTests\*.csproj
test\Microsoft.Azure.WebJobs.Host.UnitTests\*.csproj
- ${{ if eq(parameters.official, true) }}:
- template: ci/sign-files.yml@eng
parameters:
displayName: Sign assemblies
folderPath: src
pattern: Microsoft.Azure.WebJobs.*.dll
signType: dll-strong-name
- task: DotNetCoreCLI@2
displayName: Pack
inputs:
command: custom
custom: pack
arguments: -c $(configuration) -v m -o $(pack_dir) -bl:$(log_dir)/pack.binlog --no-build $(version_suffix)
projects: |
src\Microsoft.Azure.WebJobs\WebJobs.csproj
src\Microsoft.Azure.WebJobs.Host\WebJobs.Host.csproj
src\Microsoft.Azure.WebJobs.Host\WebJobs.Host.Sources.csproj
src\Microsoft.Azure.WebJobs.Logging\WebJobs.Logging.csproj
src\Microsoft.Azure.WebJobs.Logging.ApplicationInsights\WebJobs.Logging.ApplicationInsights.csproj
src\Microsoft.Azure.WebJobs.Host.Storage\WebJobs.Host.Storage.csproj
src\Microsoft.Azure.WebJobs.Rpc.Core\WebJobs.Rpc.Core.csproj
src\Microsoft.Azure.WebJobs.Extensions.Rpc\WebJobs.Extensions.Rpc.csproj
test\Microsoft.Azure.WebJobs.Host.TestCommon\WebJobs.Host.TestCommon.csproj
- ${{ if eq(parameters.official, true) }}:
- template: ci/sign-files.yml@eng
parameters:
displayName: Sign nuget packages
folderPath: $(pack_dir)
pattern: Microsoft.Azure.WebJobs*.nupkg
signType: nuget

Просмотреть файл

@ -0,0 +1,45 @@
# Only to be used for internal builds.
jobs:
- job: RunIntegrationTests
displayName: Run Integration Tests
steps:
- template: /eng/ci/templates/steps/install-dotnet.yml@self
- task: AzureKeyVault@1
inputs:
# Note: This is actually a Service Connection in DevOps, not an Azure subscription name
azureSubscription: Azure-Functions-Host-CI-internal
keyVaultName: azure-webjobs-sdk-ci
secretsFilter: '*'
- task: DotNetCoreCLI@2
displayName: Build source
inputs:
command: build
arguments: -c $(configuration)
projects: $(project)
env:
CommitHash: $(Build.SourceVersion)
- task: DotNetCoreCLI@2
displayName: Run tests
inputs:
command: test
arguments: -c $(configuration) --no-build
projects: |
test\Microsoft.Azure.WebJobs.Host.FunctionalTests\*.csproj
test\Microsoft.Azure.WebJobs.Logging.FunctionalTests\*.csproj
test\Microsoft.Azure.WebJobs.Host.EndToEndTests\*.csproj
env:
AzureWebJobsDashboard: $(Storage)
AzureWebJobsStorage: $(Storage)
AzureWebJobsSecondaryStorage: $(Storage2)
AzureWebJobsServiceBus: $(ServiceBus)
AzureWebJobsServiceBusSecondary: $(ServiceBus2)
AzureWebJobsTestHubConnection: $(EventHub)
AzureWebJobsTestHubConnection2: $(EventHub2)
APPINSIGHTS_REPORTER_KEY: $(AppInsights)
ConnectionStrings:ServiceBus: $(ServiceBus)
ConnectionStrings:ServiceBusSecondary: $(ServiceBus2)

Просмотреть файл

@ -0,0 +1,19 @@
steps:
- task: UseDotNet@2 # Needed by some of our test resources
displayName: Install .NET 3
inputs:
packageType: sdk
version: 3.x
- task: UseDotNet@2 # Needed by some of our test resources
displayName: Install .NET 6
inputs:
packageType: sdk
version: 6.x
- task: UseDotNet@2 # The pinned SDK we use to build
displayName: Install .NET SDK from global.json
inputs:
packageType: sdk
useGlobalJson: true

Просмотреть файл

@ -0,0 +1,11 @@
variables:
- name: DOTNET_NOLOGO
value: 1
- name: DOTNET_SKIP_FIRST_TIME_EXPERIENCE
value: 1
- name: DOTNET_CLI_TELEMETRY_OPTOUT
value: 1
- name: configuration
value: release
- name: project
value: Webjobs.sln

10
global.json Normal file
Просмотреть файл

@ -0,0 +1,10 @@
{
"sdk": {
"version": "8.0.300",
"rollForward": "latestFeature"
},
"msbuild-sdks": {
"Microsoft.Build.NoTargets": "3.7.56",
"Microsoft.Build.Traversal": "4.1.0"
}
}

Просмотреть файл

@ -36,7 +36,7 @@ namespace Microsoft.Azure.WebJobs.Host.EndToEndTests
TestJobs.InvokeCount = 0;
}
[Fact]
[Fact(Skip = "Flaky, CPU dependent")]
public async Task DynamicConcurrencyEnabled_HighCpu_Throttles()
{
string functionName = nameof(TestJobs.ConcurrencyTest_HighCpu);

Просмотреть файл

@ -759,6 +759,7 @@ namespace Microsoft.Azure.WebJobs.Host.UnitTests.Timers
public void Dispose_TriggersCommandCancellationToken()
{
// Arrange
int waitMS = 5000;
TimeSpan interval = TimeSpan.Zero;
using (EventWaitHandle executeStarted = new ManualResetEvent(initialState: false))
@ -769,7 +770,7 @@ namespace Microsoft.Azure.WebJobs.Host.UnitTests.Timers
ITaskSeriesCommand command = CreateCommand((cancellationToken) =>
{
Assert.True(executeStarted.Set()); // Guard
cancellationTokenSignalled = cancellationToken.WaitHandle.WaitOne(1000);
cancellationTokenSignalled = cancellationToken.WaitHandle.WaitOne(waitMS);
Assert.True(executeFinished.Set()); // Guard
return new TaskSeriesCommandResult(wait: Task.Delay(0));
});
@ -777,13 +778,13 @@ namespace Microsoft.Azure.WebJobs.Host.UnitTests.Timers
using (ITaskSeriesTimer product = CreateProductUnderTest(command))
{
product.Start();
Assert.True(executeStarted.WaitOne(1000)); // Guard
Assert.True(executeStarted.WaitOne(waitMS)); // Guard
// Act
product.Dispose();
// Assert
Assert.True(executeFinished.WaitOne(1000)); // Guard
Assert.True(executeFinished.WaitOne(waitMS)); // Guard
Assert.True(cancellationTokenSignalled);
}
}