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

Added issue template for test issues #2917

Conversation

bandhan-majumder
Copy link

@bandhan-majumder bandhan-majumder commented Jan 26, 2025

What kind of change does this PR introduce?

feature

Issue Number:

Fixes #2915

Snapshots/Videos:

image

If relevant, did you update the documentation?

Not sure

Summary

Does this PR introduce a breaking change?

Adds issue template for test

Checklist

CodeRabbit AI Review

  • I have reviewed and addressed all critical issues flagged by CodeRabbit AI
  • I have implemented or provided justification for each non-critical suggestion
  • I have documented my reasoning in the PR comments where CodeRabbit AI suggestions were not implemented

Test Coverage

  • I have written tests for all new changes/features
  • I have verified that test coverage meets or exceeds 95%
  • I have run the test suite locally and all tests pass

Other information

Have you read the contributing guide?

Yes

Summary by CodeRabbit

  • Documentation
    • Added a new GitHub issue template for test implementation requests.
    • Provides structured guidance for creating comprehensive test cases.
    • Aims to improve project code coverage and testing standards.

Copy link

coderabbitai bot commented Jan 26, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

A new GitHub issue template named "Test Implementation Request" has been added to the repository's .github/ISSUE_TEMPLATE/ directory. This template provides a structured approach for creating test cases, focusing on improving code coverage for specific files. It includes sections for goal setting, task definition, resource links, and acceptance criteria, with a particular emphasis on achieving comprehensive test coverage.

Changes

File Change Summary
.github/ISSUE_TEMPLATE/test.md New issue template created for test implementation requests

Assessment against linked issues

