Skip to content

Commit

Permalink
Merge branch 'main' into ci/use-ansys-action-pr-title
Browse files Browse the repository at this point in the history
  • Loading branch information
SMoraisAnsys authored Jan 13, 2025
2 parents 59b7733 + 7bef7c3 commit 0df09ed
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 15 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ jobs:
name: Test dotnet (linux)
runs-on: [ Linux, self-hosted, toolkits ]
env:
ANSYSEM_ROOT242: '/ansys_inc/AnsysEM/v242/Linux64'
ANSYSEM_ROOT242: '/opt/AnsysEM/v242/Linux64'
ANS_NODEPCHECK: '1'
steps:
- name: "Install Git and clone project"
Expand All @@ -153,7 +153,7 @@ jobs:
- name: "Install os packages"
run: |
sudo apt update
sudo apt install libgl1-mesa-glx xvfb
sudo apt install libgl1-mesa-glx xvfb -y
- name: Create Python venv
run: |
Expand All @@ -174,8 +174,9 @@ jobs:
with:
max_attempts: 3
retry_on: error
timeout_minutes: 20
timeout_minutes: 40
command: |
export LD_LIBRARY_PATH=${{ env.ANSYSEM_ROOT242 }}/common/mono/Linux64/lib64:$LD_LIBRARY_PATH
. .venv/bin/activate
xvfb-run pytest -m "legacy" -n auto --dist loadfile -v --cov
Expand Down
20 changes: 10 additions & 10 deletions src/pyedb/generic/process.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os.path
import subprocess

from pyedb.generic.general_methods import env_path, is_linux
from pyedb.generic.general_methods import env_path, is_linux, is_windows


class SiwaveSolve(object):
Expand Down Expand Up @@ -144,19 +144,19 @@ def export_3d_cad(
f.write("oDoc.ScrExport3DModel('{}', q3d_filename)\n".format(format_3d))
f.write("oDoc.ScrCloseProject()\n")
f.write("oApp.Quit()\n")
if is_linux:
_exe = '"' + os.path.join(self.installer_path, "siwave") + '"'
else:
_exe = '"' + os.path.join(self.installer_path, "siwave.exe") + '"'
_exe = os.path.join(self.installer_path, "siwave")
if is_windows:
_exe += ".exe"
command = [_exe]
if hidden:
command.append("-embedding")
command.append("-RunScriptAndExit")
command.append(scriptname)
command += ["-RunScriptAndExit", scriptname]
print(command)
os.system(" ".join(command))
# p1 = subprocess.call(" ".join(command))
# p1.wait()
try:
result = subprocess.run(command, check=True, capture_output=True)
print(result.stdout.decode())
except subprocess.CalledProcessError as e:
print(f"Error occurred: {e.stderr.decode()}")
return os.path.join(output_folder, aedt_file_name)

def export_dc_report(
Expand Down
15 changes: 13 additions & 2 deletions tests/legacy/system/test_edb.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@

pytestmark = [pytest.mark.system, pytest.mark.legacy]

ON_CI = os.environ.get("CI", "false").lower() == "true"


class TestClass:
@pytest.fixture(autouse=True)
Expand Down Expand Up @@ -410,6 +412,9 @@ def test_create_custom_cutout_4(self):
# assert edb.active_layout
# edb.close()

@pytest.mark.skipif(
is_linux and ON_CI, reason="Test is slow due to software rendering fallback and lack of GPU acceleration."
)
def test_export_to_hfss(self):
"""Export EDB to HFSS."""
edb = Edb(
Expand All @@ -419,10 +424,13 @@ def test_export_to_hfss(self):
options_config = {"UNITE_NETS": 1, "LAUNCH_Q3D": 0}
out = edb.write_export3d_option_config_file(self.local_scratch.path, options_config)
assert os.path.exists(out)
out = edb.export_hfss(self.local_scratch.path)
out = edb.export_hfss(self.local_scratch.path, hidden=True)
assert os.path.exists(out)
edb.close()

@pytest.mark.skipif(
is_linux and ON_CI, reason="Test is slow due to software rendering fallback and lack of GPU acceleration."
)
def test_export_to_q3d(self):
"""Export EDB to Q3D."""
edb = Edb(
Expand All @@ -436,7 +444,10 @@ def test_export_to_q3d(self):
assert os.path.exists(out)
edb.close()

def test_074_export_to_maxwell(self):
@pytest.mark.skipif(
is_linux and ON_CI, reason="Test is slow due to software rendering fallback and lack of GPU acceleration."
)
def test_export_to_maxwell(self):
"""Export EDB to Maxwell 3D."""
edb = Edb(
edbpath=os.path.join(local_path, "example_models", test_subfolder, "simple.aedb"),
Expand Down

0 comments on commit 0df09ed

Please sign in to comment.