Skip to content

Commit 88cdcae

Browse files
committed
Docker tests updates
1 parent 4c8fb7b commit 88cdcae

9 files changed

+30
-17
lines changed

.github/workflows/ci_consumption_workflow.yml

+11-2
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,14 @@ name: CI Consumption E2E tests
55

66
on:
77
workflow_dispatch:
8+
inputs:
9+
custom_image:
10+
description: "Use a custom image to run consumption tests"
11+
required: false
812
push:
9-
branches: [ dev, master, main, release/* ]
13+
branches: [ dev, main, release/* ]
1014
pull_request:
11-
branches: [ dev, master, main, release/* ]
15+
branches: [ dev, main, release/* ]
1216

1317
jobs:
1418
build:
@@ -35,24 +39,29 @@ jobs:
3539
if: matrix.python-version == 3.7
3640
env:
3741
AzureWebJobsStorage: ${{ secrets.LinuxStorageConnectionString37 }}
42+
CUSTOM_IMAGE: ${{ github.event.inputs.custom_image }}
3843
run: python -m pytest -n auto --dist loadfile -vv --reruns 4 --instafail tests/consumption_tests
3944
- name: Running 3.8 Tests
4045
if: matrix.python-version == 3.8
4146
env:
4247
AzureWebJobsStorage: ${{ secrets.LinuxStorageConnectionString38 }}
48+
CUSTOM_IMAGE: ${{ github.event.inputs.custom_image }}
4349
run: python -m pytest -n auto --dist loadfile -vv --reruns 4 --instafail tests/consumption_tests
4450
- name: Running 3.9 Tests
4551
if: matrix.python-version == 3.9
4652
env:
4753
AzureWebJobsStorage: ${{ secrets.LinuxStorageConnectionString39 }}
54+
CUSTOM_IMAGE: ${{ github.event.inputs.custom_image }}
4855
run: python -m pytest -n auto --dist loadfile -vv --reruns 4 --instafail tests/consumption_tests
4956
- name: Running 3.10 Tests
5057
if: matrix.python-version == 3.10
5158
env:
5259
AzureWebJobsStorage: ${{ secrets.LinuxStorageConnectionString310 }}
60+
CUSTOM_IMAGE: ${{ github.event.inputs.custom_image }}
5361
run: python -m pytest -n auto --dist loadfile -vv --reruns 4 --instafail tests/consumption_tests
5462
- name: Running 3.11 Tests
5563
if: matrix.python-version == 3.11
5664
env:
5765
AzureWebJobsStorage: ${{ secrets.LinuxStorageConnectionString311 }}
66+
CUSTOM_IMAGE: ${{ github.event.inputs.custom_image }}
5867
run: python -m pytest -n auto --dist loadfile -vv --reruns 4 --instafail tests/consumption_tests

.github/workflows/ci_docker_con_workflow.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ name: CI Docker Consumption tests
55
on:
66
workflow_dispatch:
77
schedule:
8-
# Monday to Thursday 2 AM PDT build
9-
# * is a special character in YAML so you have to quote this string
10-
- cron: "0 9 * * *"
8+
# Run everyday at 5 AM CST
9+
- cron: "0 10 * * *"
1110

1211
jobs:
1312
build:
@@ -30,7 +29,6 @@ jobs:
3029
python-version: ${{ matrix.python-version }}
3130
- name: Install dependencies
3231
run: |
33-
python -m pip install -U -e .[dev]
3432
python setup.py build
3533
- name: Running 3.7 Tests
3634
if: matrix.python-version == 3.7

.github/workflows/ci_docker_custom_workflow.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
python-version: ${{ env.python_version }}
5050
- name: Install dependencies
5151
run: |
52-
python -m pip install -U -e .[dev]
52+
python setup.py build
5353
- name: Running 3.7 Tests
5454
if: env.python_version == 3.7
5555
env:

.github/workflows/ci_docker_ded_workflow.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ name: CI Docker Dedicated tests
55
on:
66
workflow_dispatch:
77
schedule:
8-
# Monday to Thursday 1 AM PDT build
9-
# * is a special character in YAML so you have to quote this string
10-
- cron: "0 8 * * *"
8+
# Run everyday at 4 AM CST
9+
- cron: "0 9 * * *"
1110

1211
jobs:
1312
build:
@@ -30,7 +29,6 @@ jobs:
3029
python-version: ${{ matrix.python-version }}
3130
- name: Install dependencies
3231
run: |
33-
python -m pip install -U -e .[dev]
3432
python setup.py build
3533
- name: Running 3.7 Tests
3634
if: matrix.python-version == 3.7

.github/workflows/ci_e2e_workflow.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ on:
1111
required: false
1212
default: "false"
1313
push:
14-
branches: [dev, master, main, release/*]
14+
branches: [dev, main, release/*]
1515
pull_request:
16-
branches: [dev, master, main, release/*]
16+
branches: [dev, main, release/*]
1717
schedule:
1818
# Monday to Thursday 1 AM PDT build
1919
# * is a special character in YAML so you have to quote this string

.github/workflows/ci_ut_workflow.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ on:
1616
- cron: "0 8 * * 1,2,3,4"
1717
push:
1818
pull_request:
19-
branches: [ dev, master, main, release/* ]
19+
branches: [ dev, main, release/* ]
2020

2121
jobs:
2222
build:

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ What are the supported Python versions?
1515
|----------------------------------|------------|------------|------------|------------|-------------|-------------|
1616
| Azure Functions 2.0 (deprecated) ||| - | - | - | - |
1717
| Azure Functions 3.0 (deprecated) ||||| - | - |
18-
| Azure Functions 4.0 | - | |||| coming soon |
18+
| Azure Functions 4.0 | - | - |||| |
1919

2020
For information about Azure Functions Runtime, please refer to [Azure Functions runtime versions overview](https://docs.microsoft.com/en-us/azure/azure-functions/functions-versions) page.
2121

tests/endtoend/test_servicebus_functions.py

+6
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,16 @@
22
# Licensed under the MIT License.
33
import json
44
import time
5+
from unittest import skipIf
56

7+
from azure_functions_worker.utils.common import is_envvar_true
68
from tests.utils import testutils
9+
from tests.utils.constants import DEDICATED_DOCKER_TEST, CONSUMPTION_DOCKER_TEST
710

811

12+
@skipIf(is_envvar_true(DEDICATED_DOCKER_TEST)
13+
or is_envvar_true(CONSUMPTION_DOCKER_TEST),
14+
"Skipping SB tests till docker image is updated with host 4.33")
915
class TestServiceBusFunctions(testutils.WebHostTestCase):
1016

1117
@classmethod

tests/utils/testutils_lc.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
_FUNC_GITHUB_ZIP = "https://github.com/Azure/azure-functions-python-library" \
3232
"/archive/refs/heads/dev.zip"
3333
_FUNC_FILE_NAME = "azure-functions-python-library-dev"
34+
_CUSTOM_IMAGE = "CUSTOM_IMAGE"
3435

3536

3637
class LinuxConsumptionWebHostController:
@@ -277,8 +278,9 @@ def _encrypt_context(cls, encryption_key: str, plain_text: str) -> str:
277278
return f'{iv_base64}.{encrypted_base64}.{key_sha256_base64}'
278279

279280
def __enter__(self):
280-
mesh_image = self._find_latest_mesh_image(self._host_version,
281-
self._py_version)
281+
mesh_image = os.environ.get(_CUSTOM_IMAGE,
282+
self._find_latest_mesh_image(self._host_version,
283+
self._py_version))
282284
self.spawn_container(image=mesh_image)
283285
return self
284286

0 commit comments

Comments
 (0)