Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
162 changes: 81 additions & 81 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -979,86 +979,86 @@ jobs:
path: junit/test-results.xml
if: ${{ always() }}

# # =================================================================================================
# # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
# # =================================================================================================

# system-tests-flaky-linux:
# name: Test flaky (linux)
# if: github.event.pull_request.draft == false
# needs: [integration-tests]
# runs-on: [ self-hosted, Linux, pyaedt ]
# env:
# ANSYSEM_ROOT252: '/usr/ansys_inc/v252/AnsysEM'
# ANS_NODEPCHECK: '1'
# steps:
# - name: Install Git and checkout project
# uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
# with:
# persist-credentials: false

# - name: Setup Python
# uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
# with:
# python-version: ${{ env.MAIN_PYTHON_VERSION }}

# - name: Create virtual environment
# env:
# ANSYSEM: ${{ env.ANSYSEM_ROOT252 }}
# run: |
# export LD_LIBRARY_PATH="${ANSYSEM}/common/mono/Linux64/lib64${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
# python -m venv .venv
# source .venv/bin/activate
# python -m pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org pip -U
# python -m pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org wheel setuptools -U
# python -c "import sys; print(sys.executable)"

# - name: Install pyaedt and tests dependencies
# env:
# ANSYSEM: ${{ env.ANSYSEM_ROOT252 }}
# run: |
# export LD_LIBRARY_PATH="${ANSYSEM}/common/mono/Linux64/lib64${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
# source .venv/bin/activate
# pip install .[tests]

# - name: "Install X Virtual Frame Buffer"
# run: |
# sudo apt-get update
# sudo apt-get install -y xvfb

# - name: Remove Ansys processes (if any)
# shell: bash
# run: |
# for pid in $(ps -eo pid,comm,args | grep -iE "ansys.inc|ansysem" | grep -v grep | awk '{print $1}'); do
# echo "Killing PID $pid"
# kill -9 "$pid"
# done

# - name: Run tests marked with 'flaky'
# env:
# ANSYSEM: ${{ env.ANSYSEM_ROOT252 }}
# uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
# with:
# max_attempts: 2
# retry_on: error
# timeout_minutes: 120
# command: |
# export LD_LIBRARY_PATH="${ANSYSEM}/common/mono/Linux64/lib64${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
# source .venv/bin/activate
# xvfb-run pytest ${{ env.PYTEST_ARGUMENTS }} --timeout=600 -m flaky_linux

# - uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
# with:
# name: codecov-system-flaky-tests-linux
# files: ./coverage.xml
# flags: linux_system_flaky

# - name: Upload pytest test results
# uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
# with:
# name: pytest-flaky-linux
# path: junit/test-results.xml
# if: ${{ always() }}
# =================================================================================================
# vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
# =================================================================================================

system-tests-flaky-linux:
name: Test flaky (linux)
if: github.event.pull_request.draft == false
needs: [integration-tests]
runs-on: [ self-hosted, Linux, pyaedt ]
env:
ANSYSEM_ROOT252: '/usr/ansys_inc/v252/AnsysEM'
ANS_NODEPCHECK: '1'
steps:
- name: Install Git and checkout project
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false

- name: Setup Python
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}

- name: Create virtual environment
env:
ANSYSEM: ${{ env.ANSYSEM_ROOT252 }}
run: |
export LD_LIBRARY_PATH="${ANSYSEM}/common/mono/Linux64/lib64${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
python -m venv .venv
source .venv/bin/activate
python -m pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org pip -U
python -m pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org wheel setuptools -U
python -c "import sys; print(sys.executable)"

- name: Install pyaedt and tests dependencies
env:
ANSYSEM: ${{ env.ANSYSEM_ROOT252 }}
run: |
export LD_LIBRARY_PATH="${ANSYSEM}/common/mono/Linux64/lib64${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
source .venv/bin/activate
pip install .[tests]

- name: "Install X Virtual Frame Buffer"
run: |
sudo apt-get update
sudo apt-get install -y xvfb

- name: Remove Ansys processes (if any)
shell: bash
run: |
for pid in $(ps -eo pid,comm,args | grep -iE "ansys.inc|ansysem" | grep -v grep | awk '{print $1}'); do
echo "Killing PID $pid"
kill -9 "$pid"
done

- name: Run tests marked with 'flaky'
env:
ANSYSEM: ${{ env.ANSYSEM_ROOT252 }}
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
with:
max_attempts: 2
retry_on: error
timeout_minutes: 120
command: |
export LD_LIBRARY_PATH="${ANSYSEM}/common/mono/Linux64/lib64${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
source .venv/bin/activate
xvfb-run pytest ${{ env.PYTEST_ARGUMENTS }} --timeout=600 -m flaky_linux

- uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
with:
name: codecov-system-flaky-tests-linux
files: ./coverage.xml
flags: linux_system_flaky

- name: Upload pytest test results
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: pytest-flaky-linux
path: junit/test-results.xml
if: ${{ always() }}

package:
name: Package library
Expand All @@ -1072,7 +1072,7 @@ jobs:
system-tests-extensions-linux,
system-tests-filter-windows,
system-tests-emit-windows,
# system-tests-flaky-linux,
system-tests-flaky-linux,
doc-build]
runs-on: ubuntu-latest
permissions:
Expand Down
1 change: 1 addition & 0 deletions doc/changelog.d/6809.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Test_configure_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,15 @@ def apply_config_to_edb(self, config_path, test_folder=None):
selected_edb = self.selected_edb
settings.logger.info(f"target EDB: {selected_edb}")
app = Edb(edbpath=str(selected_edb), edbversion=self.aedt_info.version)
app.configuration.load(config_path)
app.configuration.run()

temp_dir = Path(tempfile.TemporaryDirectory(suffix=".ansys").name, dir=test_folder)
temp_dir.mkdir()

new_name = create_new_edb_name(Path(app.edbpath).stem) + ".aedb"
app.save_as(str(temp_dir / new_name))
app.configuration.load(config_path)
app.configuration.run()
app.save()
app.close()
return app.edbpath

Expand Down

This file was deleted.

Binary file not shown.
Binary file not shown.
5 changes: 2 additions & 3 deletions tests/system/extensions/test_configure_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
from ansys.aedt.core.extensions.hfss3dlayout.resources.configure_layout.master_ui import GUIDE_LINK
from ansys.aedt.core.extensions.hfss3dlayout.resources.configure_layout.master_ui import INTRO_LINK
from ansys.aedt.core.extensions.hfss3dlayout.resources.configure_layout.master_ui import ConfigureLayoutExtension
from ansys.aedt.core.extensions.hfss3dlayout.resources.configure_layout.template import SERDES_CONFIG
from ansys.aedt.core.internal.filesystem import Scratch


Expand Down Expand Up @@ -100,16 +99,16 @@ def test_get_active_db(extension_under_test, test_folder, add_app):
app.close_project(app.project_name)


@pytest.mark.flaky_linux
@patch(
"ansys.aedt.core.extensions.hfss3dlayout.configure_layout.ConfigureLayoutExtension.selected_edb",
new_callable=PropertyMock,
)
def test_apply_config_to_edb(mock_selected_edb, test_folder, extension_under_test):
mock_selected_edb.return_value = test_folder.copy_si_verse()
config_path = test_folder.path / "config.json"
data = {"general": {"anti_pads_always_on": True, "suppress_pads": True}}
with open(config_path, "w", encoding="utf-8") as f:
json.dump(SERDES_CONFIG, f, ensure_ascii=False, indent=4)
json.dump(data, f, ensure_ascii=False, indent=4)
assert extension_under_test.apply_config_to_edb(config_path)


Expand Down
9 changes: 7 additions & 2 deletions tests/system/extensions/test_export_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
# SOFTWARE.

import json
import os
from pathlib import Path

import pytest
Expand All @@ -33,8 +34,10 @@
from ansys.aedt.core.hfss3dlayout import Hfss3dLayout
from tests.conftest import config

AEDB_FILE_NAME = "ANSYS-HSD_V1"
TEST_SUBFOLDER = "T45"
is_linux = os.name == "posix"

AEDB_FILE_NAME = "Parametric_Microstrip_Simulation"
TEST_SUBFOLDER = "post_layout_design"
AEDT_FILE_PATH = Path(__file__).parent / "example_models" / TEST_SUBFOLDER / (AEDB_FILE_NAME + ".aedb")


Expand All @@ -46,6 +49,7 @@ def cleanup_files(*files):


@pytest.mark.flaky_linux
@pytest.mark.skipif(is_linux, reason="Lead to Python fatal error on Linux machines.")
def test_export_layout_all_options(add_app, local_scratch):
"""Test successful execution of export layout with all options enabled."""
data = ExportLayoutExtensionData(
Expand Down Expand Up @@ -94,6 +98,7 @@ def test_export_layout_all_options(add_app, local_scratch):


@pytest.mark.flaky_linux
@pytest.mark.skipif(is_linux, reason="Lead to Python fatal error on Linux machines.")
def test_export_layout_ipc_only(add_app, local_scratch):
"""Test export layout with only IPC2581 option enabled."""
data = ExportLayoutExtensionData(
Expand Down
4 changes: 2 additions & 2 deletions tests/system/extensions/test_post_layout_design.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def test_layout_design_toolkit_microvia(add_app, local_scratch):
file_path = Path(local_scratch.path) / "ANSYS-HSD_V1_microvia.aedb"

local_scratch.copyfolder(
Path(TESTS_EXTENSIONS_PATH) / "example_models" / "post_layout_design" / "ANSYS_SVP_V1_1_SFP.aedb",
Path(TESTS_EXTENSIONS_PATH) / "example_models" / "post_layout_design" / "Diff_Via.aedb",
file_path,
)

Expand All @@ -183,7 +183,7 @@ def test_layout_design_toolkit_microvia(add_app, local_scratch):

# Get valid padstack definition from the design
pedb = h3d.modeler.primitives.edb
available_padstacks = ["v40h20-1"]
available_padstacks = ["pad1"]
pedb.close()

# Skip test if no padstacks available
Expand Down
2 changes: 1 addition & 1 deletion tests/system/extensions/test_via_clustering.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
from tests import TESTS_EXTENSIONS_PATH


@pytest.mark.skipif(is_linux, reason="Not supported in Linux.")
@pytest.mark.flaky_linux
def test_via_clustering_main_function(local_scratch):
"""Test the main function of the Via Clustering extension."""
# Copy test model to scratch directory
Expand Down