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

Add bash script for --stdin test. #33

Merged
merged 3 commits into from
Apr 5, 2024
Merged

Add bash script for --stdin test. #33

merged 3 commits into from
Apr 5, 2024

Conversation

huacnlee
Copy link
Member

@huacnlee huacnlee commented Apr 5, 2024

Test example:

image

Summary by CodeRabbit

  • New Features
    • Enhanced the output formatting process for source code in the application.
  • Tests
    • Introduced new testing scripts for improved command line interface testing, particularly focusing on stdin functionality.
  • Chores
    • Streamlined the testing process in the CI/CD pipeline by consolidating jobs and updating test commands.
  • Bug Fixes
    • Fixed issues related to input formatting and output comparison in CLI tests.

Copy link

coderabbitai bot commented Apr 5, 2024

Warning

Rate Limit Exceeded

@huacnlee has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 19 minutes and 15 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.
Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.
Please see our FAQ for further information.

Commits Files that changed from the base of the PR and between c47a49a and 1da735f.

Walkthrough

The recent update simplifies and enhances testing procedures for a project. It streamlines the workflow by removing a redundant testing job in favor of a more comprehensive one that includes a make command. Additionally, it introduces a shell script for specialized stdin testing, ensuring that formatting functions as expected. This change not only refines the test suite but also broadens its capabilities to include more nuanced test scenarios.

Changes

File Change Summary
.github/workflows/test.yml Removed Tests job, renamed Test Cli job to Test.
Makefile Added a command to run the stdin test script in the test target.
src/main.rs Modified printing of source code to include a formatting step using a new function.
tests/stdin_test.sh, tests/cli_test.sh Introduced scripts for testing pestfmt --stdin functionality and asserting formatting against expected output.

🐇✨
In the realm of code, where tests doth tread,
A rabbit hopped, changes in its stead.
"Away with the old, in with the new,
Let's make our testing more thorough, too!"
With a shell script's charm and a makefile's grace,
It left its mark, a much finer place.
🌟📜🛠️

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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration 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/coderabbit-overrides.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: 2

Review Status

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between c47a49a and 3c58a79.
Files selected for processing (3)
  • .github/workflows/test.yml (1 hunks)
  • Makefile (1 hunks)
  • tests/stdin_test.sh (1 hunks)
Additional comments not posted (3)
Makefile (1)

4-4: Ensure the newly added script tests/stdin_test.sh is properly integrated and functions as expected within the project's testing framework.

tests/stdin_test.sh (1)

18-18: Verify the correctness of the test case, especially the expected output, to ensure it aligns with the intended functionality of pestfmt --stdin.

.github/workflows/test.yml (1)

28-28: Ensure that the modified workflow correctly executes all necessary tests and integrates seamlessly with the project's continuous integration process.

tests/stdin_test.sh Outdated Show resolved Hide resolved
tests/stdin_test.sh Outdated Show resolved Hide resolved
@huacnlee huacnlee marked this pull request as draft April 5, 2024 02:57
@huacnlee huacnlee force-pushed the add-stdin-unit-test branch from 3c58a79 to b5c60d8 Compare April 5, 2024 03:06
@huacnlee huacnlee closed this Apr 5, 2024
@huacnlee huacnlee reopened this Apr 5, 2024
@huacnlee huacnlee marked this pull request as ready for review April 5, 2024 03:11
@huacnlee huacnlee mentioned this pull request Apr 5, 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: 6

Review Status

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between c47a49a and b5c60d8.
Files selected for processing (4)
  • .github/workflows/test.yml (1 hunks)
  • Makefile (1 hunks)
  • src/main.rs (1 hunks)
  • tests/cli_test.sh (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/test.yml
Additional comments not posted (1)
Makefile (1)

3-3: Ensure the script cli_test.sh exists and is executable. Consider renaming it to stdin_test.sh to match the PR objectives and improve clarity.

Verification successful

The script cli_test.sh has been confirmed to exist and is executable. The suggestion to rename the script for clarity should be considered based on the PR's objectives, which requires further context not available here.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Verify the script exists and is executable
if [ ! -x "tests/cli_test.sh" ]; then
    echo "The script tests/cli_test.sh does not exist or is not executable."
    exit 1
else
    echo "The script tests/cli_test.sh exists and is executable."
fi

Length of output: 153

tests/cli_test.sh Outdated Show resolved Hide resolved
tests/cli_test.sh Outdated Show resolved Hide resolved
tests/cli_test.sh Outdated Show resolved Hide resolved
src/main.rs Outdated Show resolved Hide resolved
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: 5

Review Status

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between b5c60d8 and 4b62ade.
Files selected for processing (2)
  • src/main.rs (1 hunks)
  • tests/cli_test.sh (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • src/main.rs

tests/cli_test.sh Outdated Show resolved Hide resolved
tests/cli_test.sh Outdated Show resolved Hide resolved
tests/cli_test.sh Outdated Show resolved Hide resolved
tests/cli_test.sh Outdated Show resolved Hide resolved
tests/cli_test.sh Outdated Show resolved Hide resolved
@huacnlee huacnlee force-pushed the add-stdin-unit-test branch from 4b62ade to 5074efe Compare April 5, 2024 03:29
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

Review Status

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between c47a49a and bd9ca56.
Files selected for processing (4)
  • .github/workflows/test.yml (1 hunks)
  • Makefile (1 hunks)
  • src/main.rs (1 hunks)
  • tests/cli_test.sh (1 hunks)
Files skipped from review as they are similar to previous changes (4)
  • .github/workflows/test.yml
  • Makefile
  • src/main.rs
  • tests/cli_test.sh

@huacnlee huacnlee force-pushed the add-stdin-unit-test branch 2 times, most recently from f345655 to 48abfd7 Compare April 5, 2024 03:50
@tomtau tomtau merged commit e9cb1f6 into master Apr 5, 2024
10 checks passed
@huacnlee huacnlee deleted the add-stdin-unit-test branch April 5, 2024 04:53
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.

2 participants