Skip to content

Commit 64cef47

Browse files
hallvictoriaVictoria Hallgavin-aguiar
authored
fix: mirror sdk and extension branches (#1554)
* add sdk and extension branches to code-mirror * rename tests * rename tests * download dev packages for unit, skip for lc * lint --------- Co-authored-by: Victoria Hall <[email protected]> Co-authored-by: gavin-aguiar <[email protected]>
1 parent 5444e63 commit 64cef47

File tree

9 files changed

+92
-33
lines changed

9 files changed

+92
-33
lines changed

eng/ci/code-mirror.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ trigger:
33
include:
44
- dev
55
- release/*
6+
- sdk/* # run for sdk and extension release branches
7+
- extensions/*
68

79
resources:
810
repositories:

eng/ci/integration-tests.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
trigger: none # ensure this is not ran as a CI build
1+
trigger: # run for sdk and extension release branches
2+
batch: true
3+
branches:
4+
include:
5+
- sdk/*
6+
- extensions/*
27

38
pr:
49
branches:

eng/ci/public-build.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ trigger:
33
branches:
44
include:
55
- dev
6+
- sdk/*
7+
- extensions/*
68

79
pr:
810
branches:
@@ -24,6 +26,12 @@ resources:
2426
name: 1ESPipelineTemplates/1ESPipelineTemplates
2527
ref: refs/tags/release
2628

29+
variables:
30+
- name: isSdkRelease
31+
value: $[startsWith(variables['Build.SourceBranch'], 'refs/heads/sdk/')]
32+
- name: isExtensionsRelease
33+
value: $[startsWith(variables['Build.SourceBranch'], 'refs/heads/extensions/')]
34+
2735
extends:
2836
template: v1/1ES.Unofficial.PipelineTemplate.yml@1es
2937
parameters:

eng/scripts/test-extensions.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
python -m pip install --upgrade pip
4+
if [[ $2 != "3.7" ]]; then
5+
python -m pip install -e $1/PythonExtensionArtifact
6+
python -m pip install --pre -U -e .[test-http-v2]
7+
fi
8+
if [[ $2 != "3.7" && $2 != "3.8" ]]; then
9+
python -m pip install -e $1/PythonExtensionArtifact
10+
python -m pip install --pre -U -e .[test-deferred-bindings]
11+
fi
12+
13+
python -m pip install -U -e .[dev]

eng/scripts/test-sdk.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
3+
python -m pip install --upgrade pip
4+
python -m pip install -e $1/PythonSdkArtifact
5+
python -m pip install -U -e .[dev]
6+
7+
if [[ $2 != "3.7" ]]; then
8+
python -m pip install --pre -U -e .[test-http-v2]
9+
fi
10+
if [[ $2 != "3.7" && $2 != "3.8" ]]; then
11+
python -m pip install --pre -U -e .[test-deferred-bindings]
12+
fi

eng/templates/jobs/ci-unit-tests.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,43 @@ jobs:
3232
eng/scripts/install-dependencies.sh $(PYTHON_VERSION)
3333
eng/scripts/test-setup.sh
3434
displayName: 'Install dependencies'
35+
condition: and(eq(variables.isSdkRelease, false), eq(variables.isExtensionsRelease, false), eq(variables['USETESTPYTHONSDK'], false), eq(variables['USETESTPYTHONEXTENSIONS'], false))
36+
- task: DownloadPipelineArtifact@2
37+
displayName: 'Download Python SDK Artifact'
38+
inputs:
39+
buildType: specific
40+
artifactName: 'azure-functions'
41+
project: 'internal'
42+
definition: 679
43+
buildVersionToDownload: latest
44+
targetPath: '$(Pipeline.Workspace)/PythonSdkArtifact'
45+
condition: or(eq(variables.isSdkRelease, true), eq(variables['USETESTPYTHONSDK'], true))
46+
- bash: |
47+
chmod +x eng/scripts/test-sdk.sh
48+
chmod +x eng/scripts/test-setup.sh
49+
50+
eng/scripts/test-sdk.sh $(Pipeline.Workspace) $(PYTHON_VERSION)
51+
eng/scripts/test-setup.sh
52+
displayName: 'Install test python sdk, dependencies and the worker'
53+
condition: or(eq(variables.isSdkRelease, true), eq(variables['USETESTPYTHONSDK'], true))
54+
- task: DownloadPipelineArtifact@2
55+
displayName: 'Download Python Extension Artifact'
56+
inputs:
57+
buildType: specific
58+
artifactName: $(PYTHONEXTENSIONNAME)
59+
project: 'internal'
60+
definition: 798
61+
buildVersionToDownload: latest
62+
targetPath: '$(Pipeline.Workspace)/PythonExtensionArtifact'
63+
condition: or(eq(variables.isExtensionsRelease, true), eq(variables['USETESTPYTHONEXTENSIONS'], true))
64+
- bash: |
65+
chmod +x eng/scripts/test-setup.sh
66+
chmod +x eng/scripts/test-extensions.sh
67+
68+
eng/scripts/test-extensions.sh $(Pipeline.Workspace) $(PYTHON_VERSION)
69+
eng/scripts/test-setup.sh
70+
displayName: 'Install test python extension, dependencies and the worker'
71+
condition: or(eq(variables.isExtensionsRelease, true), eq(variables['USETESTPYTHONEXTENSIONS'], true))
3572
- bash: |
3673
python -m pytest -q -n auto --dist loadfile --reruns 4 --instafail --cov=./azure_functions_worker --cov-report xml --cov-branch tests/unittests
3774
displayName: "Running $(PYTHON_VERSION) Unit Tests"

eng/templates/official/jobs/ci-e2e-tests.yml

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -90,18 +90,10 @@ jobs:
9090
targetPath: '$(Pipeline.Workspace)/PythonSdkArtifact'
9191
condition: or(eq(variables.isSdkRelease, true), eq(variables['USETESTPYTHONSDK'], true))
9292
- bash: |
93-
python -m pip install --upgrade pip
94-
python -m pip install -e $(Pipeline.Workspace)/PythonSdkArtifact
95-
python -m pip install -U -e .[dev]
96-
97-
if [[ $(PYTHON_VERSION) != "3.7" ]]; then
98-
python -m pip install --pre -U -e .[test-http-v2]
99-
fi
100-
if [[ $(PYTHON_VERSION) != "3.7" && $(PYTHON_VERSION) != "3.8" ]]; then
101-
python -m pip install --pre -U -e .[test-deferred-bindings]
102-
fi
103-
93+
chmod +x eng/scripts/test-sdk.sh
10494
chmod +x eng/scripts/test-setup.sh
95+
96+
eng/scripts/test-sdk.sh $(Pipeline.Workspace) $(PYTHON_VERSION)
10597
eng/scripts/test-setup.sh
10698
displayName: 'Install test python sdk, dependencies and the worker'
10799
condition: or(eq(variables.isSdkRelease, true), eq(variables['USETESTPYTHONSDK'], true))
@@ -116,21 +108,10 @@ jobs:
116108
targetPath: '$(Pipeline.Workspace)/PythonExtensionArtifact'
117109
condition: or(eq(variables.isExtensionsRelease, true), eq(variables['USETESTPYTHONEXTENSIONS'], true))
118110
- bash: |
119-
python -m pip install --upgrade pip
120-
121-
if [[ $(PYTHON_VERSION) != "3.7" ]]; then
122-
python -m pip install -e $(Pipeline.Workspace)/PythonExtensionArtifact
123-
python -m pip install --pre -U -e .[test-http-v2]
124-
fi
125-
if [[ $(PYTHON_VERSION) != "3.7" && $(PYTHON_VERSION) != "3.8" ]]; then
126-
python -m pip install -e $(Pipeline.Workspace)/PythonExtensionArtifact
127-
python -m pip install --pre -U -e .[test-deferred-bindings]
128-
fi
129-
130-
python -m pip install -U -e .[dev]
131-
132-
133111
chmod +x eng/scripts/test-setup.sh
112+
chmod +x eng/scripts/test-extensions.sh
113+
114+
eng/scripts/test-extensions.sh $(Pipeline.Workspace) $(PYTHON_VERSION)
134115
eng/scripts/test-setup.sh
135116
displayName: 'Install test python extension, dependencies and the worker'
136117
condition: or(eq(variables.isExtensionsRelease, true), eq(variables['USETESTPYTHONEXTENSIONS'], true))

eng/templates/official/jobs/ci-lc-tests.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,5 @@ jobs:
3636
env:
3737
AzureWebJobsStorage: $(LinuxStorageConnectionString312)
3838
_DUMMY_CONT_KEY: $(_DUMMY_CONT_KEY)
39-
displayName: "Running $(PYTHON_VERSION) Linux Consumption tests"
39+
displayName: "Running $(PYTHON_VERSION) Linux Consumption tests"
40+
condition: and(eq(variables.isSdkRelease, false), eq(variables.isExtensionsRelease, false), eq(variables['USETESTPYTHONSDK'], false), eq(variables['USETESTPYTHONEXTENSIONS'], false))

tests/extension_tests/deferred_bindings_tests/deferred_bindings_functions/deferred_bindings_enabled_dual/function_app.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,24 @@
88
app = func.FunctionApp(http_auth_level=func.AuthLevel.ANONYMOUS)
99

1010

11-
@app.function_name(name="get_bc_blob_triggered")
11+
@app.function_name(name="get_bc_blob_triggered_dual")
1212
@app.blob_input(arg_name="client",
1313
path="python-worker-tests/test-blobclient-triggered.txt",
1414
connection="AzureWebJobsStorage")
15-
@app.route(route="get_bc_blob_triggered")
16-
def get_bc_blob_triggered(req: func.HttpRequest,
17-
client: blob.BlobClient) -> str:
15+
@app.route(route="get_bc_blob_triggered_dual")
16+
def get_bc_blob_triggered_dual(req: func.HttpRequest,
17+
client: blob.BlobClient) -> str:
1818
return client.download_blob(encoding='utf-8').readall()
1919

2020

21-
@app.function_name(name="blob_trigger")
21+
@app.function_name(name="blob_trigger_dual")
2222
@app.blob_trigger(arg_name="file",
2323
path="python-worker-tests/test-blob-trigger.txt",
2424
connection="AzureWebJobsStorage")
2525
@app.blob_output(arg_name="$return",
2626
path="python-worker-tests/test-blob-triggered.txt",
2727
connection="AzureWebJobsStorage")
28-
def blob_trigger(file: func.InputStream) -> str:
28+
def blob_trigger_dual(file: func.InputStream) -> str:
2929
return json.dumps({
3030
'name': file.name,
3131
'length': file.length,

0 commit comments

Comments
 (0)