Skip to content

Commit 2f1e5c9

Browse files
committed
Skip generation system tests related code for CI when --skip-system-test is given
1 parent e15be8c commit 2f1e5c9

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,12 @@ jobs:
126126
DATABASE_URL: postgres://postgres:postgres@localhost:5432
127127
<%- end -%>
128128
# REDIS_URL: redis://localhost:6379/0
129-
<%- if options[:api] -%>
129+
<%- if options[:api] || options[:skip_system_test] -%>
130130
run: bin/rails db:test:prepare test
131131
<%- else -%>
132132
run: bin/rails db:test:prepare test test:system
133133
<%- end -%>
134-
<%- unless options[:api] -%>
134+
<%- unless options[:api] || options[:skip_system_test] -%>
135135

136136
- name: Keep screenshots from failed system tests
137137
uses: actions/upload-artifact@v4

railties/test/generators/app_generator_test.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,9 @@ def test_generator_if_skip_system_test_is_given
544544
assert_no_directory("test/system")
545545

546546
assert_file ".github/workflows/ci.yml" do |content|
547-
assert_no_match(/google-chrome-stable/, content)
547+
assert_match(/db:test:prepare test/, content)
548+
assert_no_match(/test:system/, content)
549+
assert_no_match(/screenshots/, content)
548550
end
549551
end
550552

0 commit comments

Comments
 (0)