Skip to content
Merged
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
92 changes: 3 additions & 89 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ jobs:
PYTEST_ARGUMENTS: ${{ env.PYTEST_ARGUMENTS }}
run: |
source .venv/bin/activate
pytest ${PYTEST_ARGUMENTS} --timeout=600 -m "solvers and not flaky_linux"
pytest ${PYTEST_ARGUMENTS} --timeout=600 -m solvers


- uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
Expand Down Expand Up @@ -553,7 +553,7 @@ jobs:
timeout_minutes: 120
command: |
source .venv/bin/activate
pytest ${PYTEST_ARGUMENTS} -n 4 --dist loadfile --timeout=600 -m "general and not flaky_linux"
pytest ${PYTEST_ARGUMENTS} -n 4 --dist loadfile --timeout=600 -m general


- uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
Expand Down Expand Up @@ -1288,7 +1288,7 @@ jobs:
timeout_minutes: 120
command: |
source .venv/bin/activate
pytest ${PYTEST_ARGUMENTS} --timeout=600 -m "extensions and not flaky_linux"
pytest ${PYTEST_ARGUMENTS} --timeout=600 -m extensions

- uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
if: steps.changes.outputs.run_tests == 'true'
Expand Down Expand Up @@ -1545,91 +1545,6 @@ jobs:
name: pytest-emit-windows
path: junit/test-results.xml

# =================================================================================================
# 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@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
fetch-depth: 0

- name: Set up headless display
uses: pyvista/setup-headless-display-action@7d84ae825e6d9297a8e99bdbbae20d1b919a0b19 # v4.2

- name: Setup Python
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
with:
python-version: ${{ env.TESTS_VERSION }}

- name: Set up uv
uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
with:
enable-cache: false
prune-cache: true

- name: Create virtual environment
run: uv venv .venv

- name: Upgrade wheel and setuptools
run: |
source .venv/bin/activate
uv pip install -U wheel setuptools



- name: Install pyaedt and tests dependencies
run: |
source .venv/bin/activate
uv pip install .[tests]



- 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: |
source .venv/bin/activate
pytest ${PYTEST_ARGUMENTS} --timeout=600 -m flaky_linux



- uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
with:
name: codecov-system-flaky-tests-linux
files: ./coverage.xml
flags: linux_system_flaky

- name: Upload pytest test results
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: pytest-flaky-linux
path: junit/test-results.xml

package:
name: Package library
needs: [system-tests-solvers-windows,
Expand All @@ -1646,7 +1561,6 @@ jobs:
system-tests-extensions-linux,
system-tests-filter-windows,
system-tests-emit-windows,
system-tests-flaky-linux,
doc-build]
runs-on: ubuntu-latest
permissions:
Expand Down
83 changes: 1 addition & 82 deletions .github/workflows/manual_draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,6 @@ on:
options:
- 'yes'
- 'no'
test-flaky-linux:
description: "Testing Flaky (Linux)"
type: choice
default: 'no'
options:
- 'yes'
- 'no'
test-emit-windows:
description: "Testing Emit (Windows)"
default: 'no'
Expand Down Expand Up @@ -636,7 +629,7 @@ jobs:
command: |
export LD_LIBRARY_PATH="${ANSYSEM}/common/mono/Linux64/lib64${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
source .venv/bin/activate
pytest ${{ env.PYTEST_ARGUMENTS }} --timeout=600 -m "extensions and not flaky_linux"
pytest ${{ env.PYTEST_ARGUMENTS }} --timeout=600 -m extensions

- uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
with:
Expand All @@ -651,80 +644,6 @@ jobs:
path: junit/test-results.xml
if: ${{ always() }}

system-tests-flaky-linux:
name: Test flaky (linux)
if: github.event.inputs.test-flaky-linux == 'yes'

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@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false

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

- name: Create virtual environment
env:
ANSYSEM: ${{ env.ANSYSEM_ROOT252 }}
run: |
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: |
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@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
with:
name: codecov-system-flaky-tests-linux
files: ./coverage.xml
flags: linux_system_flaky

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

system-tests-emit-windows:
name: Test EMIT (windows)
Expand Down
78 changes: 1 addition & 77 deletions .github/workflows/nightly-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ jobs:
command: |
export LD_LIBRARY_PATH="${ANSYSEM}/common/mono/Linux64/lib64${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
source .venv/bin/activate
pytest ${{ env.PYTEST_ARGUMENTS }} --timeout=600 -m "extensions and not flaky_linux"
pytest ${{ env.PYTEST_ARGUMENTS }} --timeout=600 -m extensions

- uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
with:
Expand Down Expand Up @@ -316,79 +316,3 @@ jobs:
with:
name: pytest-emit-windows
path: junit/test-results.xml

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

system-tests-flaky-linux:
name: Test flaky (linux)
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@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false

- name: Set up headless display
uses: pyvista/setup-headless-display-action@7d84ae825e6d9297a8e99bdbbae20d1b919a0b19 # v4.2

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

- name: Set up uv
uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
with:
enable-cache: false
prune-cache: true

- name: Create virtual environment
run: uv venv .venv

- name: Upgrade wheel and setuptools
run: |
source .venv/bin/activate
uv pip install -U wheel setuptools

- name: Install pyaedt and tests dependencies
run: |
source .venv/bin/activate
uv pip install .[tests]

- 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
pytest ${{ env.PYTEST_ARGUMENTS }} --timeout=600 -m flaky_linux

- uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
with:
name: codecov-system-flaky-tests-linux
files: ./coverage.xml
flags: linux_system_flaky

- name: Upload pytest test results
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: pytest-flaky-linux
path: junit/test-results.xml
1 change: 1 addition & 0 deletions doc/changelog.d/7068.maintenance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Delete flaky tests
2 changes: 0 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,6 @@ markers = [
"extensions: mark a test as related to extensions.",
"filter_solutions: mark a test as related to filter solutions.",
"emit: mark a test as related to EMIT features.",
"flaky_linux: mark a test as flaky on Linux systems.",
"flaky_windows: mark a test as flaky on Windows systems.",
"avoid_ansys_load: mark a test that should avoid LD_LIBRARY_PATH modifications.",
]
filterwarnings = [
Expand Down
4 changes: 0 additions & 4 deletions tests/system/extensions/test_export_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ def cleanup_files(*files):
export_file.unlink()


@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_example, test_tmp_dir):
"""Test successful execution of export layout with all options enabled."""
Expand Down Expand Up @@ -90,7 +89,6 @@ def test_export_layout_all_options(add_app_example, test_tmp_dir):
assert isinstance(config_data, dict)


@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_example, test_tmp_dir):
"""Test export layout with only IPC2581 option enabled."""
Expand Down Expand Up @@ -158,7 +156,6 @@ def test_export_layout_bom_only(add_app_example, test_tmp_dir):
assert bom_file.stat().st_size > 0


@pytest.mark.flaky_linux
@pytest.mark.skipif(is_linux, reason="Lead to Python fatal error on Linux machines.")
def test_export_layout_config_only(add_app_example, test_tmp_dir):
"""Test export layout with only configuration option enabled."""
Expand Down Expand Up @@ -197,7 +194,6 @@ def test_export_layout_config_only(add_app_example, test_tmp_dir):
assert isinstance(config_data, dict)


@pytest.mark.flaky_linux
@pytest.mark.skipif(is_linux, reason="Lead to Python fatal error on Linux machines.")
def test_export_layout_no_options(add_app_example, test_tmp_dir):
"""Test export layout with all options disabled."""
Expand Down
1 change: 0 additions & 1 deletion tests/system/extensions/test_post_layout_design.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ def test_layout_design_toolkit_unknown_action(add_app_example):
h3d.close_project(save=False)


@pytest.mark.flaky_linux
def test_layout_design_toolkit_microvia(add_app_example):
"""Test microvia creation with conical shape."""
h3d = add_app_example(
Expand Down
1 change: 0 additions & 1 deletion tests/system/extensions/test_via_clustering.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
from tests import TESTS_EXTENSIONS_PATH


@pytest.mark.flaky_linux
def test_via_clustering_main_function(test_tmp_dir):
"""Test the main function of the Via Clustering extension."""
# Copy test model to scratch directory
Expand Down
2 changes: 0 additions & 2 deletions tests/system/solvers/sequential/test_circuit_netlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,13 @@ def netlist_test(add_app_example):
app.close_project(save=False)


@pytest.mark.flaky_linux
def test_post(netlist_test):
if NON_GRAPHICAL:
assert len(netlist_test.post.plots) == 0
else:
assert len(netlist_test.post.plots) == 1


@pytest.mark.flaky_linux
def test_browse_log_file(netlist_test, test_tmp_dir):
assert not netlist_test.browse_log_file()
netlist_test.analyze()
Expand Down
Loading