Skip to content

Conversation

@germa89
Copy link
Collaborator

@germa89 germa89 commented May 19, 2025

Description

Small changes to the CAD tests.

Issue linked

Close #3929

Checklist

Summary by Sourcery

Refactor geometry import tests to explicitly upload CAD files before import and update the CATIA V5 import conditional to use os.name for platform detection.

Tests:

  • Add explicit mapdl.upload calls for CubeWithHole files in IGES, SAT, XT, and CATIA V5 import tests
  • Replace ON_CI flag with os.name == "posix" for CATIA V5 import conditional

@germa89 germa89 requested a review from a team as a code owner May 19, 2025 11:10
@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

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented May 19, 2025

Reviewer's Guide

This PR refactors the CAD geometry import tests to first upload CAD files via mapdl.upload before invoking import routines and replaces the generic ON_CI flag with an explicit os.name POSIX check for improved platform detection.

File-Level Changes

Change Details Files
Standardize CAD file upload before import
  • Insert mapdl.upload(...) before igesin in test_readin_igs and adjust igesin arguments
  • Insert mapdl.upload(...) before satin in test_readin_sat
  • Insert mapdl.upload(...) before parain in test_readin_x_t
  • Insert mapdl.upload(...) before cat5in in test_readin_catiav5
tests/test_importing_geometries.py
Replace ON_CI flag with os.name POSIX check
  • Replace 'elif ON_CI' with 'elif os.name == "posix"' in test_readin_catiav5
tests/test_importing_geometries.py

Assessment against linked issues

Issue Objective Addressed Explanation
#3929 Disable or skip Catia V5 tests on Linux.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@github-actions github-actions bot added the enhancement Improve any current implemented feature label May 19, 2025
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @germa89 - I've reviewed your changes - here's some feedback:

  • You’re repeating mapdl.upload(...) in each CAD format test—consider moving this into a shared fixture or helper function (or using pytest.mark.parametrize) to reduce duplication.
  • The switch from ON_CI to os.name == 'posix' may be too broad—if the intent is to skip only CI environments, use a more targeted check (e.g. a CI-specific env var) or add a comment explaining why all POSIX platforms should behave differently.
Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🟢 Testing: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@germa89 germa89 requested a review from dts12263 May 19, 2025 12:12
@germa89 germa89 self-assigned this May 19, 2025
@codecov
Copy link

codecov bot commented May 19, 2025

Codecov Report

Attention: Patch coverage is 80.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 88.27%. Comparing base (55914e8) to head (8684ed6).
Report is 2 commits behind head on main.

❌ Your patch status has failed because the patch coverage (80.00%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3930      +/-   ##
==========================================
- Coverage   88.29%   88.27%   -0.02%     
==========================================
  Files         187      187              
  Lines       14830    14840      +10     
==========================================
+ Hits        13094    13100       +6     
- Misses       1736     1740       +4     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@germa89
Copy link
Collaborator Author

germa89 commented May 20, 2025

I am going to settle for this @pyansys-ci-bot LGTM.

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
Copy link
Collaborator Author

germa89 commented May 20, 2025

@dts12263 shared with me some catiav4 and catiav5 examples for future testing.

@germa89 germa89 enabled auto-merge (squash) May 20, 2025 10:58
@germa89 germa89 disabled auto-merge May 20, 2025 14:54
@germa89 germa89 enabled auto-merge (squash) May 20, 2025 14:54
@germa89 germa89 merged commit 00a7411 into main May 20, 2025
86 of 88 checks passed
@germa89 germa89 deleted the fix/catiav5-test-exceptions branch May 20, 2025 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Improve any current implemented feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Catia v5 tests

3 participants