public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
To: git-commits@fedoraproject.org
Subject: [tests/ruby] main: Add support for patch version in Rails
Date: Wed, 09 Sep 2026 13:26:55 GMT	[thread overview]
Message-ID: <178896041515.1.12218023756941129363.tests-ruby-935a2a0d1ddd@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : tests/ruby
            Branch : main
            Commit : 935a2a0d1ddd5a1bba576781e6b56e66a3db62a0
            Author : Vít Ondruch <vondruch@redhat.com>
            Date   : 2026-09-09T15:09:01+02:00
            Stats  : +5/-1 in 1 file(s)
            URL    : https://src.fedoraproject.org/tests/ruby/c/935a2a0d1ddd5a1bba576781e6b56e66a3db62a0?branch=main

            Log:
            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

---
diff --git a/run-basic-rails-application/runtest.sh b/run-basic-rails-application/runtest.sh
index 200fd1a..1c7cc36 100755
--- a/run-basic-rails-application/runtest.sh
+++ b/run-basic-rails-application/runtest.sh
@@ -46,7 +46,11 @@ rlJournalStart
         rlRun "rails new app --skip-bundle" 0 "Creating new rails application"
         rlRun "pushd app/"
         rlAssertExists "app"
-        rlRun "sed -i.orig -E -e '/^gem \"rails\"/ s/~> //' Gemfile" 0 \
+        # There are two variants of the `gem "rails"` line:
+        # https://github.com/rails/rails/blob/main/railties/lib/rails/generators/app_base.rb#L482-L493
+        rlRun "sed -i.orig -E \
+            -e '/^gem \"rails\"/ s/\"~> [^\"]+\", \">= ([^\"]+)\"/\"\1\"/' \
+            -e '/^gem \"rails\"/ s/~> //' Gemfile" 0 \
             "Updating Gemfile to ensure Rails RPM version is used"
         rlRun -t "diff Gemfile.orig Gemfile" 1 \
             "Printing the Gemfile modifications"

                 reply	other threads:[~2026-09-09 13:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178896041515.1.12218023756941129363.tests-ruby-935a2a0d1ddd@fedoraproject.org \
    --to=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox