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
18 changes: 6 additions & 12 deletions .github/workflows/nightly-test-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,25 +112,19 @@ jobs:
PYFLUENT_START_INSTANCE: 0
FLUENT_IMAGE_TAG: v22.2.0

- name: Upload 22.2 Coverage Results to Codecov
uses: codecov/codecov-action@v3
with:
root_dir: ${{ github.workspace }}
name: cov_xml.xml

- name: Upload 22.2 Coverage Artifacts
uses: actions/upload-artifact@v3
with:
name: cov_xml.xml
path: ./cov_xml.xml

- name: 23.1 Unit Testing
run: make unittest-all-231
env:
ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER) }}
PYFLUENT_START_INSTANCE: 0
FLUENT_IMAGE_TAG: v23.1.0

- name: Upload 23.1 Coverage Artifacts
uses: actions/upload-artifact@v3
with:
name: cov_xml.xml
path: ./cov_xml.xml

- name: 23.2 Unit Testing
run: make unittest-all-232
env:
Expand Down
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,35 +22,35 @@ unittest: unittest-dev-231
unittest-dev-222:
@echo "Running unittests"
@pip install -r requirements/requirements_tests.txt
@python -m pytest -v -m "dev and not fluent_231 and not fluent_232" --cov=ansys.fluent --cov-report=xml:cov_xml.xml --cov-report=html --cov-config=.coveragerc
@python -m pytest -v -m "dev and fluent_222" --cov=ansys.fluent --cov-report=xml:cov_xml.xml --cov-report=html --cov-config=.coveragerc

unittest-dev-231:
@echo "Running unittests"
@pip install -r requirements/requirements_tests.txt
@python -m pytest -v -m "dev and not fluent_222 and not fluent_232" --cov=ansys.fluent --cov-report=xml:cov_xml.xml --cov-report=html --cov-config=.coveragerc
@python -m pytest -v -m "dev and fluent_231" --cov=ansys.fluent --cov-report=xml:cov_xml.xml --cov-report=html --cov-config=.coveragerc

unittest-dev-232:
@echo "Running unittests"
@pip install -r requirements/requirements_tests.txt
@python -m pytest -v -m "dev and not fluent_222 and not fluent_231" --cov=ansys.fluent --cov-report=xml:cov_xml.xml --cov-report=html --cov-config=.coveragerc
@python -m pytest -v -m "dev and fluent_232" --cov=ansys.fluent --cov-report=xml:cov_xml.xml --cov-report=html --cov-config=.coveragerc

unittest-all-222:
@sudo rm -rf /home/ansys/.local/share/ansys_fluent_core/examples/*
@echo "Running all unittests"
@pip install -r requirements/requirements_tests.txt
@python -m pytest -v -m "not fluent_231 and not fluent_232" --cov=ansys.fluent --cov-report=xml:cov_xml.xml --cov-report=html --cov-config=.coveragerc --durations=0
@python -m pytest -v -m "fluent_222" --cov=ansys.fluent --cov-report=xml:cov_xml.xml --cov-report=html --cov-config=.coveragerc --durations=0

unittest-all-231:
@sudo rm -rf /home/ansys/.local/share/ansys_fluent_core/examples/*
@echo "Running all unittests"
@pip install -r requirements/requirements_tests.txt
@python -m pytest -v -m "not fluent_222 and not fluent_232" --cov=ansys.fluent --cov-report=xml:cov_xml.xml --cov-report=html --cov-config=.coveragerc --durations=0
@python -m pytest -v -m "fluent_231" --cov=ansys.fluent --cov-report=xml:cov_xml.xml --cov-report=html --cov-config=.coveragerc --durations=0

unittest-all-232:
@sudo rm -rf /home/ansys/.local/share/ansys_fluent_core/examples/*
@echo "Running all unittests"
@pip install -r requirements/requirements_tests.txt
@python -m pytest -v -m "not fluent_222 and not fluent_231" --cov=ansys.fluent --cov-report=xml:cov_xml.xml --cov-report=html --cov-config=.coveragerc --durations=0
@python -m pytest -v -m "fluent_232" --cov=ansys.fluent --cov-report=xml:cov_xml.xml --cov-report=html --cov-config=.coveragerc --durations=0

api-codegen:
@echo "Running API codegen"
Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ requires = [


[tool.pytest.ini_options]
tespaths = ["tests"]
testpaths = ["tests"]
addopts = "--ignore-glob=tests/test_pro/* --ignore-glob=tests/test_datamodel_server/*"
markers = [
"integration: Short-running tests which read a simple input file and check the exposure and values of various setting objects",
Expand All @@ -18,9 +18,9 @@ markers = [
"optislang: Test Optislang integration scenarios",
"dev: Tests that must be successful before PR merge, includes unmarked tests",
"nightly: Tests that run under nightly CI",
"fluent_222: Tests that run only with Fluent 22.2",
"fluent_231: Tests that run only with Fluent 23.1",
"fluent_232: Tests that run only with Fluent 23.2",
"fluent_222: Tests that run with Fluent 22.2",
"fluent_231: Tests that run with Fluent 23.1",
"fluent_232: Tests that run with Fluent 23.2",
]


Expand Down
9 changes: 8 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,16 @@


def pytest_collection_modifyitems(items, config):
version_markers = ["fluent_222", "fluent_231", "fluent_232"]
for item in items:
if not any(item.iter_markers()):
markers = [x.name for x in item.iter_markers()]
# If no markers are defined add "dev" marker
if not any(markers):
item.add_marker("dev")
# If no version markers are defined, run it for all versions
if not any(x for x in version_markers if x in markers):
for m in version_markers:
item.add_marker(m)


@pytest.fixture
Expand Down