Skip to content

Commit

Permalink
Merge pull request rails#53531 from y-yagi/donot_generate_steps_for_s…
Browse files Browse the repository at this point in the history
…ystem_tests

Don't generate the step for system tests when an application is API-only
  • Loading branch information
kamipo authored Nov 4, 2024
2 parents 852b143 + 0cfaac8 commit 32dcdca
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ jobs:
<%- else -%>
run: bin/rails db:test:prepare test test:system
<%- end -%>
<%- unless options[:api] -%>

- name: Keep screenshots from failed system tests
uses: actions/upload-artifact@v4
Expand All @@ -139,4 +140,5 @@ jobs:
name: screenshots
path: ${{ github.workspace }}/tmp/screenshots
if-no-files-found: ignore
<%- end -%>
<% end -%>
5 changes: 5 additions & 0 deletions railties/test/generators/api_app_generator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ def test_api_modified_files
assert_file "config/environments/production.rb" do |content|
assert_no_match(/action_controller\.perform_caching = true/, content)
end

assert_file ".github/workflows/ci.yml" do |content|
assert_no_match(/test:system/, content)
assert_no_match(/screenshots/, content)
end
end

def test_dockerfile
Expand Down

0 comments on commit 32dcdca

Please sign in to comment.