Commit graph

9 commits

Author SHA1 Message Date
Vít Ondruch
935a2a0d1d Add support for patch version in Rails
Currently, the test fails with the following error:

~~~
... snip ...

:: [ 17:58:30 ] :: [   PASS   ] :: Creating new rails application (Expected 0, got 0)
:: [ 17:58:30 ] :: [  BEGIN   ] :: Running 'pushd app/'
/tmp/tmp.QUuaPCQMYg/app /tmp/tmp.QUuaPCQMYg /var/ARTIFACTS/work-all5lab20yf/plans/all/discover/default-0/tests/run-basic-rails-application
:: [ 17:58:30 ] :: [   PASS   ] :: Command 'pushd app/' (Expected 0, got 0)
:: [ 17:58:30 ] :: [   PASS   ] :: Directory app should exist
:: [ 17:58:30 ] :: [  BEGIN   ] :: Updating Gemfile to ensure Rails RPM version is used :: actually running 'sed -i.orig -E -e '/^gem "rails"/ s/~> //' Gemfile'
:: [ 17:58:30 ] :: [   PASS   ] :: Updating Gemfile to ensure Rails RPM version is used (Expected 0, got 0)
:: [ 17:58:30 ] :: [  BEGIN   ] :: Printing the Gemfile modifications :: actually running 'diff Gemfile.orig Gemfile'
STDOUT: 4c4
STDOUT: < gem "rails", "~> 8.1.3", ">= 8.1.3.1"
STDOUT: ---
STDOUT: > gem "rails", "8.1.3", ">= 8.1.3.1"
:: [ 17:58:30 ] :: [   PASS   ] :: Printing the Gemfile modifications (Expected 1, got 1)
:: [ 17:58:30 ] :: [  BEGIN   ] :: Installing dependencies specified in Gemfile :: actually running 'bundle install'
Don't run Bundler as root. Installing your bundle as root will break this
application for all non-root users on this machine.
Fetching gem metadata from https://rubygems.org/..........
Local specification for nokogiri-1.19.4 has different dependencies than the remote gem, ignoring it
Local specification for activesupport-8.1.3.1 has different dependencies than the remote gem, ignoring it
Could not find gem 'rails (= 8.1.3, >= 8.1.3.1)' in rubygems repository

... snip ...
~~~

The issue here is that there are two possible variants of `gem "rails"`
depeindency, as can be seen here:

https://github.com/rails/rails/blob/main/railties/lib/rails/generators/app_base.rb#L482-L493

This fixes the test to always end up with the hard dependency, such as:

~~~
gem "rails", "8.1.3.1"
~~~

Resolves: rhbz#2530704
2026-09-09 15:09:01 +02:00
Jun Aruga
77206c7b41 run-basic-rails-application: Use Rails RPM to run Rails application server
When running `rails new app` running the `bundle install` internally on the
rubygem-rails RPM version 7.0.8, the command tries to install the upstream
rails gem version 7.0.8.7, and that triggers the following error.

This commit fixes the error by using the rubygem-rails RPM version 7.0.8 rather
than installing the upstream rails 7.0.8.7.

```
$ tmt -c distro=fedora-rawhide run --all provision -h virtual -i fedora-rawhide tests -n '^/run-basic-rails-application$'
/var/tmp/tmt/run-039
...

$ tmt run --id run-039 report -vvv
...
                    :: [ 13:37:43 ] :: [  BEGIN   ] :: Creating new rails application :: actually running 'rails new app | tee bundle.log'
...
                    Bundle complete! 14 Gemfile dependencies, 78 gems now installed.
                    Use `bundle info [gemname]` to see where a bundled gem is installed.
                    1 installed gem you directly depend on is looking for funding.
                      Run `bundle fund` for details
                             run  bundle binstubs bundler
                           rails  importmap:install
                    /usr/local/share/gems/gems/activesupport-7.0.8.7/lib/active_support/logger_thread_safe_level.rb:12:in '<module:LoggerThreadSafeLevel>': uninitialized constant ActiveSupport::LoggerThreadSafeLevel::Logger (NameError)

                        Logger::Severity.constants.each do |severity|
                        ^^^^^^
...
```
2025-02-20 14:48:22 +01:00
Jun Aruga
8079e56b35 run-basic-rails-application: Remove a logic installing upstream rails gem.
Remove a logic installing upstream rails gem which is executed if Rails RPM is
not installed. The logic is for CentOS Stream where Rails RPM may not be
installed.

However, as there is the tests/ruby repository for CentOS Stream,[1] we don't
have to manage CentOS Stream specific logic in Fedora tests/ruby repository.

[1] https://gitlab.com/redhat/centos-stream/tests/ruby
2025-01-28 18:07:05 +01:00
Jun Aruga
fde78aa7df run-basic-rails-application: Remove RHEL 7 and Software Collections logic.
We will not run the rails test in RHEL 7 or Software Collections cases.
2025-01-27 15:45:12 +01:00
Lukáš Zachar
ec9c5bc5ed Use 'ss' to check whether port is free
This utility is used inside Beakerlib.
2024-11-14 10:28:46 +01:00
Lukas Zachar
9c0b998188 Update run-basic-rails-application test
Remove ror-50 part (not supported anywhere any more)
Dropped rubyracer install
2022-11-30 13:52:53 +01:00
Miroslav Vadkerti
057642bf1e Fix dependencies, run bundle install only when needed
Signed-off-by: Miroslav Vadkerti <mvadkert@redhat.com>
2018-02-19 13:08:10 +01:00
Miroslav Vadkerti
1511ce41c4 run-basic-rails-application: fix tests for Fedora
Signed-off-by: Miroslav Vadkerti <mvadkert@redhat.com>
2018-02-19 12:21:36 +01:00
Miroslav Vadkerti
a4cdc02f01 Import 3 integration tests
systemtap-static-probes-in-ruby: for testing ruby's systemtap api
bundler-unit-tests: to run bundler's unit tests
run-basic-rails-application: a simple rails application test

Signed-off-by: Miroslav Vadkerti <mvadkert@redhat.com>
2018-02-15 13:42:17 +01:00