Commit graph

13 commits

Author SHA1 Message Date
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
25d149669e Require wget, iproute and procps-ng
These packages are used in the test itself, but weren't required.
When run on minimal installed system it could cause 'command not found'
problems
2024-11-14 10:37:43 +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
Vít Ondruch
f6f6efdfe9 Install Psych devel dependencies
This prevents `bundle install` failures like:

~~~
:: [ 00:30:49 ] :: [  BEGIN   ] :: Creating new rails application :: actually running 'rails new app | tee bundle.log'
      create
      create  README.md

... snip ...

Fetching rails 7.0.8.6
Installing rails 7.0.8.6
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /usr/local/share/gems/gems/psych-5.2.0/ext/psych
/usr/bin/ruby -I/usr/share/rubygems extconf.rb
checking for pkg-config for yaml-0.1... not found
checking for yaml.h... no
yaml.h not found
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
	--with-opt-dir
	--without-opt-dir
	--with-opt-include=${opt-dir}/include
	--without-opt-include
	--with-opt-lib=${opt-dir}/lib64
	--without-opt-lib
	--with-make-prog
	--without-make-prog
	--srcdir=.
	--curdir
	--ruby=/usr/bin/$(RUBY_BASE_NAME)
	--with-libyaml-source-dir
	--without-libyaml-source-dir
	--with-yaml-0.1-dir
	--without-yaml-0.1-dir
	--with-yaml-0.1-include=${yaml-0.1-dir}/include
	--without-yaml-0.1-include
	--with-yaml-0.1-lib=${yaml-0.1-dir}/lib64
	--without-yaml-0.1-lib
	--with-yaml-0.1-config
	--without-yaml-0.1-config
	--with-pkg-config
	--without-pkg-config
	--with-libyaml-dir
	--without-libyaml-dir
	--with-libyaml-include=${libyaml-dir}/include
	--without-libyaml-include
	--with-libyaml-lib=${libyaml-dir}/lib64
	--without-libyaml-lib

To see why this extension failed to compile, please check the mkmf.log which can
be found here:

  /usr/local/lib64/gems/ruby/psych-5.2.0/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /usr/local/share/gems/gems/psych-5.2.0 for
inspection.
Results logged to /usr/local/lib64/gems/ruby/psych-5.2.0/gem_make.out

  /usr/share/rubygems/rubygems/ext/builder.rb:125:in `run'
  /usr/share/rubygems/rubygems/ext/ext_conf_builder.rb:28:in `build'
  /usr/share/rubygems/rubygems/ext/builder.rb:193:in `build_extension'
  /usr/share/rubygems/rubygems/ext/builder.rb:227:in `block in build_extensions'
  /usr/share/rubygems/rubygems/ext/builder.rb:224:in `each'
  /usr/share/rubygems/rubygems/ext/builder.rb:224:in `build_extensions'
  /usr/share/rubygems/rubygems/installer.rb:844:in `build_extensions'
/usr/share/gems/gems/bundler-2.5.22/lib/bundler/rubygems_gem_installer.rb:109:in
`build_extensions'
/usr/share/gems/gems/bundler-2.5.22/lib/bundler/rubygems_gem_installer.rb:28:in
`install'
/usr/share/gems/gems/bundler-2.5.22/lib/bundler/source/rubygems.rb:205:in
`install'
/usr/share/gems/gems/bundler-2.5.22/lib/bundler/installer/gem_installer.rb:55:in
`install'
/usr/share/gems/gems/bundler-2.5.22/lib/bundler/installer/gem_installer.rb:17:in
`install_from_spec'
/usr/share/gems/gems/bundler-2.5.22/lib/bundler/installer/parallel_installer.rb:133:in
`do_install'
/usr/share/gems/gems/bundler-2.5.22/lib/bundler/installer/parallel_installer.rb:124:in
`block in worker_pool'
  /usr/share/gems/gems/bundler-2.5.22/lib/bundler/worker.rb:62:in `apply_func'
/usr/share/gems/gems/bundler-2.5.22/lib/bundler/worker.rb:57:in `block in
process_queue'
  <internal:kernel>:187:in `loop'
/usr/share/gems/gems/bundler-2.5.22/lib/bundler/worker.rb:54:in
`process_queue'
/usr/share/gems/gems/bundler-2.5.22/lib/bundler/worker.rb:90:in `block (2
levels) in create_threads'

An error occurred while installing psych (5.2.0), and Bundler cannot continue.

In Gemfile:
  debug was resolved to 1.9.2, which depends on
    irb was resolved to 1.14.1, which depends on
      rdoc was resolved to 6.7.0, which depends on
        psych
         run  bundle binstubs bundler
Resolving dependencies...
       rails  importmap:install

... snip ...
~~~

Please note that this error happens only when Fedora ships older version
of Psych then the version available on RubyGems, so the libyaml-devel
might not be always needed.

There are also other possibilities to workaround the issue, such as:

* Excluding `development` and `test` groups from installation to avoid
  the `debug` gem dependency chain.
* Using `--skip-bundle` option and modifying the Gemfile generated
  for the Ruby on Rails app.

However, I believe that this is the most probable action our users would
take.

Also note that while there are installed other binary gems, such as
Nokogiri, those ships prebuild binaries. If Psych decides to do the same
in the future, the `libyaml-devel` might become redundant.
2024-11-13 13:48:20 +01:00
Jarek Prokop
6eec1a682c Require rubygem-rails RPM only on Fedora.
CentOS Stream & RHEL >= 8 do not contain rubygem-rails.
Trying to install such RPM will fail.

It did not fail in CI for CentOS PR https://gitlab.com/redhat/centos-stream/rpms/ruby/-/merge_requests/44
due to the CI enabling Fedora repo, which is not correct.
This is tracked in https://issues.redhat.com/browse/TFT-2564

Furthermore, we also should not expect EPEL in the future:
https://issues.redhat.com/browse/TFT-2881
2024-10-02 20:05:42 +02:00
Lukas Zachar
082d2ec5c5 Remove Makefile/PURPOSE file, add summary/description 2024-07-16 18:38:49 +02:00
Lukáš Zachar
98bf2ce800 Require rubypick only on Fedora
There is no rubypick in rhel/centos but is in Fedora,
 7724c2d703/f/ruby.spec (_146-148)
2024-07-09 15:56:27 +02: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