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

fix:ocp-pipeline>=1.0.8 #621

Merged
merged 3 commits into from
Dec 6, 2024
Merged

fix:ocp-pipeline>=1.0.8 #621

merged 3 commits into from
Dec 6, 2024

Conversation

JarbasAl
Copy link
Member

@JarbasAl JarbasAl commented Dec 6, 2024

since OpenVoiceOS/ovos-ocp-pipeline-plugin#34 end2end tests started to fail

Summary by CodeRabbit

Summary by CodeRabbit

  • Bug Fixes

    • Improved test coverage for player information retrieval and legacy audio service interactions.
    • Enhanced robustness of tests to ensure system retries fetching player information when necessary.
  • Tests

    • Updated expected message sequences in various test methods for better alignment with system interactions.
    • Added new message checks for legacy audio service in test cases.
  • Chores

    • Updated dependency version specifications for improved flexibility in version selection:
      • ovos_ocp_pipeline_plugin updated to >=1.0.10, <2.0.0
      • ovos-workshop updated to >=3.1.2,<4.0.0
      • ovos-utterance-plugin-cancel updated to >=0.2.3, <1.0.0

Copy link

coderabbitai bot commented Dec 6, 2024

Walkthrough

The changes involve modifications to the TestOCPPipeline and TestLegacyCPSPipeline classes within the test/end2end/session/test_ocp.py file. New expected messages have been added to the test_player_info and test_legacy_match methods to improve the robustness of the tests, particularly in scenarios where player information is not initially received. The expected message sequences have been updated to reflect these additions, ensuring comprehensive coverage of interactions with the OCP and legacy systems. Additionally, the version specifications for several dependencies in requirements.txt and requirements/plugins.txt have been updated to allow for a broader range of compatible versions.

Changes

File Change Summary
test/end2end/session/test_ocp.py - Updated TestOCPPipeline and TestLegacyCPSPipeline classes.
- Added new expected messages in test_player_info and test_legacy_match methods.
- Enhanced message sequences for better coverage of player information retrieval and legacy audio service interactions.
- Minor adjustments to expected message lists across several test cases.
requirements/requirements.txt - Changed dependency version from ovos_ocp_pipeline_plugin==1.0.7 to ovos_ocp_pipeline_plugin>=1.0.10, <2.0.0.
- Updated ovos-workshop from >=3.0.1,<4.0.0 to >=3.1.2,<4.0.0.
requirements/plugins.txt - Updated ovos-utterance-plugin-cancel from >=0.2.2, <1.0.0 to >=0.2.3, <1.0.0.

Possibly related PRs

  • feat/pipeline_plugins_opm #527: This PR involves changes to the adapt module and its imports, which may relate to the modifications in the test_ocp.py file that also deal with message handling and interactions in the context of pipelines.
  • fix: update deprecated imports from ovos-utils #611: This PR updates import statements in tests related to the FakeBus, which is relevant to the testing framework used in test_ocp.py, indicating a connection in how tests are structured and executed.
  • fix:bracket_expansion #618: This PR modifies the StopService class, which may have indirect implications for the overall service architecture that the tests in test_ocp.py are validating, particularly in how services interact with message handling.

Suggested reviewers

  • goldyfruit
  • j1nx
  • builderjer

Poem

🐇 In the land of tests, where messages flow,
New checks are added, to help us know.
Player info waits, but we'll not despair,
With retries in place, we'll always care.
Legacy tunes now dance in the light,
Robust and ready, our tests take flight! 🎶


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between bbe2ea8 and 9d312e6.

📒 Files selected for processing (2)
  • requirements/plugins.txt (1 hunks)
  • requirements/requirements.txt (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • requirements/plugins.txt
🚧 Files skipped from review as they are similar to previous changes (1)
  • requirements/requirements.txt

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added the fix label Dec 6, 2024
Copy link

codecov bot commented Dec 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.64%. Comparing base (23f0bab) to head (9d312e6).
Report is 125 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #621      +/-   ##
==========================================
- Coverage   75.33%   72.64%   -2.70%     
==========================================
  Files          15       15              
  Lines        3094     1550    -1544     
==========================================
- Hits         2331     1126    -1205     
+ Misses        763      424     -339     
Flag Coverage Δ
end2end 55.61% <ø> (?)
unittests 49.22% <ø> (-26.12%) ⬇️

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

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

@github-actions github-actions bot added fix and removed fix labels Dec 6, 2024
Copy link

@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: 0

🧹 Outside diff range and nitpick comments (1)
test/end2end/session/test_ocp.py (1)

505-508: Consider clarifying the repetition of identical messages

The addition of four consecutive "mycroft.audio.service.queue" messages in the expected_messages list may benefit from a comment explaining the necessity of multiple identical messages to enhance readability and maintainability.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between e87af00 and d02cf26.

📒 Files selected for processing (1)
  • test/end2end/session/test_ocp.py (3 hunks)
🔇 Additional comments (2)
test/end2end/session/test_ocp.py (2)

129-129: Addition of retry logic enhances test robustness

The inclusion of a second "ovos.common_play.SEI.get" message in the expected_messages list ensures that the test accurately handles scenarios where player information is not received on the first attempt, thereby improving the reliability of the test.


146-146: Simulating player info retry with additional message

By adding another "ovos.common_play.SEI.get" at this point, the test simulates the system's behavior of retrying the request for player information when there is no initial response, which aligns with expected functionality.

@github-actions github-actions bot added the fix label Dec 6, 2024
debugging what changed with latest package versions
Copy link

@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: 0

🧹 Outside diff range and nitpick comments (1)
test/end2end/session/test_ocp.py (1)

505-508: LGTM! Added expected legacy audio service messages.

The addition of multiple queue messages accurately reflects the legacy audio service behavior. Consider adding a comment explaining why multiple queue messages are expected for better maintainability.

            'mycroft.audio.service.play',  # LEGACY api
+           # Legacy audio service queues multiple tracks in sequence
            "mycroft.audio.service.queue",
            "mycroft.audio.service.queue",
            "mycroft.audio.service.queue",
            "mycroft.audio.service.queue",
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between d02cf26 and bbe2ea8.

📒 Files selected for processing (2)
  • requirements/requirements.txt (1 hunks)
  • test/end2end/session/test_ocp.py (3 hunks)
🔇 Additional comments (2)
requirements/requirements.txt (1)

8-8: LGTM! Version range update looks good.

The change from fixed version to a range specification follows semantic versioning best practices, allowing for compatible updates while preventing breaking changes.

Let's verify the compatibility of the latest compatible version:

✅ Verification successful

Let me try a different approach to verify the package version information:


Version range update is appropriate and safe

The change to >=1.0.7, <2.0.0 is well-aligned with the package's version history. The latest version is 1.0.9, which falls within this range, and the package follows semantic versioning with stable 1.x releases. This version specification will allow for compatible updates while preventing breaking changes.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check latest compatible version and its release date
curl -s "https://pypi.org/pypi/ovos_ocp_pipeline_plugin/json" | \
jq -r '.releases | keys[] | select(test("^1\\.[0-9]+\\.[0-9]+$"))' | \
sort -V | tail -n1 | \
xargs -I {} jq -r --arg v {} '.releases[$v][0].upload_time' \
"$(curl -s https://pypi.org/pypi/ovos_ocp_pipeline_plugin/json)"

Length of output: 86807


Script:

#!/bin/bash
# Check latest version from PyPI using a simpler curl command
curl -s "https://pypi.org/pypi/ovos-ocp-pipeline-plugin/json" | \
jq -r '.info.version'

Length of output: 89

test/end2end/session/test_ocp.py (1)

129-129: LGTM! Enhanced test robustness with retry mechanism.

The addition of retry attempts for player info makes the test more resilient to timing issues and better reflects real-world scenarios where responses might not be immediate.

Also applies to: 146-146

JarbasAl added a commit to OpenVoiceOS/ovos-ocp-pipeline-plugin that referenced this pull request Dec 6, 2024
noticed in end2end tests from OpenVoiceOS/ovos-core#621
JarbasAl added a commit to OpenVoiceOS/ovos-ocp-pipeline-plugin that referenced this pull request Dec 6, 2024
* fix:player_proxy

noticed in end2end tests from OpenVoiceOS/ovos-core#621

* fix workflows
@JarbasAl JarbasAl changed the title fix:failing tests fix:ocp-pipeline>=1.0.8 Dec 6, 2024
@github-actions github-actions bot added fix and removed fix labels Dec 6, 2024
@JarbasAl JarbasAl merged commit 61b9a71 into dev Dec 6, 2024
11 of 12 checks passed
@JarbasAl JarbasAl deleted the fix/end2end branch December 6, 2024 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant