Skip to content

Conditionally skip test job in ci.yml#51289

Merged
rafaelfranca merged 2 commits intorails:mainfrom
stevepolitodesign:modify-ci-template
Mar 25, 2024
Merged

Conditionally skip test job in ci.yml#51289
rafaelfranca merged 2 commits intorails:mainfrom
stevepolitodesign:modify-ci-template

Conversation

@stevepolitodesign
Copy link
Copy Markdown
Contributor

@stevepolitodesign stevepolitodesign commented Mar 10, 2024

Motivation / Background

It's common to build new apps with --skip-test. When this is done, CI will raise the following error:

Unrecognized command "test" (Rails::Command::UnrecognizedCommandError)

Detail

Skips the test job when a new application is generated with the --skip-test option.

Additional information

Uses prior art to determine if options[:skip_test] was set.

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one change. Changes that are unrelated should be opened in separate PRs.
  • Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: [Fix #issue-number]
  • Tests are added or updated if you fix a bug or add a feature.
  • CHANGELOG files are updated for the changed libraries if there is a behavior change or additional feature. Minor bug fixes and documentation changes should not be included.

@rails-bot rails-bot bot added the railties label Mar 10, 2024
Copy link
Copy Markdown
Member

@skipkayhil skipkayhil left a comment

Choose a reason for hiding this comment

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

👍 on the change, with a few comments (and make sure you squash after addressing)

Edit: maybe worth adding a test

def test_generator_if_skip_test_is_given
(but negative assertions tend to be brittle so 🤷)

@stevepolitodesign stevepolitodesign force-pushed the modify-ci-template branch 2 times, most recently from 7d513cd to 571bea2 Compare March 10, 2024 18:48
Skip generating a `test` job in ci.yml when a new application is
generated with the `--skip-test` option.
@rafaelfranca rafaelfranca merged commit 7242fd7 into rails:main Mar 25, 2024
@skipkayhil skipkayhil modified the milestones: 7.1.4, 7.2.0 Mar 25, 2024
@skipkayhil
Copy link
Copy Markdown
Member

(I put this on the wrong milestone, this file doesn't exist in 7.1 😅)

fractaledmind pushed a commit to fractaledmind/rails that referenced this pull request May 13, 2024
Skip generating a `test` job in ci.yml when a new application is
generated with the `--skip-test` option.

Co-authored-by: Rafael Mendonça França <[email protected]>
xjunior pushed a commit to xjunior/rails that referenced this pull request Jun 9, 2024
Skip generating a `test` job in ci.yml when a new application is
generated with the `--skip-test` option.

Co-authored-by: Rafael Mendonça França <[email protected]>
HeyNonster pushed a commit to HeyNonster/rails that referenced this pull request Jun 12, 2024
Skip generating a `test` job in ci.yml when a new application is
generated with the `--skip-test` option.

Co-authored-by: Rafael Mendonça França <[email protected]>
yoones pushed a commit to yoones/rails that referenced this pull request Mar 6, 2025
Skip generating a `test` job in ci.yml when a new application is
generated with the `--skip-test` option.

Co-authored-by: Rafael Mendonça França <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants