Skip to content

Commit 32dcdca

Browse files
authored
Merge pull request rails#53531 from y-yagi/donot_generate_steps_for_system_tests
Don't generate the step for system tests when an application is API-only
2 parents 852b143 + 0cfaac8 commit 32dcdca

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

railties/lib/rails/generators/rails/app/templates/github/ci.yml.tt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ jobs:
131131
<%- else -%>
132132
run: bin/rails db:test:prepare test test:system
133133
<%- end -%>
134+
<%- unless options[:api] -%>
134135

135136
- name: Keep screenshots from failed system tests
136137
uses: actions/upload-artifact@v4
@@ -139,4 +140,5 @@ jobs:
139140
name: screenshots
140141
path: ${{ github.workspace }}/tmp/screenshots
141142
if-no-files-found: ignore
143+
<%- end -%>
142144
<% end -%>

railties/test/generators/api_app_generator_test.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ def test_api_modified_files
5757
assert_file "config/environments/production.rb" do |content|
5858
assert_no_match(/action_controller\.perform_caching = true/, content)
5959
end
60+
61+
assert_file ".github/workflows/ci.yml" do |content|
62+
assert_no_match(/test:system/, content)
63+
assert_no_match(/screenshots/, content)
64+
end
6065
end
6166

6267
def test_dockerfile

0 commit comments

Comments
 (0)