Skip to content

Commit 465f692

Browse files
authored
[v1.x] Add 1ES CI pipelines (#10211)
* Add 1ES CI to v1.x * Fix nuget.config * Fix nuget.config * update build_number * Split v1 build into official/public/test * Extra variables to template * Add release/1.* to triggers * Remove eng resource from public * Fix public pool * Replace secret with 'PLACEHOLDER' * Add all env vars for tests * Do not run tests on public ci * Add eng resource to integration-tests.yml * Fix missing job * Fix filter * Fix runtests.ps1 * Skip strong names for tests
1 parent a4d77d2 commit 465f692

File tree

10 files changed

+289
-5
lines changed

10 files changed

+289
-5
lines changed

.nuget/NuGet.Config

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
33
<packageSources>
4-
<add key="nuget.org" value="https://www.nuget.org/api/v2/" />
5-
<add key="azure_app_service" value="https://www.myget.org/F/azure-appservice/api/v2" />
6-
<add key="buildTools" value="https://www.myget.org/F/30de4ee06dd54956a82013fa17a3accb/" />
4+
<clear />
5+
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
6+
<add key="v1-tools" value="https://pkgs.dev.azure.com/azfunc/e6a70c92-4128-439f-8012-382fe78d6396/_packaging/v1-tools/nuget/v3/index.json" />
7+
<add key="azure-app-service" value="https://pkgs.dev.azure.com/azfunc/e6a70c92-4128-439f-8012-382fe78d6396/_packaging/myget-backup-azure-app-service/nuget/v3/index.json" />
78
</packageSources>
89
</configuration>

eng/ci/code-mirror.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
trigger:
2+
branches:
3+
include:
4+
- dev
5+
- in-proc
6+
- v1.x
7+
- v3.x
8+
- release/1.*
9+
- release/3.*
10+
- release/4.*
11+
- release/in-proc
12+
13+
resources:
14+
repositories:
15+
- repository: eng
16+
type: git
17+
name: engineering
18+
ref: refs/tags/release
19+
20+
variables:
21+
- template: ci/variables/cfs.yml@eng
22+
23+
extends:
24+
template: ci/code-mirror.yml@eng

eng/ci/integration-tests.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
trigger: none
2+
3+
pr:
4+
branches:
5+
include:
6+
- v1.x
7+
- release/1.*
8+
9+
resources:
10+
repositories:
11+
- repository: 1es
12+
type: git
13+
name: 1ESPipelineTemplates/1ESPipelineTemplates
14+
ref: refs/tags/release
15+
- repository: eng
16+
type: git
17+
name: engineering
18+
ref: refs/tags/release
19+
20+
variables:
21+
- template: /ci/variables/cfs.yml@eng
22+
- template: /eng/ci/templates/variables/build.yml@self
23+
24+
extends:
25+
template: v1/1ES.Unofficial.PipelineTemplate.yml@1es
26+
parameters:
27+
pool:
28+
name: 1es-pool-azfunc
29+
image: 1es-windows-2022
30+
os: windows
31+
32+
stages:
33+
- stage: Test
34+
jobs:
35+
- job: Test
36+
steps:
37+
- template: /eng/ci/templates/steps/build.yml@self
38+
parameters:
39+
configuration: $(configuration)
40+
targets: EnableSkipStrongNames;TestBuild
41+
42+
- template: /eng/ci/templates/steps/test.yml@self
43+
parameters:
44+
configuration: $(configuration)
45+
results_path: $(test_results_path)

eng/ci/official-build.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
trigger:
2+
branches:
3+
include:
4+
- v1.x
5+
- release/1.*
6+
7+
resources:
8+
repositories:
9+
- repository: 1es
10+
type: git
11+
name: 1ESPipelineTemplates/1ESPipelineTemplates
12+
ref: refs/tags/release
13+
- repository: eng
14+
type: git
15+
name: engineering
16+
ref: refs/tags/release
17+
18+
variables:
19+
- template: /ci/variables/cfs.yml@eng
20+
- template: /eng/ci/templates/variables/build.yml@self
21+
22+
extends:
23+
template: v1/1ES.Official.PipelineTemplate.yml@1es
24+
parameters:
25+
pool:
26+
name: 1es-pool-azfunc
27+
image: 1es-windows-2022
28+
os: windows
29+
30+
stages:
31+
- stage: BuildAndTest
32+
33+
jobs:
34+
- job: BuildAndTest
35+
templateContext:
36+
outputParentDirectory: $(publish_path)
37+
outputs:
38+
- output: pipelineArtifact
39+
displayName: Publish drop
40+
path: $(publish_path)/Packages
41+
artifact: drop
42+
43+
steps:
44+
- template: /eng/ci/templates/steps/build.yml@self
45+
parameters:
46+
configuration: $(configuration)
47+
publish_path: $(publish_path)
48+
build_number: $(build_number)
49+
50+
- template: /eng/ci/templates/steps/test.yml@self
51+
parameters:
52+
configuration: $(configuration)
53+
results_path: $(test_results_path)

eng/ci/public-build.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
trigger:
2+
branches:
3+
include:
4+
- v1.x
5+
- release/1.*
6+
7+
pr:
8+
branches:
9+
include:
10+
- v1.x
11+
- release/1.*
12+
13+
resources:
14+
repositories:
15+
- repository: 1es
16+
type: git
17+
name: 1ESPipelineTemplates/1ESPipelineTemplates
18+
ref: refs/tags/release
19+
20+
variables:
21+
- template: /eng/ci/templates/variables/build.yml@self
22+
23+
extends:
24+
template: v1/1ES.Unofficial.PipelineTemplate.yml@1es
25+
parameters:
26+
pool:
27+
name: 1es-pool-azfunc-public
28+
image: 1es-windows-2022
29+
os: windows
30+
31+
stages:
32+
- stage: Build
33+
34+
jobs:
35+
- job: Build
36+
templateContext:
37+
outputParentDirectory: $(publish_path)
38+
outputs:
39+
- output: pipelineArtifact
40+
displayName: Publish drop
41+
path: $(publish_path)/Packages
42+
artifact: drop
43+
44+
steps:
45+
- template: /eng/ci/templates/steps/build.yml@self
46+
parameters:
47+
configuration: $(configuration)
48+
publish_path: $(publish_path)
49+
build_number: $(build_number)

eng/ci/templates/steps/build.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
parameters:
2+
- name: configuration
3+
type: string
4+
default: Release
5+
- name: publish_path
6+
type: string
7+
default: bin
8+
- name: build_number
9+
type: string
10+
default: '4242'
11+
- name: targets
12+
type: string
13+
default: EnableSkipStrongNames;PackageScriptHost;PackageWebHost;TestBuild
14+
15+
steps:
16+
- task: MSBuild@1
17+
inputs:
18+
solution: WebJobs.Script.proj
19+
msbuildArguments: '/target:${{ parameters.targets }} /property:BuildNumber=${{ parameters.build_number }};Configuration=${{ parameters.configuration }};PublishPath=${{ parameters.publish_path }}'
20+
logFileVerbosity: minimal

eng/ci/templates/steps/test.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
parameters:
2+
- name: configuration
3+
type: string
4+
default: Release
5+
- name: results_path
6+
type: string
7+
default: $(System.DefaultWorkingDirectory)/test-results
8+
9+
steps:
10+
- ${{ if ne(variables['System.TeamProject'], 'internal') }}:
11+
- pwsh: |
12+
Write-Host "##vso[task.LogIssue type=error;]Tests cannot be ran in this Azure Devops project."
13+
exit 1
14+
displayName: Fail invalid project
15+
16+
- ${{ else }}:
17+
- task: AzureKeyVault@1
18+
inputs:
19+
# Note: This is actually a Service Connection in DevOps, not an Azure subscription name
20+
azureSubscription: Azure-Functions-Host-CI-internal
21+
keyVaultName: azurefunctionshostciv1
22+
secretsFilter: '*'
23+
24+
- task: UseNode@1
25+
displayName: Install Node 6.11.2
26+
inputs:
27+
version: '6.11.2'
28+
29+
- pwsh: .\runtests.ps1 -ResultsPath ${{ parameters.results_path }} -Configuration ${{ parameters.configuration }}
30+
displayName: Run tests
31+
env:
32+
# many of these will be empty if running unit tests, which is fine.
33+
AzureWebJobsStorage: $(Storage)
34+
AzureWebJobsDashboard: $(Storage)
35+
AzureWebJobsServiceBus: $(ServiceBus)
36+
AzureWebJobsDocumentDBConnectionString: $(CosmosDB)
37+
AzureWebJobsMobileAppUri: $(MobileUri)
38+
AzureWebJobs_TestMobileUri: $(MobileUri)
39+
AzureWebJobsDropBox: UseLocalFileSystem=true;Path=%TEMP%\DropBox
40+
AzureWebJobsEventHubSender: $(EventHub)
41+
AzureWebJobsEventHubReceiver: $(EventHub)
42+
AzureWebJobsEventHubPath: testhub
43+
AzureWebJobsNotificationHubsConnectionString: $(NotificationHub)
44+
AzureWebJobsNotificationHubName: testhub
45+
AzureWebJobsEnv: Development
46+
AzureWebJobsScriptRoot: $(System.DefaultWorkingDirectory)\test\WebJobs.Script.Tests.Integration\TestScripts\Empty
47+
AzureWebJobsCosmosDBConnectionString: $(CosmosDB)
48+
AzureWebJobsSecretStorageKeyVaultName: $(KeyVaultName)
49+
AzureWebJobsSecretStorageKeyVaultConnectionString: $(KeyVaultConnectionString)
50+
ConnectionStrings__CosmosDB: $(CosmosDB2)
51+
FILES_ACCOUNT_NAME: $(FilesAccountName)
52+
FILES_ACCOUNT_KEY: $(FilesAccountKey)
53+
MOCHA_FILE: ${{ parameters.results_path }}/junit-test-results.xml
54+
TMP: $(Agent.TempDirectory)
55+
56+
- task: PublishTestResults@2
57+
displayName: Publish XUnit test results
58+
inputs:
59+
testResultsFormat: XUnit
60+
testResultsFiles: ${{ parameters.results_path }}/xunit-*.xml
61+
mergeTestResults: true
62+
buildConfiguration: $(configuration)
63+
testRunTitle: XUnit Tests
64+
condition: always()
65+
66+
67+
- task: PublishTestResults@2
68+
displayName: Publish JUnit test results
69+
inputs:
70+
testResultsFormat: JUnit
71+
testResultsFiles: ${{ parameters.results_path }}/junit-*.xml
72+
mergeTestResults: true
73+
buildConfiguration: $(configuration)
74+
testRunTitle: JUnit Tests
75+
condition: always()
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
variables:
2+
- name: DOTNET_NOLOGO
3+
value: 1
4+
- name: DOTNET_SKIP_FIRST_TIME_EXPERIENCE
5+
value: 1
6+
- name: DOTNET_CLI_TELEMETRY_OPTOUT
7+
value: 1
8+
- name: build_number
9+
value: $[ counter('constant-v1x', 23000) ]
10+
- name: includeBuildNumberInVersion
11+
value: 1
12+
- name: configuration
13+
value: Release
14+
- name: publish_path
15+
value: bin
16+
- name: test_results_path
17+
value: $(System.DefaultWorkingDirectory)\test-results

src/Common/CommonAssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) .NET Foundation. All rights reserved.
1+
// Copyright (c) .NET Foundation. All rights reserved.
22
// Licensed under the MIT License. See License.txt in the project root for license information.
33

44
using System;

test/WebJobs.Script.Tests/Security/SecretManagerTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ public async Task AddOrUpdateFunctionSecrets_WithScope_UsesSecretandPersistsHost
562562
[Fact]
563563
public async Task SetMasterKey_WithProvidedKey_UsesProvidedKeyAndPersistsFile()
564564
{
565-
string testSecret = "abcde0123456789abcde0123456789abcde0123456789";
565+
string testSecret = "PLACEHOLDER";
566566
using (var directory = new TempDirectory())
567567
{
568568
string expectedTraceMessage = "Master key Updated";

0 commit comments

Comments
 (0)