Skip to content

Comments

Code Coverage Testing#1070

Draft
Cowsreal wants to merge 5 commits intoMFlowCode:masterfrom
Cowsreal:coverageTesting
Draft

Code Coverage Testing#1070
Cowsreal wants to merge 5 commits intoMFlowCode:masterfrom
Cowsreal:coverageTesting

Conversation

@Cowsreal
Copy link
Contributor

@Cowsreal Cowsreal commented Nov 29, 2025

User description

User description

User description

PR just to run test suite to refresh coverage.


PR Type

Enhancement


Description

  • Removed unused s_derive_sound_speed subroutine and its public export

  • Removed unused s_solve_linear_system helper subroutine

  • Cleaned up module interface by eliminating dead code


Diagram Walkthrough

flowchart LR
  A["m_derived_variables module"] -- "remove unused subroutines" --> B["Streamlined module interface"]
  A -- "remove s_derive_sound_speed" --> C["Sound speed calculation removed"]
  A -- "remove s_solve_linear_system" --> D["Linear solver removed"]
Loading

File Walkthrough

Relevant files
Code cleanup
m_derived_variables.fpp
Remove unused sound speed and linear solver subroutines   

src/post_process/m_derived_variables.fpp

  • Removed s_derive_sound_speed from public interface exports
  • Deleted entire s_derive_sound_speed subroutine implementation (56
    lines)
  • Deleted entire s_solve_linear_system helper subroutine (46 lines)
  • Eliminated unused sound speed computation logic and linear system
    solver
+0/-103 


CodeAnt-AI Description

Drop unused sound-speed and solver helpers from derived variables

What Changed

  • Removed the exported sound-speed derivation routine so only the actively used derived-variable calculations remain
  • Deleted the private linear-system solver since no current workflow depends on it

Impact

✅ Leaner derived-variable exports
✅ Prevents accidental calls to obsolete helpers
✅ Keeps derived-variable maintenance focused on active calculations

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

Summary by CodeRabbit

  • Refactor

    • Removed internal post-processing computational routines; public interface simplified while other derived-variable computations and flux limiter remain unchanged.
  • Tests

    • Added extra flux-related test configurations across dimensions and formats.
    • Added multiple golden metadata snapshots and expanded golden test data for deterministic test validation.

✏️ Tip: You can customize this high-level summary in your review settings.


PR Type

Enhancement, Tests


Description

  • Removed unused s_derive_sound_speed subroutine from public exports

  • Deleted unused s_derive_sound_speed and s_solve_linear_system implementations

  • Added flux_wrt=T test case to coverage testing suite

  • Streamlined module interface by eliminating 103 lines of dead code


Diagram Walkthrough

flowchart LR
  A["m_derived_variables module"] -- "remove unused subroutines" --> B["Streamlined interface"]
  A -- "delete s_derive_sound_speed" --> C["Sound speed removed"]
  A -- "delete s_solve_linear_system" --> D["Linear solver removed"]
  E["Test suite"] -- "add flux_wrt case" --> F["Enhanced coverage"]
Loading

File Walkthrough

Relevant files
Code cleanup
m_derived_variables.fpp
Remove unused sound speed and solver subroutines                 

src/post_process/m_derived_variables.fpp

  • Removed s_derive_sound_speed from public interface exports
  • Deleted entire s_derive_sound_speed subroutine implementation (56
    lines)
  • Deleted entire s_solve_linear_system helper subroutine (46 lines)
  • Eliminated unused sound speed computation and linear system solver
    logic
+0/-103 
Tests
cases.py
Add flux_wrt test case to coverage suite                                 

toolchain/mfc/test/cases.py

  • Added new test case with flux_wrt=T parameter to foreach_dimension()
    function
  • Inserted test case definition after alter_bc_patches() call
  • Expands test coverage for flux writer functionality
+3/-0     

@codeant-ai
Copy link
Contributor

codeant-ai bot commented Nov 29, 2025

CodeAnt AI is reviewing your PR.

@qodo-code-review
Copy link
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Possible Issue

Public interface still references only existing exports; verify no external calls remain to removed subroutines to avoid unresolved references at link/runtime.

   private; public :: s_initialize_derived_variables_module, &
s_derive_specific_heat_ratio, &
s_derive_liquid_stiffness, &
s_derive_flux_limiter, &
s_derive_vorticity_component, &
s_derive_qm, &
s_derive_liutex, &
API Removal

