Skip to content

fix: unit test error when coverage wasn't specified#88

Merged
terrykong merged 1 commit intomainfrom
fix-coverage
Mar 26, 2025
Merged

fix: unit test error when coverage wasn't specified#88
terrykong merged 1 commit intomainfrom
fix-coverage

Conversation

@terrykong
Copy link
Copy Markdown
Collaborator

@terrykong terrykong commented Mar 26, 2025

What does this PR do ?

@YUki-666 reported pytest failing when not using tests/run_unit.sh and bare pytest

ERROR tests/unit/models/generation/test_vllm_generation.py::test_vllm_generate_text - UnboundLocalError: cannot access local variable 'cov_controller' where it is not associated with a value

This just fixes it so it doesn't error and leaves a message to turn it on in the unit_results.json

{
  "exit_status": 0,
  "git_commit": "084d6facd38f5a14c54adff11e32031be28451db",
  "start_time": "2025-03-26 09:24:12",
  "metrics": {},
  "gpu_types": [
    "NVIDIA H100 80GB HBM3"
  ],
  "coverage": "[n/a] run with --cov=nemo_reinforcer"
}

Issues

List issues that this PR closes (syntax):

Usage

  • You can potentially add a usage example below
# Add a code snippet demonstrating how to use this 

Before your PR is "Ready for review"

Pre checks:

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests?
  • Did you run the unit tests and functional tests locally? Visit our Testing Guide for how to run tests
  • Did you add or update any necessary documentation? Visit our Document Development Guide for how to write, build and test the docs.

Additional Information

  • ...

Behavior now is to tell the user to set it in the unit_results.json

Signed-off-by: Terry Kong <terryk@nvidia.com>
@terrykong terrykong requested a review from parthchadha March 26, 2025 16:28
@terrykong terrykong enabled auto-merge (squash) March 26, 2025 16:29
@terrykong terrykong merged commit 403e475 into main Mar 26, 2025
15 checks passed
@terrykong terrykong deleted the fix-coverage branch March 26, 2025 17:29
yfw pushed a commit that referenced this pull request Apr 2, 2025
Signed-off-by: Terry Kong <terryk@nvidia.com>
Signed-off-by: Yi-Fu Wu <yifu.wu@gmail.com>
KiddoZhu pushed a commit that referenced this pull request May 6, 2025
Signed-off-by: Terry Kong <terryk@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants