Skip to content

Commit

Permalink
Actually handle missing config file now
Browse files Browse the repository at this point in the history
  • Loading branch information
Myoldmopar committed Apr 24, 2024
1 parent 95e8e61 commit fa47f2f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/linux_release.yml
Expand Up @@ -158,8 +158,5 @@ jobs:
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3

- name: Add Package Test Dir to PYTHONPATH
run: echo "PYTHONPATH=checkout/scripts/package_tests" >> $GITHUB_ENV

- name: Run Package Tests
run: python checkout/scripts/package_tests/runner.py --verbose ${{ matrix.test_key }} package/
19 changes: 9 additions & 10 deletions scripts/package_tests/ep_testing/tests/api.py
Expand Up @@ -61,7 +61,6 @@
from tempfile import mkdtemp, mkstemp
from typing import List

from ep_testing.config import OS
from ep_testing.tests.base import BaseTest


Expand Down Expand Up @@ -129,9 +128,9 @@ def run(self, install_root: str, verbose: bool, kwargs: dict):
# py = 'C:\\Python36\\Python.exe'
py = sys.executable
my_env = os.environ.copy()
if self.os == OS.Windows: # my local comp didn't have cmake in path except in interact shells
if platform.system() == 'Windows': # my local comp didn't have cmake in path except in interact shells
my_env["PATH"] = install_root + ";" + my_env["PATH"]
if self.os == OS.Mac:
if platform.system() == 'Darwin':
# while it runs OK locally, for some reason on GHA, running a Plugin file from the Python API seg-faults
idf_to_run = os.path.join(install_root, 'ExampleFiles', '1ZoneUncontrolled.idf')
else:
Expand All @@ -143,14 +142,14 @@ def run(self, install_root: str, verbose: bool, kwargs: dict):
raise e


def make_build_dir_and_build(cmake_build_dir: str, verbose: bool, this_os: int, bitness: str, msvc_version: int):
def make_build_dir_and_build(cmake_build_dir: str, verbose: bool, bitness: str, msvc_version: int):
try:
os.makedirs(cmake_build_dir)
my_env = os.environ.copy()
if this_os == OS.Mac: # my local comp didn't have cmake in path except in interact shells
if platform.system() == 'Darwin': # my local comp didn't have cmake in path except in interact shells
my_env["PATH"] = "/usr/local/bin:" + my_env["PATH"]
command_line = ['cmake', '..']
if this_os == OS.Windows:
if platform.system() == 'Windows':
if bitness not in ['x32', 'x64']:
raise Exception('Bad bitness sent to make_build_dir_and_build, should be x32 or x64')
if msvc_version == 15:
Expand Down Expand Up @@ -248,10 +247,10 @@ def run(self, install_root: str, verbose: bool, kwargs: dict):
f.write(self._api_fixup_content())
print(' [FIXUP CMAKE WRITTEN] ', end='')
cmake_build_dir = os.path.join(build_dir, 'build')
make_build_dir_and_build(cmake_build_dir, self.verbose, self.os, self.bitness, self.msvc_version)
make_build_dir_and_build(cmake_build_dir, self.verbose, self.bitness, self.msvc_version)
try:
new_binary_path = os.path.join(cmake_build_dir, self.target_name)
if self.os == OS.Windows: # override the path/name for Windows
if platform.system() == 'Windows': # override the path/name for Windows
new_binary_path = os.path.join(cmake_build_dir, 'Release', self.target_name + '.exe')
command_line = [new_binary_path]
my_check_call(self.verbose, command_line, cwd=install_root)
Expand Down Expand Up @@ -323,13 +322,13 @@ def run(self, install_root: str, verbose: bool, kwargs: dict):
f.write(self._api_cmakelists_content())
print(' [CMAKE FILE WRITTEN] ', end='')
cmake_build_dir = os.path.join(build_dir, 'build')
make_build_dir_and_build(cmake_build_dir, self.verbose, self.os, self.bitness, self.msvc_version)
make_build_dir_and_build(cmake_build_dir, self.verbose, self.bitness, self.msvc_version)
if platform.system() == 'Windows':
built_binary_path = os.path.join(cmake_build_dir, 'Release', 'TestCAPIAccess')
else:
built_binary_path = os.path.join(cmake_build_dir, 'TestCAPIAccess')
my_env = os.environ.copy()
if self.os == OS.Windows: # my local comp didn't have cmake in path except in interact shells
if platform.system() == 'Windows': # my local comp didn't have cmake in path except in interact shells
my_env["PATH"] = install_root + ";" + my_env["PATH"]
try:
my_check_call(self.verbose, [built_binary_path], env=my_env)
Expand Down

0 comments on commit fa47f2f

Please sign in to comment.