Skip to content

Commit 32c4545

Browse files
committed
Skipping installing extensions for unit tests
1 parent 222efff commit 32c4545

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

.github/workflows/ci_ut_workflow.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ jobs:
6262
6363
# Retry a couple times to avoid certificate issue
6464
retry 5 python setup.py build
65-
retry 5 python setup.py extension
6665
retry 5 python setup.py webhost --branch-name=dev
6766
mkdir logs
6867
- name: Test with pytest

tests/utils/testutils.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ def docker_tests_enabled(self) -> (bool, str):
209209
@classmethod
210210
def setUpClass(cls):
211211
script_dir = pathlib.Path(cls.get_script_dir())
212+
is_unit_test = True if 'unittests' in script_dir.parts else False
212213

213214
docker_tests_enabled, sku = cls.docker_tests_enabled()
214215

@@ -228,7 +229,7 @@ def setUpClass(cls):
228229
cls.webhost = \
229230
WebHostDedicated(docker_configs).spawn_container()
230231
else:
231-
_setup_func_app(TESTS_ROOT / script_dir)
232+
_setup_func_app(TESTS_ROOT / script_dir, is_unit_test)
232233
try:
233234
cls.webhost = start_webhost(script_dir=script_dir,
234235
stdout=cls.host_stdout)
@@ -1014,7 +1015,7 @@ def _symlink_dir(src, dst):
10141015
dst.symlink_to(src, target_is_directory=True)
10151016

10161017

1017-
def _setup_func_app(app_root):
1018+
def _setup_func_app(app_root, is_unit_test):
10181019
extensions = app_root / 'bin'
10191020
host_json = app_root / 'host.json'
10201021
extensions_csproj_file = app_root / 'extensions.csproj'
@@ -1023,11 +1024,11 @@ def _setup_func_app(app_root):
10231024
with open(host_json, 'w') as f:
10241025
f.write(HOST_JSON_TEMPLATE)
10251026

1026-
if not os.path.isfile(extensions_csproj_file):
1027+
if not os.path.isfile(extensions_csproj_file) and not is_unit_test:
10271028
with open(extensions_csproj_file, 'w') as f:
10281029
f.write(AZURE_EXTENSIONS)
10291030

1030-
_symlink_dir(EXTENSIONS_PATH, extensions)
1031+
_symlink_dir(EXTENSIONS_PATH, extensions)
10311032

10321033

10331034
def _teardown_func_app(app_root):

0 commit comments

Comments
 (0)