Skip to content

Conversation

@germa89
Copy link
Collaborator

@germa89 germa89 commented Aug 19, 2025

Description

Adding framework for testing MAPDL InProcess interface

Issue linked

NA

Checklist

Copilot AI review requested due to automatic review settings August 19, 2025 15:00
@germa89 germa89 requested a review from a team as a code owner August 19, 2025 15:00
@github-actions github-actions bot added the CI/CD Related with CICD, Github Actions, etc label Aug 19, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a testing framework for the MAPDL InProcess interface, which allows testing Python code execution within MAPDL. The framework provides a test runner that executes MAPDL commands in batch mode and validates Python command functionality.

  • Introduces MapdlInProcessRunner class for executing MAPDL commands with Python integration
  • Adds pytest fixture for InProcess testing with version and environment checks
  • Provides basic test cases to verify Python command execution within MAPDL

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@github-actions github-actions bot added CI/CD Related with CICD, Github Actions, etc and removed CI/CD Related with CICD, Github Actions, etc labels Aug 19, 2025
@codecov
Copy link

codecov bot commented Aug 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.66%. Comparing base (651042d) to head (57d685f).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4185      +/-   ##
==========================================
- Coverage   91.20%   87.66%   -3.54%     
==========================================
  Files         193      193              
  Lines       15719    15719              
==========================================
- Hits        14336    13780     -556     
- Misses       1383     1939     +556     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions github-actions bot added CI/CD Related with CICD, Github Actions, etc and removed CI/CD Related with CICD, Github Actions, etc labels Aug 19, 2025
@germa89
Copy link
Collaborator Author

germa89 commented Aug 19, 2025

@valallansys this should gives you a nice headstart for InProcess testing. It should be noticed that you should set the env variable TEST_INPROCESS to true.

@github-actions github-actions bot added CI/CD Related with CICD, Github Actions, etc and removed CI/CD Related with CICD, Github Actions, etc labels Aug 19, 2025
@github-actions github-actions bot added CI/CD Related with CICD, Github Actions, etc and removed CI/CD Related with CICD, Github Actions, etc labels Aug 19, 2025
@github-actions github-actions bot added CI/CD Related with CICD, Github Actions, etc and removed CI/CD Related with CICD, Github Actions, etc labels Aug 19, 2025
@github-actions github-actions bot added CI/CD Related with CICD, Github Actions, etc and removed CI/CD Related with CICD, Github Actions, etc labels Aug 19, 2025
@valallansys
Copy link
Contributor

Tests are failing on windows (locally). It seems to be an issue with the arguments given to subprocess.run. test_start_python_from_pymapdl is not failing @germa89 any ideas ?

This is corrected, tests are passing on both linux and windows. @germa89 would you like to try locally on macos ?

@germa89
Copy link
Collaborator Author

germa89 commented Sep 2, 2025

MacOS does not support MAPDL, so we do not have to test it.

What was the issue? I saw your last commit and I dont know if the error was comming from the MAPDL env var or from the additional switches...

@valallansys valallansys force-pushed the ci/adding-inprocess-testing branch from 5055eda to 9b326f0 Compare September 2, 2025 13:28
@github-actions github-actions bot added CI/CD Related with CICD, Github Actions, etc and removed CI/CD Related with CICD, Github Actions, etc labels Sep 2, 2025
@valallansys
Copy link
Contributor

MacOS does not support MAPDL, so we do not have to test it.

What was the issue? I saw your last commit and I dont know if the error was comming from the MAPDL env var or from the additional switches...

Deleting the additional switches was a mistake, the error came from the env argument. But we didn't need it as we set the en var in the init

@germa89
Copy link
Collaborator Author

germa89 commented Sep 29, 2025

@valallansys how are you doing with this? do you need any support?

@github-actions github-actions bot added CI/CD Related with CICD, Github Actions, etc and removed CI/CD Related with CICD, Github Actions, etc labels Sep 29, 2025
@valallansys
Copy link
Contributor

@germa89 The PR should be all good for merge

@valallansys
Copy link
Contributor

@germa89 The PR should be all good for merge

Good for me I meant, we still need someone to review and approve

@github-actions github-actions bot added CI/CD Related with CICD, Github Actions, etc and removed CI/CD Related with CICD, Github Actions, etc labels Oct 6, 2025
@github-actions github-actions bot added CI/CD Related with CICD, Github Actions, etc and removed CI/CD Related with CICD, Github Actions, etc labels Oct 8, 2025
@germa89
Copy link
Collaborator Author

germa89 commented Oct 8, 2025

@pyansys-ci-bot LGTM.

@germa89 germa89 enabled auto-merge (squash) October 8, 2025 15:33
@valallansys valallansys self-requested a review October 8, 2025 15:33
Copy link
Contributor

@pyansys-ci-bot pyansys-ci-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Approving this PR because germa89 said so in here 😬

LGTM

@germa89 germa89 merged commit 492b530 into main Oct 8, 2025
46 checks passed
@germa89 germa89 deleted the ci/adding-inprocess-testing branch October 8, 2025 15:35
clatapie pushed a commit that referenced this pull request Oct 14, 2025
* ci: add MapdlInProcessRunner and related tests for Python execution in MAPDL

