Skip to content

fix: integration tests#231

Merged
Henrrypg merged 3 commits into
openedx:mainfrom
eduNEXT:hpg/fix-integration-tests
Jun 18, 2026
Merged

fix: integration tests#231
Henrrypg merged 3 commits into
openedx:mainfrom
eduNEXT:hpg/fix-integration-tests

Conversation

@Henrrypg

@Henrrypg Henrrypg commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

This PR fixes integration test by adding a default error message if LLM is trying to call unknown tool.

@openedx-webhooks openedx-webhooks added open-source-contribution PR author is not from Axim or 2U core contributor PR author is a Core Contributor (who may or may not have write access to this repo). labels Jun 17, 2026
@openedx-webhooks

Copy link
Copy Markdown

Thanks for the pull request, @Henrrypg!

This repository is currently maintained by @felipemontoya.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

Details
Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.32%. Comparing base (9f42740) to head (d1af6b2).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #231   +/-   ##
=======================================
  Coverage   95.32%   95.32%           
=======================================
  Files          69       69           
  Lines        8083     8086    +3     
  Branches      432      432           
=======================================
+ Hits         7705     7708    +3     
  Misses        283      283           
  Partials       95       95           
Flag Coverage Δ
unittests 95.32% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Henrrypg Henrrypg requested a review from felipemontoya June 17, 2026 22:35
@felipemontoya

Copy link
Copy Markdown
Member

This looks reasonable, but now the question is does it fix the tests? what would be our standard for this? do we run it manually before we merge the branch?

@Henrrypg Henrrypg force-pushed the hpg/fix-integration-tests branch from ac627dd to 2cc4b56 Compare June 18, 2026 12:55
@Henrrypg Henrrypg force-pushed the hpg/fix-integration-tests branch from 2cc4b56 to 04def07 Compare June 18, 2026 15:47
@Henrrypg

Copy link
Copy Markdown
Contributor Author

/integration-test

@Henrrypg

Copy link
Copy Markdown
Contributor Author

@felipemontoya

Copy link
Copy Markdown
Member

@Henrrypg they are indeed showing green, but there are some errors being logged:

--- Logging error ---
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages/litellm/llms/custom_httpx/async_client_cleanup.py", line 66, in cleanup_wrapper
    loop = asyncio.get_event_loop()
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/asyncio/events.py", line 702, in get_event_loop
    raise RuntimeError('There is no current event loop in thread %r.'
RuntimeError: There is no current event loop in thread 'MainThread'.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/logging/__init__.py", line 1163, in emit
    stream.write(msg + self.terminator)
ValueError: I/O operation on closed file.
Call stack:
  File "/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages/litellm/llms/custom_httpx/async_client_cleanup.py", line 76, in cleanup_wrapper
    loop = asyncio.new_event_loop()
  File "/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/asyncio/events.py", line 823, in new_event_loop
    self._pool.close()
  File "/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages/httpcore/_sync/connection_pool.py", line 353, in close
    self._close_connections(closing_connections)
  File "/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages/httpcore/_sync/connection_pool.py", line 345, in _close_connections
    connection.close()
  File "/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages/httpcore/_sync/connection.py", line 172, in close
    with Trace("close", logger, None, {}):
  File "/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages/httpcore/_trace.py", line 64, in __exit__
    self.trace(f"{self.name}.complete", info)
  File "/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages/httpcore/_trace.py", line 47, in trace
    self.logger.debug(message)
Message: 'close.complete'
Arguments: ()
--- Logging error ---
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/logging/__init__.py", line 1163, in emit
    stream.write(msg + self.terminator)
ValueError: I/O operation on closed file.
Call stack:
  File "/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages/litellm/llms/custom_httpx/http_handler.py", line 1119, in __del__
    self.close()
  File "/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages/litellm/llms/custom_httpx/http_handler.py", line 888, in close
    self.client.close()
  File "/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages/httpx/_client.py", line 1270, in close
    self._transport.close()
  File "/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages/httpx/_transports/default.py", line 262, in close
    self._pool.close()
  File "/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages/httpcore/_sync/connection_pool.py", line 353, in close
    self._close_connections(closing_connections)
  File "/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages/httpcore/_sync/connection_pool.py", line 345, in _close_connections
    connection.close()
  File "/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages/httpcore/_sync/connection.py", line 172, in close
    with Trace("close", logger, None, {}):
  File "/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages/httpcore/_trace.py", line 52, in __enter__
    self.trace(f"{self.name}.started", info)
  File "/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages/httpcore/_trace.py", line 47, in trace
    self.logger.debug(message)
Message: 'close.started'
Arguments: ()
--- Logging error ---
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/logging/__init__.py", line 1163, in emit
    stream.write(msg + self.terminator)
ValueError: I/O operation on closed file.
Call stack:
  File "/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages/litellm/llms/custom_httpx/http_handler.py", line 1119, in __del__
    self.close()
  File "/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages/litellm/llms/custom_httpx/http_handler.py", line 888, in close
    self.client.close()
  File "/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages/httpx/_client.py", line 1270, in close
    self._transport.close()
  File "/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages/httpx/_transports/default.py", line 262, in close
    self._pool.close()
  File "/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages/httpcore/_sync/connection_pool.py", line 353, in close
    self._close_connections(closing_connections)
  File "/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages/httpcore/_sync/connection_pool.py", line 345, in _close_connections
    connection.close()
  File "/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages/httpcore/_sync/connection.py", line 172, in close
    with Trace("close", logger, None, {}):
  File "/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages/httpcore/_trace.py", line 64, in __exit__
    self.trace(f"{self.name}.complete", info)
  File "/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages/httpcore/_trace.py", line 47, in trace
    self.logger.debug(message)
Message: 'close.complete'
Arguments: ()

Also, it would be great if running /integration-tests would comment back in the PR or show as one of the checks. Do you think that is possible without too much work?

@Henrrypg

Copy link
Copy Markdown
Contributor Author

/integration-test

@Henrrypg

Copy link
Copy Markdown
Contributor Author

@felipemontoya Done, i just made a change to not show those itellm logs and now we can see the check

@felipemontoya felipemontoya left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

@Henrrypg Henrrypg merged commit 98f555e into openedx:main Jun 18, 2026
11 checks passed
@github-project-automation github-project-automation Bot moved this from Needs Triage to Done in Contributions Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core contributor PR author is a Core Contributor (who may or may not have write access to this repo). open-source-contribution PR author is not from Axim or 2U

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants