- Shell 94.3%
- Ruby 5.7%
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 |
||
|---|---|---|
| .fmf | ||
| run-basic-rails-application | ||
| Sanity/native-extension-gem-is-installed-without-error | ||
| systemtap-static-probes-in-ruby | ||
| tls-minimal-version | ||
| .gitignore | ||
| main.fmf | ||
| plans.fmf | ||
| README.md | ||
Ruby Fedora tests
This repository contains shared Fedora tests for the Ruby component.
Contributing
Testing
You can run the tests in your local environment.
Install tmt.
$ sudo dnf install tmt+all
Run the following command to run the tests for Fedora rawhide:
$ tmt -c distro=fedora-rawhide run --all provision -h virtual -i fedora-rawhide
/var/tmp/tmt/run-NNN
...
The tmt's provisioning method virtual (tmt run provision -h virtual) must be
used, otherwise the tests fail due to known issues with container provisioning
method (tmt run provision -h container). Also note the run-NNN printed on
the output of the command. This represents the run ID used with tmt run --id
option in later steps.
Run the following command to see the report, setting the value of the above run
ID to the --id option. As this repository doesn't have tmt's plans to run the
tests, we need to set the plans --default to use the default plans. See this
tmt's document
about the tmt run report options.
$ tmt run --id run-NNN report -vvv
Running a specific test
You can run a specific test.
List available tests.
$ tmt tests ls
/Sanity/native-extension-gem-is-installed-without-error/ruby25
/Sanity/native-extension-gem-is-installed-without-error/ruby26
/Sanity/native-extension-gem-is-installed-without-error/ruby27
/Sanity/native-extension-gem-is-installed-without-error/ruby30
/Sanity/native-extension-gem-is-installed-without-error/ruby31
/Sanity/native-extension-gem-is-installed-without-error/system
/run-basic-rails-application
/systemtap-static-probes-in-ruby
Run the following command to run a specific test with -n option to specify a
regular expression to match the test name for Fedora rawhide:
$ tmt -c distro=fedora-rawhide run --all \
provision -h virtual -i fedora-rawhide \
tests -n '^/systemtap-static-probes-in-ruby$'
Testing with a rpms/ruby pull-request
Run a scratch build x86_64 on the branch used for the rpms/ruby pull-request that you want to test:
$ fedpkg --release rawhide scratch-build --srpm --arches x86_64
Run the following command with the above build's x86_64 task ID (not build ID)
to download the RPM packages. Remove the SRPM file to keep only binary RPM files
in the /path/to/packages directory to avoid an error on the later tmt
command.
$ pwd
/path/to/packages
$ koji download-task TASK_ID
$ rm *.src.rpm
Run the following command to run the tests with the above RPM files.
$ tmt -c distro=fedora-rawhide run --all \
prepare --insert --how install -D /path/to/packages \
provision -h virtual -i fedora-rawhide
Sending pull-requests
Always send pull-requests rather than pushing the commits directly to avoid breaking CI.