* chore: adding changelog file 4185.miscellaneous.md [dependabot-skip]

* fix: remove redundant import of ON_LOCAL in test fixture

* fix: correct condition for skipping InProcess tests based on environment variable

* Update tests/test_inprocess.py

Co-authored-by: Copilot <[email protected]>

* fix: streamline subprocess execution in MapdlInProcessRunner

* fix: correct condition for skipping InProcess tests based on environment variable

* fix: add support for additional switches in subprocess execution

* fix: improve command execution in MapdlInProcessRunner and update test assertions

* fix: update skip message for InProcess tests to improve clarity

* fix: enhance MapdlInProcessRunner with virtual environment detection and output handling

* fix: enhance requirement checking and add virtual environment tests

* fix: keep only tests from mapdl, from pymapdl and check python path with fix without python env

* ci: auto fixes from pre-commit.com hooks.

for more information, see https://pre-commit.ci

* fix: update MapdlInProcessRunner to include version parameter and adjust environment handling

* fix: Set venv to the one we're using for pymapdl

* ci: auto fixes from pre-commit.com hooks.

for more information, see https://pre-commit.ci

* fix: add mapdl_inprocess parameter to test_start_python_from_pymapdl function to avoid running the function in MAPDL < 25.2

* chore: adding changelog file 4185.maintenance.md [dependabot-skip]

* fix: Test correction for Windows

* ci: auto fixes from pre-commit.com hooks.

for more information, see https://pre-commit.ci

---------

Co-authored-by: pyansys-ci-bot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: valallansys <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
clatapie pushed a commit that referenced this pull request Nov 18, 2025
* ci: add MapdlInProcessRunner and related tests for Python execution in MAPDL

* chore: adding changelog file 4185.miscellaneous.md [dependabot-skip]

* fix: remove redundant import of ON_LOCAL in test fixture

* fix: correct condition for skipping InProcess tests based on environment variable

* Update tests/test_inprocess.py

Co-authored-by: Copilot <[email protected]>

* fix: streamline subprocess execution in MapdlInProcessRunner

* fix: correct condition for skipping InProcess tests based on environment variable

* fix: add support for additional switches in subprocess execution

* fix: improve command execution in MapdlInProcessRunner and update test assertions

* fix: update skip message for InProcess tests to improve clarity

* fix: enhance MapdlInProcessRunner with virtual environment detection and output handling

* fix: enhance requirement checking and add virtual environment tests

* fix: keep only tests from mapdl, from pymapdl and check python path with fix without python env

* ci: auto fixes from pre-commit.com hooks.

for more information, see https://pre-commit.ci

* fix: update MapdlInProcessRunner to include version parameter and adjust environment handling

* fix: Set venv to the one we're using for pymapdl

* ci: auto fixes from pre-commit.com hooks.

for more information, see https://pre-commit.ci

* fix: add mapdl_inprocess parameter to test_start_python_from_pymapdl function to avoid running the function in MAPDL < 25.2

* chore: adding changelog file 4185.maintenance.md [dependabot-skip]

* fix: Test correction for Windows

* ci: auto fixes from pre-commit.com hooks.

for more information, see https://pre-commit.ci

---------

Co-authored-by: pyansys-ci-bot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: valallansys <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
clatapie pushed a commit that referenced this pull request Nov 21, 2025
* ci: add MapdlInProcessRunner and related tests for Python execution in MAPDL

* chore: adding changelog file 4185.miscellaneous.md [dependabot-skip]

* fix: remove redundant import of ON_LOCAL in test fixture

* fix: correct condition for skipping InProcess tests based on environment variable

* Update tests/test_inprocess.py

Co-authored-by: Copilot <[email protected]>

* fix: streamline subprocess execution in MapdlInProcessRunner

* fix: correct condition for skipping InProcess tests based on environment variable

* fix: add support for additional switches in subprocess execution

* fix: improve command execution in MapdlInProcessRunner and update test assertions

* fix: update skip message for InProcess tests to improve clarity

* fix: enhance MapdlInProcessRunner with virtual environment detection and output handling

* fix: enhance requirement checking and add virtual environment tests

* fix: keep only tests from mapdl, from pymapdl and check python path with fix without python env

* ci: auto fixes from pre-commit.com hooks.

for more information, see https://pre-commit.ci

* fix: update MapdlInProcessRunner to include version parameter and adjust environment handling

* fix: Set venv to the one we're using for pymapdl

* ci: auto fixes from pre-commit.com hooks.

for more information, see https://pre-commit.ci

* fix: add mapdl_inprocess parameter to test_start_python_from_pymapdl function to avoid running the function in MAPDL < 25.2

* chore: adding changelog file 4185.maintenance.md [dependabot-skip]

* fix: Test correction for Windows

* ci: auto fixes from pre-commit.com hooks.

for more information, see https://pre-commit.ci

---------

Co-authored-by: pyansys-ci-bot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: valallansys <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI/CD Related with CICD, Github Actions, etc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants