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

automations:split tests into 2 workflows #558

Merged
merged 5 commits into from
Oct 13, 2024
Merged

automations:split tests into 2 workflows #558

merged 5 commits into from
Oct 13, 2024

Conversation

JarbasAl
Copy link
Member

@JarbasAl JarbasAl commented Oct 13, 2024

reduce waiting time for PR checks, codecov will merge both reports since we use flags

Summary by CodeRabbit

  • New Features

    • Introduced a new automated workflow for running end-to-end tests on pull requests.
  • Bug Fixes

    • Streamlined unit test workflow by removing redundant installation commands and focusing on targeted testing.
  • Chores

    • Updated dependency version for ovos-utils to ensure compatibility with the latest features.

reduce waiting time for PR checks, codecov will merge both reports since we use flags
Copy link

coderabbitai bot commented Oct 13, 2024

Walkthrough

This pull request introduces a new GitHub Actions workflow for end-to-end tests and modifies the existing unit tests workflow. The new end2end_tests.yml file automates end-to-end testing processes triggered by pull requests and manual actions. The unit tests workflow has been streamlined by removing multiple installation commands and focusing on coverage reporting. Additionally, the requirements.txt file updates the version constraint for the ovos-utils dependency. Overall, these changes enhance the testing framework and dependency management within the project.

Changes

File Path Change Summary
.github/workflows/end2end_tests.yml New workflow added for end-to-end tests, triggered on pull requests and manual dispatch.
.github/workflows/unit_tests.yml Modified unit tests workflow to streamline dependency installation and update coverage reporting.
requirements/requirements.txt Updated ovos-utils dependency version from >=0.0.38,<1.0.0 to >=0.1.0,<1.0.0.

Possibly related PRs

Poem

🐇 In the garden of code, we hop and play,
New tests bloom bright, guiding our way.
With dependencies fresh, our paths align,
Through workflows we dance, all tasks divine!
So let’s test and cover, with joy we’ll sing,
For every new change, a happy spring! 🌼


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.

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: 3

🧹 Outside diff range and nitpick comments (2)
.github/workflows/unit_tests.yml (1)

85-85: Consider a more inclusive name for the codecov upload step

The change from 'codecov-umbrella' to 'codecov-unittests' aligns with the focus on unit tests in this workflow. However, this workflow now includes both unit tests and integration tests.

Given that this workflow covers more than just unit tests, and considering that Codecov will merge reports from different workflows (as mentioned in the PR objectives), a more inclusive name might be appropriate. Consider changing it to:

- name: codecov-unittests
+ name: codecov-core-tests

This name would better reflect the comprehensive nature of the tests included in this workflow while distinguishing it from other potential test workflows.

.github/workflows/end2end_tests.yml (1)

69-84: LGTM: Well-configured test execution and coverage reporting with a minor suggestion.

The test execution and coverage reporting setup is well-configured:

  1. End-to-end tests are run using pytest with appropriate coverage options.
  2. Coverage data is appended, allowing for combining results from different test runs.
  3. Coverage is uploaded to Codecov only for Python 3.9, avoiding duplicate reports.
  4. The Codecov configuration is comprehensive, including proper flagging and verbose output.

Minor suggestion: Consider adding a step to print the test results summary after the test execution. This can provide quick feedback in the GitHub Actions log. You can add this step after the "Run end2end tests" step:

      - name: Print test summary
        if: always()
        run: |
          echo "Test Summary:"
          pytest --cache-clear --tb=native -v test/end2end --durations=0 -p no:sugar | tail -n 10

This will always run (even if tests fail) and provide a quick summary of the test results.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 6e81054 and 329cc5e.

📒 Files selected for processing (3)
  • .github/workflows/end2end_tests.yml (1 hunks)
  • .github/workflows/unit_tests.yml (2 hunks)
  • requirements/requirements.txt (1 hunks)
🧰 Additional context used
🪛 actionlint
.github/workflows/end2end_tests.yml

41-41: the runner of "actions/checkout@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


43-43: the runner of "actions/setup-python@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


67-67: shellcheck reported issue in this script: SC2102:info:1:17: Ranges can only match single chars (mentioned due to duplicates)

(shellcheck)

.github/workflows/unit_tests.yml

68-68: shellcheck reported issue in this script: SC2102:info:2:14: Ranges can only match single chars (mentioned due to duplicates)

(shellcheck)

🔇 Additional comments (6)
requirements/requirements.txt (1)

9-9: LGTM. Verify compatibility with the updated ovos-utils version.

The update to ovos-utils>=0.1.0,<1.0.0 is a minor version bump, which typically indicates new features or non-breaking changes. This change maintains compatibility with versions below 1.0.0, which is good for avoiding potential breaking changes.

To ensure this change doesn't introduce any unexpected issues, please verify:

  1. The compatibility of this new version with the rest of the project.
  2. That the new version includes any necessary features or improvements for the updated testing workflows.

You can run the following script to check for any potential conflicts or issues:

.github/workflows/unit_tests.yml (3)

60-63: Excellent update to the unit tests execution!

The addition of --cov-flag=unittests aligns well with the PR objective of splitting tests into two workflows. This flag will help in distinguishing coverage data from different test suites.

The added comment about using --cov-append for additional pytest invocations is very helpful. It provides clear guidance for maintaining consistent coverage reporting across multiple test runs, which is crucial for accurate overall coverage assessment.

These changes contribute to better organization and clarity in the testing process, making it easier to manage and interpret test results.


73-73: Good update to the Padatious unit tests execution

The changes in this line are consistent with the overall strategy for coverage reporting:

  1. The addition of --cov-append ensures that the coverage data from these tests is added to the existing report rather than overwriting it.
  2. Using --cov-flag=unittests is appropriate here as these are indeed unit tests, albeit for a specific component (Padatious).

These modifications contribute to a more comprehensive and accurate coverage report.


Line range hint 1-85: Overall, these changes significantly improve the testing workflow

The modifications to this workflow file align well with the PR objectives of splitting tests into two workflows. The changes contribute to a more organized and efficient testing process by:

  1. Adding appropriate coverage flags to distinguish between different test types.
  2. Ensuring consistent coverage reporting across multiple test invocations.
  3. Streamlining the workflow to focus on core and Padatious unit tests, along with integration tests.

These improvements will likely lead to faster PR checks and more accurate coverage reporting. Great job on enhancing the testing infrastructure!

🧰 Tools
🪛 actionlint

56-56: shellcheck reported issue in this script: SC2102:info:1:17: Ranges can only match single chars (mentioned due to duplicates)

(shellcheck)


68-68: shellcheck reported issue in this script: SC2102:info:2:14: Ranges can only match single chars (mentioned due to duplicates)

(shellcheck)

.github/workflows/end2end_tests.yml (2)

1-30: LGTM: Workflow name and triggers are well-defined.

The workflow name is clear, and the triggers are appropriate for running end-to-end tests. The paths-ignore sections help avoid unnecessary test runs, and the manual dispatch option provides flexibility.


51-68: LGTM: Comprehensive test dependency and core repo installation.

The installation process for test dependencies and the core repository is well-structured:

  1. Test dependencies are installed from requirements/tests.txt.
  2. Specific test skills are installed from local directories, ensuring consistency across different environments.
  3. The core repository is installed with the appropriate extras ('mycroft' and 'deprecated').

This setup should provide a reliable environment for running the end-to-end tests.

🧰 Tools
🪛 actionlint

67-67: shellcheck reported issue in this script: SC2102:info:1:17: Ranges can only match single chars (mentioned due to duplicates)

(shellcheck)

.github/workflows/unit_tests.yml Outdated Show resolved Hide resolved
.github/workflows/end2end_tests.yml Outdated Show resolved Hide resolved
.github/workflows/end2end_tests.yml Outdated Show resolved Hide resolved
Copy link

codecov bot commented Oct 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.81%. Comparing base (23f0bab) to head (3a1cda0).
Report is 5 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #558      +/-   ##
==========================================
- Coverage   75.33%   74.81%   -0.53%     
==========================================
  Files          15       15              
  Lines        3094     3049      -45     
==========================================
- Hits         2331     2281      -50     
- Misses        763      768       +5     
Flag Coverage Δ
end2end 56.64% <100.00%> (?)
unittests 54.05% <100.00%> (-21.29%) ⬇️

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.

@JarbasAl JarbasAl merged commit 4049e4b into dev Oct 13, 2024
8 of 9 checks passed
@JarbasAl JarbasAl deleted the autos branch October 13, 2024 22:56
@coderabbitai coderabbitai bot mentioned this pull request Oct 14, 2024
@coderabbitai coderabbitai bot mentioned this pull request Nov 6, 2024
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.

1 participant