Skip to content

Docker tests updates #1457

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions .github/workflows/ci_consumption_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@ name: CI Consumption E2E tests

on:
workflow_dispatch:
inputs:
custom_image:
description: "Use a custom image to run consumption tests"
required: false
push:
branches: [ dev, master, main, release/* ]
branches: [ dev, main, release/* ]
pull_request:
branches: [ dev, master, main, release/* ]
branches: [ dev, main, release/* ]

jobs:
build:
Expand All @@ -35,24 +39,29 @@ jobs:
if: matrix.python-version == 3.7
env:
AzureWebJobsStorage: ${{ secrets.LinuxStorageConnectionString37 }}
CUSTOM_IMAGE: ${{ github.event.inputs.custom_image }}
run: python -m pytest -n auto --dist loadfile -vv --reruns 4 --instafail tests/consumption_tests
- name: Running 3.8 Tests
if: matrix.python-version == 3.8
env:
AzureWebJobsStorage: ${{ secrets.LinuxStorageConnectionString38 }}
CUSTOM_IMAGE: ${{ github.event.inputs.custom_image }}
run: python -m pytest -n auto --dist loadfile -vv --reruns 4 --instafail tests/consumption_tests
- name: Running 3.9 Tests
if: matrix.python-version == 3.9
env:
AzureWebJobsStorage: ${{ secrets.LinuxStorageConnectionString39 }}
CUSTOM_IMAGE: ${{ github.event.inputs.custom_image }}
run: python -m pytest -n auto --dist loadfile -vv --reruns 4 --instafail tests/consumption_tests
- name: Running 3.10 Tests
if: matrix.python-version == 3.10
env:
AzureWebJobsStorage: ${{ secrets.LinuxStorageConnectionString310 }}
CUSTOM_IMAGE: ${{ github.event.inputs.custom_image }}
run: python -m pytest -n auto --dist loadfile -vv --reruns 4 --instafail tests/consumption_tests
- name: Running 3.11 Tests
if: matrix.python-version == 3.11
env:
AzureWebJobsStorage: ${{ secrets.LinuxStorageConnectionString311 }}
CUSTOM_IMAGE: ${{ github.event.inputs.custom_image }}
run: python -m pytest -n auto --dist loadfile -vv --reruns 4 --instafail tests/consumption_tests
6 changes: 2 additions & 4 deletions .github/workflows/ci_docker_con_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ name: CI Docker Consumption tests
on:
workflow_dispatch:
schedule:
# Monday to Thursday 2 AM PDT build
# * is a special character in YAML so you have to quote this string
- cron: "0 9 * * *"
# Run everyday at 5 AM CST
- cron: "0 10 * * *"

jobs:
build:
Expand All @@ -30,7 +29,6 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install -U -e .[dev]
python setup.py build
- name: Running 3.7 Tests
if: matrix.python-version == 3.7
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_docker_custom_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
python-version: ${{ env.python_version }}
- name: Install dependencies
run: |
python -m pip install -U -e .[dev]
python setup.py build
- name: Running 3.7 Tests
if: env.python_version == 3.7
env:
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/ci_docker_ded_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ name: CI Docker Dedicated tests
on:
workflow_dispatch:
schedule:
# Monday to Thursday 1 AM PDT build
# * is a special character in YAML so you have to quote this string
- cron: "0 8 * * *"
# Run everyday at 4 AM CST
- cron: "0 9 * * *"

jobs:
build:
Expand All @@ -30,7 +29,6 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install -U -e .[dev]
python setup.py build
- name: Running 3.7 Tests
if: matrix.python-version == 3.7
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci_e2e_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ on:
required: false
default: "false"
push:
branches: [dev, master, main, release/*]
branches: [dev, main, release/*]
pull_request:
branches: [dev, master, main, release/*]
branches: [dev, main, release/*]
schedule:
# Monday to Thursday 1 AM PDT build
# * is a special character in YAML so you have to quote this string
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_ut_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:
- cron: "0 8 * * 1,2,3,4"
push:
pull_request:
branches: [ dev, master, main, release/* ]
branches: [ dev, main, release/* ]

jobs:
build:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ What are the supported Python versions?
|----------------------------------|------------|------------|------------|------------|-------------|-------------|
| Azure Functions 2.0 (deprecated) | ✔ | ✔ | - | - | - | - |
| Azure Functions 3.0 (deprecated) | ✔ | ✔ | ✔ | ✔ | - | - |
| Azure Functions 4.0 | - | | ✔ | ✔ | ✔ | coming soon |
| Azure Functions 4.0 | - | - | ✔ | ✔ | ✔ | ✔ |

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.

Expand Down
6 changes: 6 additions & 0 deletions tests/endtoend/test_servicebus_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@
# Licensed under the MIT License.
import json
import time
from unittest import skipIf

from azure_functions_worker.utils.common import is_envvar_true
from tests.utils import testutils
from tests.utils.constants import DEDICATED_DOCKER_TEST, CONSUMPTION_DOCKER_TEST


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

@classmethod
Expand Down
6 changes: 4 additions & 2 deletions tests/utils/testutils_lc.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
_FUNC_GITHUB_ZIP = "https://github.com/Azure/azure-functions-python-library" \
"/archive/refs/heads/dev.zip"
_FUNC_FILE_NAME = "azure-functions-python-library-dev"
_CUSTOM_IMAGE = "CUSTOM_IMAGE"


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

def __enter__(self):
mesh_image = self._find_latest_mesh_image(self._host_version,
self._py_version)
mesh_image = os.environ.get(_CUSTOM_IMAGE,
self._find_latest_mesh_image(self._host_version,
self._py_version))
self.spawn_container(image=mesh_image)
return self

Expand Down
Loading