diff --git a/eng/ci/official-build.yml b/eng/ci/official-build.yml index 3a81dc31..ea6400a5 100644 --- a/eng/ci/official-build.yml +++ b/eng/ci/official-build.yml @@ -60,6 +60,14 @@ extends: dependsOn: Build jobs: - template: /eng/templates/jobs/ci-unit-tests.yml@self + - stage: RunDockerConsumptionTests + dependsOn: Build + jobs: + - template: /eng/templates/official/jobs/ci-docker-consumption-tests.yml@self + - stage: RunDockerDedicatedTests + dependsOn: Build + jobs: + - template: /eng/templates/official/jobs/ci-docker-dedicated-tests.yml@self - stage: RunLinuxConsumptionTests dependsOn: Build jobs: diff --git a/tests/endtoend/test_worker_process_count_functions.py b/tests/endtoend/test_worker_process_count_functions.py index 8ee6577b..be61c43e 100644 --- a/tests/endtoend/test_worker_process_count_functions.py +++ b/tests/endtoend/test_worker_process_count_functions.py @@ -1,12 +1,19 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import os +import unittest + from datetime import datetime from threading import Thread from tests.utils import testutils +from azure_functions_worker.utils.common import is_envvar_true +from tests.utils.constants import CONSUMPTION_DOCKER_TEST, DEDICATED_DOCKER_TEST +@unittest.skipIf(is_envvar_true(DEDICATED_DOCKER_TEST) + or is_envvar_true(CONSUMPTION_DOCKER_TEST), + "Tests are flaky when running on Docker") class TestWorkerProcessCount(testutils.WebHostTestCase): """Test the Http Trigger with setting up the python worker process count to 2. this test will check if both requests should be processed at the @@ -63,24 +70,30 @@ def http_req(res_num): self.assertTrue(time_diff_in_seconds < 1) +@unittest.skipIf(is_envvar_true(DEDICATED_DOCKER_TEST) + or is_envvar_true(CONSUMPTION_DOCKER_TEST), + "Tests are flaky when running on Docker") class TestWorkerProcessCountStein(TestWorkerProcessCount): - @classmethod def get_script_dir(cls): return testutils.E2E_TESTS_FOLDER / 'http_functions' /\ 'http_functions_stein' +@unittest.skipIf(is_envvar_true(DEDICATED_DOCKER_TEST) + or is_envvar_true(CONSUMPTION_DOCKER_TEST), + "Tests are flaky when running on Docker") class TestWorkerProcessCountWithBlueprintStein(TestWorkerProcessCount): - @classmethod def get_script_dir(cls): return testutils.E2E_TESTS_FOLDER / 'blueprint_functions' /\ 'functions_in_blueprint_only' +@unittest.skipIf(is_envvar_true(DEDICATED_DOCKER_TEST) + or is_envvar_true(CONSUMPTION_DOCKER_TEST), + "Tests are flaky when running on Docker") class TestWorkerProcessCountWithBlueprintDiffDirStein(TestWorkerProcessCount): - @classmethod def get_script_dir(cls): return testutils.E2E_TESTS_FOLDER / 'blueprint_functions' /\ diff --git a/tests/extension_tests/http_v2_tests/test_http_v2.py b/tests/extension_tests/http_v2_tests/test_http_v2.py index 8409b7e5..e44d7227 100644 --- a/tests/extension_tests/http_v2_tests/test_http_v2.py +++ b/tests/extension_tests/http_v2_tests/test_http_v2.py @@ -9,11 +9,15 @@ import requests from tests.utils import testutils +from azure_functions_worker.utils.common import is_envvar_true +from tests.utils.constants import CONSUMPTION_DOCKER_TEST,DEDICATED_DOCKER_TEST from azure_functions_worker.constants import PYTHON_ENABLE_INIT_INDEXING REQUEST_TIMEOUT_SEC = 5 - +@unittest.skipIf(is_envvar_true(DEDICATED_DOCKER_TEST) + or is_envvar_true(CONSUMPTION_DOCKER_TEST), + "Tests are flaky when running on Docker") @unittest.skipIf(sys.version_info.minor < 8, "HTTPv2" "is only supported for 3.8+.") class TestHttpFunctionsWithInitIndexing(testutils.WebHostTestCase):