rails.md

September 30, 2025 ยท View on GitHub

Public definition for rails_test_factory.

rails_test_factory.new_system_test

load("@rules_ruby//rails:rails_test_factory.bzl", "rails_test_factory")

rails_test_factory.new_system_test(test_package, application_system_test_case, default_includes,
                                   default_size, tags)

Create a rails_system_test macro for a Rails application.

PARAMETERS

NameDescriptionDefault Value
test_packageOptional. The name of the package that contains the test helpers. For example, if the Rails app is rooted in the foo directory, the test package is typically foo/test.None
application_system_test_caseOptional. The label for the Rails application's application_system_test_case.rb.None
default_includesOptional. A list of Ruby includes that should be part of the Ruby test invocation.None
default_sizeOptional. The default test size for the tests created with the resulting macro."large"
tagsOptional. A list of tags that are added to the test declaration.["no-sandbox"]

RETURNS

A Bazel macro function that defines Rails system test targets using the provided attributes.

rails_test_factory.new_test

load("@rules_ruby//rails:rails_test_factory.bzl", "rails_test_factory")

rails_test_factory.new_test(test_package, test_helper, default_includes, default_size, tags)

Create a rails_test macro for a Rails application.

The resulting macro encapsulates the application-specific attributes for the resulting test target.

PARAMETERS

NameDescriptionDefault Value
test_packageOptional. The name of the package that contains the test helpers. For example, if the Rails app is rooted in the foo directory, the test package is typically foo/test.None
test_helperThe label for the Rails application's test_helper.rb.None
default_includesOptional. A list of Ruby includes that should be part of the Ruby test invocation.None
default_sizeOptional. The default test size for the tests created with the resulting macro."small"
tagsOptional. A list of tags that are added to the test declaration.[]

RETURNS

A Bazel macro function that defines Rails test targets using the provided attributes.