Removal of s_derive_sound_speed may break downstream code paths expecting sound speed; confirm alternative computation exists or update callers accordingly.

            do i = -offset_x%beg, m + offset_x%end
                q_sf(i, j, k) = pi_inf_sf(i, j, k)/(gamma_sf(i, j, k) + 1._wp)
            end do
        end do
    end do

end subroutine s_derive_liquid_stiffness

!>  This subroutine derives the flux_limiter at cell boundary

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 29, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Removed two subroutines (s_derive_sound_speed, s_solve_linear_system) and their public export from the m_derived_variables module; added a new flux-wrt test-case variant via alter_flux_wrt() in toolchain/mfc/test/cases.py; multiple golden metadata and test-data files were added.

Changes

Cohort / File(s) Summary
Module: removed subroutines
src/post_process/m_derived_variables.fpp
Deleted implementations of s_derive_sound_speed and s_solve_linear_system; removed s_derive_sound_speed from the module's public exports. Remaining module logic unchanged.
Test harness: new test-case variant
toolchain/mfc/test/cases.py
Added alter_flux_wrt() and invoked it inside foreach_dimension(), adding two Flux WRT test cases (default and format=2) per dimension.
Golden metadata (new files)
tests/*/golden-metadata.txt
Added multiple new golden-metadata snapshot files capturing environment/build/test metadata for different test runs (purely static data).
Golden test data (new files/entries)
tests/B0F13417/golden.txt, tests/C1A34E76/golden.txt, tests/.../D/cons*.dat, tests/.../D/prim*.dat
Added numerous golden data entries and files (cons..dat, prim..dat variants) used for test validation; content is static numeric datasets.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Check for any remaining references or calls to s_derive_sound_speed or s_solve_linear_system across the codebase (build errors or linker failures).
  • Confirm whether removed functionality needs replacement or documentation updates (sound-speed calculation, linear solver).
  • Validate new test cases in toolchain/mfc/test/cases.py run as expected and that golden files correspond to the intended outputs.

Possibly related PRs

Suggested labels

Review effort 3/5, size:M

Suggested reviewers

  • sbryngelson
  • wilfonba

Poem

I nibble lines of code with care,
Two old routines float in the air,
New tests hop in, a sprightly crew,
Golden files gleam like morning dew—
🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title check ❓ Inconclusive The title 'Code Coverage Testing' is vague and generic. It does not clearly convey the main change (removal of unused code) or specifically reference the primary modification to the codebase. Consider a more specific title such as 'Remove unused sound speed and linear solver subroutines from m_derived_variables' to better reflect the primary code cleanup changes.
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The PR description covers the main changes and includes relevant details about the unused subroutines removed and test additions. However, it lacks specific sections matching the template (Type of change checklist, How Has This Been Tested section with test configuration, and many checklist items are unchecked).
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@qodo-code-review
Copy link
Contributor

qodo-code-review bot commented Nov 29, 2025

PR Code Suggestions ✨

No code suggestions found for the PR.

@codeant-ai
Copy link
Contributor

codeant-ai bot commented Nov 29, 2025

CodeAnt AI finished reviewing your PR.

Copy link
Contributor

@cubic-dev-ai cubic-dev-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.

No issues found across 1 file

@Cowsreal Cowsreal closed this Nov 29, 2025
@Cowsreal Cowsreal reopened this Nov 29, 2025
@qodo-code-review
Copy link
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

API Change

Public removal of s_derive_sound_speed may break callers; verify no remaining references and update any interfaces or docs accordingly.

   private; public :: s_initialize_derived_variables_module, &
s_derive_specific_heat_ratio, &
s_derive_liquid_stiffness, &
s_derive_flux_limiter, &
s_derive_vorticity_component, &
s_derive_qm, &
s_derive_liutex, &
Test Addition

New case with flux_wrt=T was added to the test enumerations; ensure corresponding validation or assertions exist so it exercises behavior rather than only enumerating cases.

cases.append(define_case_d(stack, "flux_wrt=T", {'flux_wrt': 'T'}))

stack.pop()

alter_mixlayer_perturb(dimInfo)
alter_bc_patches(dimInfo)

cases.append(define_case_d(stack, "flux_wrt=T", {'flux_wrt': 'T'}))
Copy link
Contributor

@qodo-code-review qodo-code-review bot Nov 29, 2025

Choose a reason for hiding this comment

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

Suggestion: Add a test case for flux_wrt = 'F' to complement the newly added test for flux_wrt = 'T', ensuring both branches of the logic are tested. [general, importance: 5]

Suggested change
cases.append(define_case_d(stack, "flux_wrt=T", {'flux_wrt': 'T'}))
cases.append(define_case_d(stack, "flux_wrt=T", {'flux_wrt': 'T'}))
cases.append(define_case_d(stack, "flux_wrt=F", {'flux_wrt': 'F'}))

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
toolchain/mfc/test/cases.py (1)

976-982: Consider adding a test case for flux_wrt='F'.

A past review comment suggested adding a test for flux_wrt='F' to complement the flux_wrt='T' case. This would ensure both branches of the logic are tested.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5596fdb and 15a4880.

📒 Files selected for processing (1)
  • toolchain/mfc/test/cases.py (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
toolchain/mfc/test/cases.py (1)
toolchain/mfc/test/case.py (3)
  • push (325-327)
  • define_case_d (339-355)
  • pop (329-330)
🪛 GitHub Actions: Lint Toolchain
toolchain/mfc/test/cases.py

[error] 978-978: Pylint: Trailing whitespace (C0303) detected. Lint step 'mfc.sh lint' failed with exit code 16.


[error] 980-980: Pylint: Trailing whitespace (C0303) detected. Lint step 'mfc.sh lint' failed with exit code 16.

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
  • GitHub Check: Code Cleanliness Check
  • GitHub Check: Coverage Test on CodeCov
  • GitHub Check: Github (macos, mpi, no-debug, false)
  • GitHub Check: Github (ubuntu, no-mpi, single, no-debug, false)
  • GitHub Check: Github (ubuntu, mpi, debug, true)
  • GitHub Check: Github (ubuntu, mpi, no-debug, false)
  • GitHub Check: Github (macos, mpi, debug, false)
  • GitHub Check: Github (ubuntu, mpi, no-debug, true)
  • GitHub Check: Github (ubuntu, mpi, debug, false)
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: Build & Publish
🔇 Additional comments (1)
toolchain/mfc/test/cases.py (1)

1007-1007: LGTM!

The function is invoked appropriately within foreach_dimension(), following the established pattern for test case generation.

Comment on lines +976 to +982
def alter_flux_wrt():
stack.push("Flux WRT", {'flux_wrt': 'T'})

cases.append(define_case_d(stack, '', {}))
cases.append(define_case_d(stack, 'format=2', {'format': 2}))
stack.pop()

Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Fix trailing whitespace to resolve pipeline failures.

Lines 978 and 980 contain trailing whitespace, causing the lint step to fail.

Apply this diff to remove the trailing whitespace:

 def alter_flux_wrt():
     stack.push("Flux WRT", {'flux_wrt': 'T'})
-        
+
     cases.append(define_case_d(stack, '', {}))
-    cases.append(define_case_d(stack, 'format=2', {'format': 2}))        
+    cases.append(define_case_d(stack, 'format=2', {'format': 2}))
     stack.pop()
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
def alter_flux_wrt():
stack.push("Flux WRT", {'flux_wrt': 'T'})
cases.append(define_case_d(stack, '', {}))
cases.append(define_case_d(stack, 'format=2', {'format': 2}))
stack.pop()
def alter_flux_wrt():
stack.push("Flux WRT", {'flux_wrt': 'T'})
cases.append(define_case_d(stack, '', {}))
cases.append(define_case_d(stack, 'format=2', {'format': 2}))
stack.pop()
🧰 Tools
🪛 GitHub Actions: Lint Toolchain

[error] 978-978: Pylint: Trailing whitespace (C0303) detected. Lint step 'mfc.sh lint' failed with exit code 16.


[error] 980-980: Pylint: Trailing whitespace (C0303) detected. Lint step 'mfc.sh lint' failed with exit code 16.

🤖 Prompt for AI Agents
In toolchain/mfc/test/cases.py around lines 976 to 982, there are trailing
spaces at the ends of lines 978 and 980 causing lint failures; open the file and
remove the trailing whitespace characters on those two lines (ensure there are
no extra spaces after the closing parentheses/quotes), save the file, and run
the linter/format step to confirm the pipeline passes.

@sbryngelson sbryngelson marked this pull request as draft December 3, 2025 18:34
@sbryngelson
Copy link
Member

@Cowsreal is this an active PR? do you plan on working on it? close if not

@codecov
Copy link

codecov bot commented Feb 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 44.41%. Comparing base (df28255) to head (9e9ea61).
⚠️ Report is 8 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1070      +/-   ##
==========================================
+ Coverage   44.05%   44.41%   +0.36%     
==========================================
  Files          70       70              
  Lines       20496    20458      -38     
  Branches     1989     1987       -2     
==========================================
+ Hits         9030     9087      +57     
+ Misses      10328    10194     -134     
- Partials     1138     1177      +39     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants