Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CHORE: refacto maxwell test #5601

Open
wants to merge 36 commits into
base: main
Choose a base branch
from
Open

CHORE: refacto maxwell test #5601

wants to merge 36 commits into from

Conversation

gmalinve
Copy link
Contributor

Description

Please provide a brief description of the changes made in this pull request.

Issue linked

Please mention the issue number or describe the problem this pull request addresses.

Checklist

  • I have tested my changes locally.
  • I have added necessary documentation or updated existing documentation.
  • I have followed the coding style guidelines of this project.
  • I have added appropriate tests (unit, integration, system).
  • I have reviewed my changes before submitting this pull request.
  • I have linked the issue or issues that are solved by the PR if any.
  • I have agreed with the Contributor License Agreement (CLA).

@gmalinve gmalinve self-assigned this Dec 20, 2024
@ansys-reviewer-bot
Copy link
Contributor

Thanks for opening a Pull Request. If you want to perform a review write a comment saying:

@ansys-reviewer-bot review

@github-actions github-actions bot added the testing Anything related to testing label Dec 20, 2024
@gmalinve gmalinve linked an issue Dec 20, 2024 that may be closed by this pull request
Copy link

codecov bot commented Dec 20, 2024

Codecov Report

Attention: Patch coverage is 90.34483% with 14 lines in your changes missing coverage. Please review.

Project coverage is 81.44%. Comparing base (a5cbc5e) to head (5c686db).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5601      +/-   ##
==========================================
- Coverage   85.25%   81.44%   -3.82%     
==========================================
  Files         152      152              
  Lines       61012    60939      -73     
==========================================
- Hits        52015    49630    -2385     
- Misses       8997    11309    +2312     

@gmalinve gmalinve marked this pull request as ready for review January 7, 2025 08:35
@gmalinve gmalinve requested a review from SMoraisAnsys January 7, 2025 08:36
Copy link
Collaborator

@SMoraisAnsys SMoraisAnsys left a comment

Choose a reason for hiding this comment

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

Thanks for this huge refactoring @gmalinve
I left some minor comments, note that the ones of Eddy current -> Eddy Current can probably be discarded (but check the removal of an unnecessary " ")

On top of those comments here are three things I want to bring up:

  • In future refactoring / test addition (or even here if you want) could you try to make the tests follow the pattern : Setup, Calls, Asserts (and TearDown if required) ? This would help to understand what is tested. Note that this will also lead to split some test into more tests (but the code is already here so that isn't really an issue)
  • Would it make sense add extra fixture to also embed m3d_app.solution_type = SOLUTIONS.WHATEVER ? I see that multiple tests start with such definition and I was wondering if it would make sense.
  • Could you try running the tests locally and use random testing ? For example, add
import pytest
import random

def pytest_collection_modifyitems(session, config, items):
    random.shuffle(items)

in the test file or you can have a look at https://pypi.org/project/pytest-randomly/

src/ansys/aedt/core/maxwell.py Outdated Show resolved Hide resolved
src/ansys/aedt/core/maxwell.py Outdated Show resolved Hide resolved
src/ansys/aedt/core/maxwell.py Outdated Show resolved Hide resolved
src/ansys/aedt/core/maxwell.py Outdated Show resolved Hide resolved
src/ansys/aedt/core/maxwell.py Outdated Show resolved Hide resolved
tests/system/general/test_28_Maxwell3D.py Outdated Show resolved Hide resolved
tests/system/general/test_28_Maxwell3D.py Show resolved Hide resolved
tests/system/general/test_28_Maxwell3D.py Outdated Show resolved Hide resolved
tests/system/general/test_28_Maxwell3D.py Show resolved Hide resolved
tests/system/general/test_28_Maxwell3D.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@SMoraisAnsys SMoraisAnsys left a comment

Choose a reason for hiding this comment

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

On top of the previous changes comments, here are some new ones ^^

src/ansys/aedt/core/maxwell.py Outdated Show resolved Hide resolved
src/ansys/aedt/core/maxwell.py Outdated Show resolved Hide resolved
@SMoraisAnsys
Copy link
Collaborator

@gmalinve Thanks again for this huge refactoring and bug fixes. I don't think I'll have other changes to propose so once my requests are handled, it should be ready to be merged :)

@gmalinve gmalinve requested a review from SMoraisAnsys January 10, 2025 09:13
SMoraisAnsys
SMoraisAnsys previously approved these changes Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing Anything related to testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve Maxwell 3d tests
3 participants