- Shell 94.2%
- Ruby 5.8%
The plan "modified" selects only the tests that were edited relative to the reference branch. However, when a pull-request has only changed files such as `README.md`, the tmt's modified plan's discover process doesn't detect any tests, showing "summary: 0 tests selected" and tmt exits as exit status 3. And Fedora CI fails marking failure. Below is the tmt command to emulate the case of "0 tests selected" before this change. tmt trigger: https://tmt.readthedocs.io/en/stable/spec/context.html#trigger ``` $ rpm -q tmt tmt-1.67.0-1.fc43.noarch $ tmt -c distro=fedora-rawhide -c trigger=commit run -a \ provision -h virtual -i fedora-rawhide /var/tmp/tmt/run-065 /plans/modified discover directory: /home/jaruga/var/pkg/fed/tests/ruby how: fmf modified-url: https://src.fedoraproject.org/tests/ruby modified-ref: reference/main summary: 0 tests selected warning: No tests found, finishing plan. total: no results found $ echo $? 3 ``` Here is the case. https://src.fedoraproject.org/tests/ruby/pull-request/35#comment-304383 This commit is to add a dummy plan and test which always runs a test in addition to the plan "modified" to make CI pass in the case of the 0 tests selected in the fmf tests. Note that the plan "modified" is still selected in CI which defines the context variable `trigger` with value `commit` after this change. Note there are the following tickets to solve this issue, to pass CI on no tests selected in the upstream tmt and Fedora Forge which is a coming successor of Fedora Package Sources powered by Pagure. So, this commit is a temporary workaround until this issue is solved by these projects. * Upstream tmt: https://github.com/teemtee/tmt/issues/4550 * Fedora Forge: https://forge.fedoraproject.org/ci/tickets/issues/542 |
||
|---|---|---|
| .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.