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 rspec-specific GitHub workflow #215

Merged
merged 2 commits into from
Jul 23, 2024

Conversation

zzaakiirr
Copy link
Contributor

@zzaakiirr zzaakiirr commented Jul 20, 2024

What does this PR do and why?

This PR adds new rspec-spicific GitHub workflow so that job can be triggered manually to run specific tests

Does it work?

Example of manually triggered job with passing spec/command/config_spec.rb as spec_paths argument - https://github.com/zzaakiirr/control-plane-flow/actions/runs/10020011552/job/27697199967

Screenshot 2024-07-20 at 15 07 02

Note, that "Setup Control Plane tools" step is intentionally skipped and tests fail because of that

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Introduced a new workflow for running specific RSpec tests, allowing users to manually specify test files or directories.
    • Enhanced configurability of the shared workflow by making test_tag optional and adding spec_paths for more targeted test executions.
  • Improvements

    • Increased flexibility in test execution by allowing conditions on the inclusion of tags and specifying paths for RSpec tests.
    • Standardized naming conventions for workflow parameters, improving consistency and readability.

Copy link

coderabbitai bot commented Jul 20, 2024

Walkthrough

The changes enhance the configurability of RSpec testing workflows in GitHub Actions. The rspec-shared.yml file now features optional input parameters for test_tag and spec_paths, allowing users to run tests based on specific tags or paths. Additionally, a new rspec-specific.yml file has been introduced to enable manual execution of tests, further improving flexibility and efficiency in the testing process.

Changes

File Path Change Summary
.github/workflows/rspec-shared.yml, .github/workflows/rspec.yml Renamed input parameters from kebab-case to snake_case; test_tag is now optional; added spec_paths input for custom test paths.
.github/workflows/command_docs.yml Changed ruby-version to ruby_version for consistency with naming conventions.
.github/workflows/rspec-specific.yml New workflow for manual execution of RSpec tests; requires spec_paths input to run tests based on user-defined paths using a shared workflow.

Poem

🐇 In the meadow where tests do play,
Optional tags brighten the day!
With paths defined, our tests take flight,
RSpec's magic, a pure delight!
So hop along, let’s run with glee,
For testing's now as fun as can be! 🌼✨


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.
    • @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 as 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.

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

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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 594b706 and 8924e23.

Files selected for processing (2)
  • .github/workflows/rspec-shared.yml (2 hunks)
  • .github/workflows/rspec-specific.yml (1 hunks)
Additional comments not posted (5)
.github/workflows/rspec-specific.yml (3)

1-4: LGTM! Workflow metadata is correctly defined.

The workflow name and trigger are appropriately set up.


5-8: LGTM! Input definitions are correctly set up.

The spec_paths input is well-defined with a description and required flag.


10-18: LGTM! Job definitions are correctly set up.

The job uses the shared workflow and passes the necessary inputs and secrets correctly.

.github/workflows/rspec-shared.yml (2)

13-16: LGTM! Input parameter modifications enhance configurability.

The test-tag input is now optional, and the new spec_paths input allows specifying test paths.


47-47: LGTM! Test command modification is correctly implemented.

The command now conditionally includes the test-tag and appends spec_paths.

@zzaakiirr zzaakiirr force-pushed the add-rspec-specific-github-workflow branch 3 times, most recently from b819060 to 8ccece5 Compare July 20, 2024 11:43
@zzaakiirr zzaakiirr force-pushed the add-rspec-specific-github-workflow branch from 8ccece5 to 3df9da9 Compare July 20, 2024 12:04
@zzaakiirr zzaakiirr requested a review from rafaelgomesxyz July 20, 2024 12:08
Copy link
Collaborator

@rafaelgomesxyz rafaelgomesxyz left a comment

Choose a reason for hiding this comment

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

Left a few comments.

By the way, what do you mean by "Setup Control Plane tools step is intentionally skipped"?

.github/workflows/rspec-specific.yml Outdated Show resolved Hide resolved
.github/workflows/rspec-shared.yml Show resolved Hide resolved
.github/workflows/rspec-shared.yml Outdated Show resolved Hide resolved
@zzaakiirr
Copy link
Contributor Author

zzaakiirr commented Jul 23, 2024

By the way, what do you mean by "Setup Control Plane tools step is intentionally skipped"?

I removed "Setup Control Plane tools step is intentionally skipped" from rspec-shared.yml because didn't want to bother with setting up CPLN_ORG and CPLN_TOKEN_CI variables and just wanted to check if bundle exec rspec ran with correct arguments - zzaakiirr@96bc5c3

1. Replace `-` with `_` for inputs
2. Rename rspec-specific-tests to rspec-specific
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 details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 8924e23 and d9b0319.

Files selected for processing (4)
  • .github/workflows/command_docs.yml (1 hunks)
  • .github/workflows/rspec-shared.yml (3 hunks)
  • .github/workflows/rspec-specific.yml (1 hunks)
  • .github/workflows/rspec.yml (1 hunks)
Files skipped from review due to trivial changes (2)
  • .github/workflows/command_docs.yml
  • .github/workflows/rspec.yml
Files skipped from review as they are similar to previous changes (2)
  • .github/workflows/rspec-shared.yml
  • .github/workflows/rspec-specific.yml

@zzaakiirr zzaakiirr force-pushed the add-rspec-specific-github-workflow branch from d9b0319 to 6ad601f Compare July 23, 2024 05:35
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 details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between d9b0319 and 6ad601f.

Files selected for processing (3)
  • .github/workflows/rspec-shared.yml (3 hunks)
  • .github/workflows/rspec-specific.yml (1 hunks)
  • .github/workflows/rspec.yml (1 hunks)
Files skipped from review due to trivial changes (1)
  • .github/workflows/rspec.yml
Files skipped from review as they are similar to previous changes (2)
  • .github/workflows/rspec-shared.yml
  • .github/workflows/rspec-specific.yml

Copy link
Collaborator

@rafaelgomesxyz rafaelgomesxyz left a comment

Choose a reason for hiding this comment

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

Thanks for this!

@zzaakiirr zzaakiirr merged commit 66e532b into main Jul 23, 2024
5 checks passed
@zzaakiirr zzaakiirr deleted the add-rspec-specific-github-workflow branch July 23, 2024 12:31
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