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

Document required step before full test suite can be executed #2466

Merged
merged 5 commits into from
Nov 22, 2024

Conversation

martetassyns
Copy link
Contributor

@martetassyns martetassyns commented Nov 21, 2024

Proposed change

Minor fix to make it easier for new people who start development and want to try running the full test suite.

Type of change

  • [x ] Document existing features within Home Assistant
  • Document new or changing features which there is an existing pull request elsewhere
  • Spelling or grammatical corrections, or rewording for improved clarity
  • Changes to the backend of this documentation
  • Removed stale or deprecated documentation

Additional information

  • This PR fixes or closes issue: fixes #
  • Link to relevant existing code or pull request:

Summary by CodeRabbit

  • Documentation
    • Updated the development testing guide to include additional instructions for running the full test suite.
    • Clarified the need for extra dependencies and provided the command for installation.
    • Improved overall structure for better clarity while keeping existing content on linter errors and testing intact.

Copy link
Contributor

coderabbitai bot commented Nov 21, 2024

📝 Walkthrough
📝 Walkthrough

Walkthrough

The document development_testing.md has been updated to include new instructions for running the full test suite. It highlights additional dependencies required beyond the default setup in the devcontainer and specifies the command uv pip install -r requirements_test_all.txt for installing these dependencies. The overall structure of the document has been modified for clarity, while existing sections on limited test suites and other testing guidelines remain unchanged.

Changes

File Change Summary
docs/development_testing.md Added instructions for running the full test suite, including new dependencies and installation command. Overall structure improved for clarity; no changes to existing testing guidelines.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant DevContainer
    participant TestSuite

    User->>DevContainer: Activate virtual environment
    DevContainer->>User: Virtual environment activated
    User->>DevContainer: Run command `uv pip install -r requirements_test_all.txt`
    DevContainer->>User: Install additional dependencies
    User->>TestSuite: Run full test suite
    TestSuite->>User: Test results
Loading

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between e321a0b and 42904c6.

📒 Files selected for processing (1)
  • docs/development_testing.md (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/development_testing.md

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 or @coderabbitai title 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
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: 0

🧹 Outside diff range and nitpick comments (1)
docs/development_testing.md (1)

20-25: Improve clarity and directness of the instruction

The addition of this critical step is valuable. However, the instruction could be more direct and authoritative.

Apply this diff to improve the instruction:

-If you want to run the full test suite, you need to install all dependencies. Activate the virtual environment and run the command:
+Install all dependencies before running the full test suite:

Additionally, consider consolidating this instruction with the similar one in the "Adding new dependencies" section to avoid redundancy.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 7d40b08 and 701e8c6.

📒 Files selected for processing (1)
  • docs/development_testing.md (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
docs/development_testing.md (6)

Pattern */**(html|markdown|md): - For instructional content in documentation, use a direct and authoritative tone. Avoid expressions of politeness such as 'may' or 'please', and ensure the goal of the instruction is fronted.

  • Apply the Microsoft Style Guide to ensure documentation maintains clarity and conciseness.
  • In step-by-step instructions, front the location phrase in the instructional sentence.
  • In step-by-step instructions, front the 'goal' in the instructional sentence.
  • In step-by-step instructions, if in doubt what to front, front the 'goal' before the location phrase in the instructional sentence.
  • do not hyphenate terms like 'top-right' or 'bottom-left' with 'corner'

Pattern */**(html|markdown|md): - Use bold to mark UI strings.

  • If "" are used to mark UI strings, replace them by bold.

Pattern */**(html|markdown|md): - Be brief in your replies and don't add fluff like "thank you for..." and "Please let me know if"


Pattern */**(html|markdown|md): - Use sentence-style capitalization also in headings.


Pattern */**(html|markdown|md): do not comment on HTML used for icons


Pattern */**(html|markdown|md): Avoid flagging inline HTML for embedding videos in future reviews for this repository.

@@ -17,6 +17,12 @@ To run our linters, on the full code base, run the following command:
pre-commit run --all-files
```

If you want to run the full test suite, you need to install all dependencies. Activate the virtual environment and run the command:
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe move this up to L12 and start with something like "If not using the VSCode devcontainer.....", since the sentence on L12 mentions how to run the tests using devcontainer, and this is an alternative to it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Apparently it wasn't clear that this is a step required when using devcontainers.
I have moved it to the getting started section of devcontainer instead.
Hopefully this is more clear?

Copy link
Member

Choose a reason for hiding this comment

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

Sorry I'm going to counter review this.

Most people really do not need this. This should suggestion and change should be undone.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have reverted the change to the original place.
But reworded it a bit to hopefully make it more clear.

Copy link
Contributor

@abmantis abmantis Nov 22, 2024

Choose a reason for hiding this comment

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

I agree with @frenck that this should not be on the devcontainer section. My suggestion was to place it after that sentence on L12 with a different wording (see my original comment above).

L12 states: This can be achieved by using the VScode devcontainer and the corresponding task., because the vscode tasks install all the dependencies automatically, thus it is not needed if people use the devcontainer and the vscode tasks. But for someone not using vscode, this is needed.

Copy link
Contributor Author

@martetassyns martetassyns Nov 22, 2024

Choose a reason for hiding this comment

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

@abmantis Is this phrasing better?

To run the full test suite, more dependencies are required than what is setup in the devcontainer by default.
If you are running the vscode remote container, you can execute the 'Install all test requirements' task for this.
Or you can activate the virtual environment and run the command:

@home-assistant home-assistant bot marked this pull request as draft November 21, 2024 18:05
@home-assistant
Copy link

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@martetassyns martetassyns marked this pull request as ready for review November 22, 2024 06:35
@home-assistant home-assistant bot requested a review from abmantis November 22, 2024 06:35
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: 2

🧹 Outside diff range and nitpick comments (1)
docs/development_environment.mdx (1)

Line range hint 4-13: Improve type safety and accessibility of the RepositoryOpener component

Several improvements can be made to enhance the component's robustness:

 export const RepositoryOpener = () => {
-  const [value, setValue] = useState(0);
+  const [value, setValue] = useState("");
   const repoUrl = `vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=${encodeURIComponent(value)}`;
   return <div>
-    <input onInput={(ev) => setValue(ev.target.value)} style={{width: "80%", display: "inline-block", marginRight: 16}} />
-    <a href={repoUrl}><button style={{cursor: value == "" ? "default" : "pointer"}} disabled={value == ""}>Open</button></a>
+    <input
+      aria-label="Repository URL"
+      placeholder="Enter repository URL"
+      onChange={(ev) => setValue(ev.target.value)}
+      style={{width: "80%", display: "inline-block", marginRight: 16}}
+    />
+    <a href={repoUrl}><button style={{cursor: value === "" ? "default" : "pointer"}} disabled={value === ""}>Open</button></a>
   </div>
 }
🧰 Tools
🪛 LanguageTool

[style] ~48-~48: Consider a more expressive alternative.
Context: ...o run hass and pytest are installed. To do this, run `uv pip install -r requiremen...

(DO_ACHIEVE)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 701e8c6 and 6bc2146.

📒 Files selected for processing (1)
  • docs/development_environment.mdx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
docs/development_environment.mdx (6)

Pattern */**(html|markdown|md): - For instructional content in documentation, use a direct and authoritative tone. Avoid expressions of politeness such as 'may' or 'please', and ensure the goal of the instruction is fronted.

  • Apply the Microsoft Style Guide to ensure documentation maintains clarity and conciseness.
  • In step-by-step instructions, front the location phrase in the instructional sentence.
  • In step-by-step instructions, front the 'goal' in the instructional sentence.
  • In step-by-step instructions, if in doubt what to front, front the 'goal' before the location phrase in the instructional sentence.
  • do not hyphenate terms like 'top-right' or 'bottom-left' with 'corner'

Pattern */**(html|markdown|md): - Use bold to mark UI strings.

  • If "" are used to mark UI strings, replace them by bold.

Pattern */**(html|markdown|md): - Be brief in your replies and don't add fluff like "thank you for..." and "Please let me know if"


Pattern */**(html|markdown|md): - Use sentence-style capitalization also in headings.


Pattern */**(html|markdown|md): do not comment on HTML used for icons


Pattern */**(html|markdown|md): Avoid flagging inline HTML for embedding videos in future reviews for this repository.

🪛 LanguageTool
docs/development_environment.mdx

[style] ~48-~48: Consider a more expressive alternative.
Context: ...o run hass and pytest are installed. To do this, run `uv pip install -r requiremen...

(DO_ACHIEVE)

docs/development_environment.mdx Outdated Show resolved Hide resolved
@MartinHjelmare MartinHjelmare changed the title documented required step before full test suite can be executed Document required step before full test suite can be executed Nov 22, 2024
Copy link
Member

@frenck frenck left a comment

Choose a reason for hiding this comment

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

Please revert the last change.

@home-assistant home-assistant bot marked this pull request as draft November 22, 2024 12:06
@martetassyns martetassyns marked this pull request as ready for review November 22, 2024 17:16
@home-assistant home-assistant bot requested a review from frenck November 22, 2024 17:16
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

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 6bc2146 and e321a0b.

📒 Files selected for processing (1)
  • docs/development_testing.md (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
docs/development_testing.md (6)

Pattern */**(html|markdown|md): - For instructional content in documentation, use a direct and authoritative tone. Avoid expressions of politeness such as 'may' or 'please', and ensure the goal of the instruction is fronted.

  • Apply the Microsoft Style Guide to ensure documentation maintains clarity and conciseness.
  • In step-by-step instructions, front the location phrase in the instructional sentence.
  • In step-by-step instructions, front the 'goal' in the instructional sentence.
  • In step-by-step instructions, if in doubt what to front, front the 'goal' before the location phrase in the instructional sentence.
  • do not hyphenate terms like 'top-right' or 'bottom-left' with 'corner'

Pattern */**(html|markdown|md): - Use bold to mark UI strings.

  • If "" are used to mark UI strings, replace them by bold.

Pattern */**(html|markdown|md): - Be brief in your replies and don't add fluff like "thank you for..." and "Please let me know if"


Pattern */**(html|markdown|md): - Use sentence-style capitalization also in headings.


Pattern */**(html|markdown|md): do not comment on HTML used for icons


Pattern */**(html|markdown|md): Avoid flagging inline HTML for embedding videos in future reviews for this repository.

🪛 LanguageTool
docs/development_testing.md

[grammar] ~20-~20: Make sure that the noun ‘setup’ is correct. Did you mean the past participle “set up”?
Context: ... dependencies are required than what is setup in the devcontainer by default. To inst...

(BE_VB_OR_NN)

🔇 Additional comments (1)
docs/development_testing.md (1)

20-25: LGTM! Documentation improvement helps new developers

The added instructions clearly explain the additional step required to run the full test suite, which addresses the PR's objective of helping new developers.

🧰 Tools
🪛 LanguageTool

[grammar] ~20-~20: Make sure that the noun ‘setup’ is correct. Did you mean the past participle “set up”?
Context: ... dependencies are required than what is setup in the devcontainer by default. To inst...

(BE_VB_OR_NN)

docs/development_testing.md Outdated Show resolved Hide resolved
docs/development_testing.md Outdated Show resolved Hide resolved
Copy link
Member

@frenck frenck left a comment

Choose a reason for hiding this comment

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

Thanks, @martetassyns 👍

../Frenck

@frenck frenck dismissed abmantis’s stale review November 22, 2024 19:38

Comment addressed

@frenck frenck merged commit b2914fe into home-assistant:master Nov 22, 2024
5 checks passed
@martetassyns martetassyns deleted the fix/pytest-getting-started branch November 22, 2024 19:57
@Xiretza
Copy link

Xiretza commented Dec 2, 2024

Fixes #2061.

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.

4 participants