Skip to content

Commit

Permalink
Merge pull request rails#53776 from fatkodima/skip-ci-system-tests
Browse files Browse the repository at this point in the history
Skip generation system tests related code for CI when `--skip-system-test` is given
  • Loading branch information
kamipo authored Nov 29, 2024
2 parents c88ee55 + 2f1e5c9 commit 1d3689e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,12 @@ jobs:
DATABASE_URL: postgres://postgres:postgres@localhost:5432
<%- end -%>
# REDIS_URL: redis://localhost:6379/0
<%- if options[:api] -%>
<%- if options[:api] || options[:skip_system_test] -%>
run: bin/rails db:test:prepare test
<%- else -%>
run: bin/rails db:test:prepare test test:system
<%- end -%>
<%- unless options[:api] -%>
<%- unless options[:api] || options[:skip_system_test] -%>

- name: Keep screenshots from failed system tests
uses: actions/upload-artifact@v4
Expand Down
4 changes: 3 additions & 1 deletion railties/test/generators/app_generator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,9 @@ def test_generator_if_skip_system_test_is_given
assert_no_directory("test/system")

assert_file ".github/workflows/ci.yml" do |content|
assert_no_match(/google-chrome-stable/, content)
assert_match(/db:test:prepare test/, content)
assert_no_match(/test:system/, content)
assert_no_match(/screenshots/, content)
end
end

Expand Down

0 comments on commit 1d3689e

Please sign in to comment.