Objective Addressed Explanation
Add template for creating test issues [#2915]
Create test.md in .github/ISSUE_TEMPLATE/ [#2915]

Poem

🐰 A template hops into view,
Testing coverage, crisp and new,
Lines of code now fully seen,
No sneaky paths left unseen!
Quality leaps with rabbit might! 🧪


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f38ed6a and 9f6c6fd.

📒 Files selected for processing (1)
  • .github/ISSUE_TEMPLATE/test.md (1 hunks)

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 generate docstrings to generate docstrings for this PR. (Beta)
  • @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.

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

Our Pull Request Approval Process

Thanks for contributing!

Testing Your Code

Remember, your PRs won't be reviewed until these criteria are met:

  1. We don't merge PRs with poor code quality.
    1. Follow coding best practices such that CodeRabbit.ai approves your PR.
  2. We don't merge PRs with failed tests.
    1. When tests fail, click on the Details link to learn more.
    2. Write sufficient tests for your changes (CodeCov Patch Test). Your testing level must be better than the target threshold of the repository
    3. Tests may fail if you edit sensitive files. Ask to add the ignore-sensitive-files-pr label if the edits are necessary.
  3. We cannot merge PRs with conflicting files. These must be fixed.

Our policies make our code better.

Reviewers

Do not assign reviewers. Our Queue Monitors will review your PR and assign them.
When your PR has been assigned reviewers contact them to get your code reviewed and approved via:

  1. comments in this PR or
  2. our slack channel

Reviewing Your Code

Your reviewer(s) will have the following roles:

  1. arbitrators of future discussions with other contributors about the validity of your changes
  2. point of contact for evaluating the validity of your work
  3. person who verifies matching issues by others that should be closed.
  4. person who gives general guidance in fixing your tests

CONTRIBUTING.md

Read our CONTRIBUTING.md file. Most importantly:

  1. PRs with issues not assigned to you will be closed by the reviewer
  2. Fix the first comment in the PR so that each issue listed automatically closes

Other

  1. 🎯 Please be considerate of our volunteers' time. Contacting the person who assigned the reviewers is not advised unless they ask for your input. Do not @ the person who did the assignment otherwise.
  2. Read the CONTRIBUTING.md file make

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

🧹 Nitpick comments (5)
.github/ISSUE_TEMPLATE/test.md (5)

1-7: Consider a more specific title format.

The current title format "Test: [File Name]" could be more descriptive. Consider using a format that includes the type of test and module/component name:

-title: "Test: [File Name]"
+title: "Test: [Module/Component] - [File Name] - [Type of Test]"

This format will help with organization and make it easier to search for specific test issues.


8-9: Make the example file path more distinguishable.

The example file path could be more clearly marked to prevent confusion.

-The goal of this issue is to improve the code coverage for the file: `Example: src/resolvers/Chat/messages.ts`
+The goal of this issue is to improve the code coverage for the file:
+> Example: `src/resolvers/Chat/messages.ts`

10-13: Enhance task details with testing strategies.

Consider adding more specific guidance about testing approaches.

 # Tasks
 1. Review the file to identify sections of code that are being ignored by Codecov or are not covered by tests.
 2. Create or update test cases to ensure 100% coverage for the file.
 3. Remove any `/* istanbul ignore */` or equivalent statements that bypass code coverage reporting, unless absolutely necessary.
+4. Consider the following testing strategies:
+   - Unit tests for individual functions/methods
+   - Integration tests for complex workflows
+   - Edge cases and error conditions
+   - Mocking external dependencies

17-20: Consider additional quality criteria.

The acceptance criteria could include more quality-focused items.

 # Acceptance Criteria
 - All sections of the file are covered by tests.
 - Code coverage for the file reaches 100%.
 - PR created with necessary updates, passing all checks and reviews.
+- Tests follow established naming conventions and patterns
+- Test descriptions clearly explain the test scenarios
+- Tests are efficient and don't include unnecessary assertions
+- Complex test scenarios are documented with comments

21-23: Format the URL as a proper Markdown link.

The bare URL should be formatted as a Markdown link for better readability and to comply with Markdown best practices.

 **Potential internship candidates**
 Please read this if you are planning to apply for a Palisadoes Foundation internship 
-https://github.com/PalisadoesFoundation/talawa/issues/359
+[Internship Information](https://github.com/PalisadoesFoundation/talawa/issues/359)
🧰 Tools
🪛 Markdownlint (0.37.0)

23-23: Bare URL used
null

(MD034, no-bare-urls)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3341235 and c9df432.

📒 Files selected for processing (1)
  • .github/ISSUE_TEMPLATE/test.md (1 hunks)
🧰 Additional context used
🪛 Markdownlint (0.37.0)
.github/ISSUE_TEMPLATE/test.md

23-23: Bare URL used
null

(MD034, no-bare-urls)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Testing Application (22.x)

.github/ISSUE_TEMPLATE/test.md Show resolved Hide resolved
@bandhan-majumder
Copy link
Author

@palisadoes I have added the template for testing issues mentioning the code coverage report and the template you mentioned. Please review it.

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

🧹 Nitpick comments (5)
.github/ISSUE_TEMPLATE/test.md (5)

1-7: Enhance the template metadata for better clarity.

Consider the following improvements to make the template more user-friendly:

 ---
 name:  Test Implementation Request
-about: Write tests for an existing file in the project
+about: Request to implement missing tests or improve test coverage for existing code
-title: "Test: [File Name]"
+title: "Test: [Directory/File Name] - [Brief Description]"
 labels: testing
 assignees: ""
 ---

8-9: Enhance the goal section with more context.

Consider adding more structure to help users provide complete information:

 # Goal
-The goal of this issue is to improve the code coverage for the file: `Example: src/resolvers/Chat/messages.ts`
+The goal of this issue is to improve the code coverage for the file:
+- **File Path**: `[e.g., src/resolvers/Query/users.ts]`
+- **Current Coverage**: [X]%
+- **Target Coverage**: 100%

10-13: Expand tasks to include documentation and best practices.

Consider adding more detailed tasks to ensure comprehensive test implementation:

 # Tasks
 1. Review the file to identify sections of code that are being ignored by Codecov or are not covered by tests.
 2. Create or update test cases to ensure 100% coverage for the file.
 3. Remove any `/* istanbul ignore */` or equivalent statements that bypass code coverage reporting, unless absolutely necessary.
+4. Document any test cases that cover edge cases or complex scenarios.
+5. Follow the project's testing patterns and use appropriate testing utilities/helpers.
+6. Update relevant documentation if new testing patterns or utilities are introduced.

14-16: Add more specific testing resources.

Consider expanding the resources section with more specific links and tools:

 # Resources
-Refer to the foundational documentation on writing test cases in the repository.
+- [Testing Guide](../docs/TESTING.md)
+- [Test Examples](../tests/README.md)
+- [Jest Documentation](https://jestjs.io/docs/getting-started)
 - Check the [Codecov report](https://app.codecov.io/gh/PalisadoesFoundation/talawa-api/) for details on the uncovered lines.
+- Use the project's testing utilities at `tests/helpers/`

17-20: Expand acceptance criteria for quality assurance.

Consider adding more specific criteria to ensure high-quality test implementations:

 # Acceptance Criteria
 - All sections of the file are covered by tests.
 - Code coverage for the file reaches 100%.
 - PR created with necessary updates, passing all checks and reviews.
+- Test cases include both positive and negative scenarios.
+- No test cases are skipped without valid justification.
+- Test descriptions clearly explain the test scenarios.
+- Complex test cases are documented with comments.
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c9df432 and f38ed6a.

📒 Files selected for processing (1)
  • .github/ISSUE_TEMPLATE/test.md (1 hunks)
🧰 Additional context used
🪛 Markdownlint (0.37.0)
.github/ISSUE_TEMPLATE/test.md

23-23: Bare URL used
null

(MD034, no-bare-urls)

⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Testing Application (22.x)
  • GitHub Check: Analyse Code With CodeQL (typescript)

.github/ISSUE_TEMPLATE/test.md Show resolved Hide resolved
coderabbitai[bot]
coderabbitai bot previously approved these changes Jan 26, 2025
@palisadoes
Copy link
Contributor

  1. Closing. This is unnecessary
  2. You also have not been assigned the issue to do this

@palisadoes palisadoes closed this Jan 26, 2025
@palisadoes palisadoes reopened this Jan 26, 2025
@palisadoes palisadoes added the ignore-sensitive-files-pr The contributor has a legitimate reason for editiing protected files label Jan 26, 2025
Copy link
Contributor

@palisadoes palisadoes left a comment

Choose a reason for hiding this comment

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

See comment

.github/ISSUE_TEMPLATE/test.md Outdated Show resolved Hide resolved
@palisadoes palisadoes merged commit 6a5a257 into PalisadoesFoundation:develop Jan 26, 2025
9 of 11 checks passed
@bandhan-majumder
Copy link
Author

@palisadoes I think we need that in main branch to make it accessible to issue creators as main is the default.

@palisadoes
Copy link
Contributor

Please add it there

@bandhan-majumder
Copy link
Author

bandhan-majumder commented Jan 26, 2025

@palisadoes added it here in a pull : #2919
after this getting merged, we will get the template and creating issue will be easier and faster

@coderabbitai coderabbitai bot mentioned this pull request Jan 26, 2025
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ignore-sensitive-files-pr The contributor has a legitimate reason for editiing protected files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants