Skip to content

Commit

Permalink
ci: fix files names.
Browse files Browse the repository at this point in the history
  • Loading branch information
germa89 committed Dec 13, 2024
1 parent fc4b549 commit 30b5514
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 15 deletions.
6 changes: 0 additions & 6 deletions .ci/collect_mapdl_log_locals.sh

This file was deleted.

12 changes: 12 additions & 0 deletions .ci/collect_mapdl_logs_locals.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

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

cp *.log ./"$LOG_NAMES"/ || echo "No log files could be found"
cp apdl.out ./"$LOG_NAMES"/ || echo "No APDL log files could be found"
cp pymapdl.apdl ./"$LOG_NAMES"/ || echo "No PYMAPDL APDL log files could be found"


ls -la ./"$LOG_NAMES"

echo "Tar files..."
tar cvzf ./"$LOG_NAMES".tgz ./"$LOG_NAMES" || echo "Failed to compress"
File renamed without changes.
13 changes: 11 additions & 2 deletions .ci/display_logs_locals.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@

#####
# Displaying files
FILE_PAT=./"$LOG_NAMES"/pymapdl.log
FILE_DESCRIPTION="PyMAPDL log"

if compgen -G "$FILE_PAT" > /dev/null ;then for f in "$FILE_PAT"; do echo "::group:: $FILE_DESCRIPTION: $f" && cat "$f" && echo "::endgroup::" ; done; fi || echo "Failed to show $FILE_DESCRIPTION file"

#####
FILE_PAT=./"$LOG_NAMES"/pymapdl.apdl
FILE_DESCRIPTION="PyMAPDL APDL log"

if compgen -G "$FILE_PAT" > /dev/null ;then for f in "$FILE_PAT"; do echo "::group:: $FILE_DESCRIPTION: $f" && cat "$f" && echo "::endgroup::" ; done; fi || echo "Failed to show $FILE_DESCRIPTION file"

FILE_PAT=./"$LOG_NAMES"/pymapdl.log
FILE_DESCRIPTION="PyMAPDL log"
#####
FILE_PAT=./"$LOG_NAMES"/apdl.out
FILE_DESCRIPTION="MAPDL Output"

if compgen -G "$FILE_PAT" > /dev/null ;then for f in "$FILE_PAT"; do echo "::group:: $FILE_DESCRIPTION: $f" && cat "$f" && echo "::endgroup::" ; done; fi || echo "Failed to show $FILE_DESCRIPTION file"
File renamed without changes.
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ jobs:
MAPDL_INSTANCE: MAPDL_0
LOG_NAMES: logs-build-docs
run: |
.ci/collect_mapdl_logs.sh
.ci/collect_mapdl_logs_remote.sh
- name: "Upload logs to GitHub"
if: always()
Expand All @@ -352,7 +352,7 @@ jobs:
MAPDL_INSTANCE: MAPDL_0
LOG_NAMES: logs-build-docs
run: |
.ci/display_logs.sh
.ci/display_logs_remote.sh
build-test-remote-matrix:
name: "Build remote test matrix"
Expand Down Expand Up @@ -577,7 +577,7 @@ jobs:
MAPDL_INSTANCE: MAPDL_0
LOG_NAMES: logs-remote-${{ matrix.mapdl-version }}
run: |
.ci/collect_mapdl_logs.sh
.ci/collect_mapdl_logs_remote.sh
- name: "Upload logs to GitHub"
if: always()
Expand All @@ -592,7 +592,7 @@ jobs:
MAPDL_INSTANCE: MAPDL_0
LOG_NAMES: logs-remote-${{ matrix.mapdl-version }}
run: |
.ci/display_logs.sh
.ci/display_logs_remote.sh
build-test-local-minimal-matrix:
name: "Build test matrix for minimal and local"
Expand Down Expand Up @@ -719,7 +719,7 @@ jobs:
env:
LOG_NAMES: logs-local-${{ matrix.mapdl-version }}
run: |
.ci/collect_mapdl_log_locals.sh
.ci/collect_mapdl_logs_locals.sh
- name: "Upload logs to GitHub"
if: always()
Expand Down Expand Up @@ -877,7 +877,7 @@ jobs:
env:
LOG_NAMES: logs-minimal-${{ matrix.mapdl-version }}
run: |
.ci/collect_mapdl_log_locals.sh
.ci/collect_mapdl_logs_locals.sh
- name: "Upload logs to GitHub"
if: always()
Expand Down
9 changes: 8 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,13 @@ def requires_dependency(dependency: str):
from ansys.mapdl.core import LOG

LOG.setLevel("DEBUG")

# If the following file name is changed, update `ci.yml`.
LOG.log_to_file("pymapdl.log")

# the following files are also generated by MAPDL gRPC:
# - "pymapdl.apdl": The APDL commands sent to MAPDL by PyMAPDL
# - "apdl.out" : MAPDL console output. Very likely only contains the output until connected.
################################################################
#
# Importing packages
Expand Down Expand Up @@ -585,8 +590,10 @@ def mapdl(request, tmpdir_factory):
cleanup_on_exit=cleanup,
license_server_check=False,
start_timeout=50,
log_apdl="pymapdl.apdl" if DEBUG_TESTING else None,
loglevel="DEBUG" if DEBUG_TESTING else "ERROR",
# If the following file names are changed, update `ci.yml`.
log_apdl="pymapdl.apdl" if DEBUG_TESTING else None,
mapdl_output="apdl.out" if (DEBUG_TESTING and ON_LOCAL) else None,
)

mapdl._show_matplotlib_figures = False # CI: don't show matplotlib figures
Expand Down

0 comments on commit 30b5514

Please sign in to comment.