Skip to content

Commit

Permalink
Add 1ES CI files (#3084)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
jviau committed Jul 8, 2024
1 parent 5b32229 commit feeab9f
Show file tree
Hide file tree
Showing 14 changed files with 303 additions and 45 deletions.
7 changes: 0 additions & 7 deletions .nuget/NuGet.Config

This file was deleted.

4 changes: 0 additions & 4 deletions .nuget/packages.config

This file was deleted.

30 changes: 0 additions & 30 deletions .travis.yml

This file was deleted.

1 change: 1 addition & 0 deletions NuGet.Config
Original file line number Diff line number Diff line change
@@ -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>
Expand Down
34 changes: 34 additions & 0 deletions eng/ci/integration-tests.yml
Original file line number Diff line number Diff line change
@@ -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 changes: 43 additions & 0 deletions eng/ci/official-build.yml
Original file line number Diff line number Diff line change
@@ -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 changes: 38 additions & 0 deletions eng/ci/public-build.yml
Original file line number Diff line number Diff line change
@@ -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
97 changes: 97 additions & 0 deletions eng/ci/templates/jobs/build.yml
Original file line number Diff line number Diff line change
@@ -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
45 changes: 45 additions & 0 deletions eng/ci/templates/jobs/run-integration-tests.yml
Original file line number Diff line number Diff line change
@@ -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)
19 changes: 19 additions & 0 deletions eng/ci/templates/steps/install-dotnet.yml
Original file line number Diff line number Diff line change
@@ -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
11 changes: 11 additions & 0 deletions eng/ci/templates/variables/build.yml
Original file line number Diff line number Diff line change
@@ -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 changes: 10 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public DynamicConcurrencyEndToEndTests()
TestJobs.InvokeCount = 0;
}

[Fact]
[Fact(Skip = "Flaky, CPU dependent")]
public async Task DynamicConcurrencyEnabled_HighCpu_Throttles()
{
string functionName = nameof(TestJobs.ConcurrencyTest_HighCpu);
Expand Down
Loading

0 comments on commit feeab9f

Please sign in to comment.