Skip to content

Commit 9bd866c

Browse files
committed
ci: adding profiling to pytest
1 parent 36ab642 commit 9bd866c

File tree

5 files changed

+10
-1
lines changed

5 files changed

+10
-1
lines changed

.ci/collect_mapdl_logs_locals.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11

22
mkdir "$LOG_NAMES" && echo "Successfully generated directory $LOG_NAMES"
33

4+
echo "Copying the log files..."
45
cp *.log ./"$LOG_NAMES"/ || echo "No log files could be found"
56
cp *apdl.out ./"$LOG_NAMES"/ || echo "No APDL log files could be found"
67
cp *pymapdl.apdl ./"$LOG_NAMES"/ || echo "No PYMAPDL APDL log files could be found"
78

9+
echo "Copying the profiling files..."
10+
cp prof ./"$LOG_NAMES"/prof || echo "No profile files could be found"
11+
812

913
ls -la ./"$LOG_NAMES"
1014

.ci/collect_mapdl_logs_remote.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ echo "Copying docker launch log..."
3535
cp mapdl_launch_0.log ./"$LOG_NAMES"/mapdl_launch_0.log || echo "MAPDL launch docker log not found."
3636
cp mapdl_launch_1.log ./"$LOG_NAMES"/mapdl_launch_1.log || echo "MAPDL launch docker log not found."
3737

38+
echo "Copying the profiling files..."
39+
cp prof ./"$LOG_NAMES"/prof || echo "No profile files could be found"
40+
3841
echo "Collecting file structure..."
3942
ls -R > ./"$LOG_NAMES"/files_structure.txt || echo "Failed to copy file structure to a file"
4043

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ env:
3333
DPF_PORT: 21004
3434
MAPDL_PACKAGE: ghcr.io/ansys/mapdl
3535
ON_CI: True
36-
PYTEST_ARGUMENTS: '-vvv -rxXsa --color=yes --durations=10 --random-order --random-order-bucket=class --maxfail=10 --reruns 3 --reruns-delay 4 --cov=ansys.mapdl.core --cov-report=html --timeout=180'
36+
PYTEST_ARGUMENTS: '-vvv -rxXsa --color=yes --durations=30 --random-order --random-order-bucket=class --maxfail=10 --reruns 3 --reruns-delay 4 --cov=ansys.mapdl.core --cov-report=html --timeout=180 --profile-svg --profile'
3737

3838

3939
BUILD_CHEATSHEET: True

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ tests = [
6363
"pyfakefs==5.7.3",
6464
"pyiges[full]==0.3.1",
6565
"pytest-cov==6.0.0",
66+
"pytest-profiling==1.8.1",
6667
"pytest-pyvista==0.1.9",
6768
"pytest-random-order==1.1.1",
6869
"pytest-rerunfailures==15.0",

tests/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
# Setting testing environment
5858
# ---------------------------
5959
#
60+
pytest_plugins = ["pytest_profiling"]
6061

6162
DEBUG_TESTING = debug_testing()
6263
TESTING_MINIMAL = testing_minimal()

0 commit comments

Comments
 (0)