ruby/README.md
Lukáš Zachar ec8759b052 Add a plan to run all the tests.
* Update the plan /plans/modified to run in CI. See the following link for the
  condition `trigger == commit`.
  https://tmt.readthedocs.io/en/stable/spec/context.html#trigger
* Add the plan /plans/all to run all the tests. The plan is not executed in CI
  as a default. Don't trigger this plan in CI to save the infra resource and
  the running time.
  Note we don't describe the triggered environment such as local or CI in the
  `summary` element in the plan /plans/all of the `plans.fmf`. Because this
  plan is executed as a default, and users can override the triggered
  environment by running the `tmt` with `trigger` option, such as
  `tmt -c trigger=commit`. We don't want to give users the impression that the
  plan only works in a specific running environment.
* Update the `README.md` removing the parts of the `plans --default` option in
  the `tmt run` commands that are not needed due to the plan /plans/all.

Co-authored-by: Lukáš Zachar <lzachar@redhat.com>
2024-10-08 14:48:43 +02:00

2.2 KiB

Shared ruby tests

This repository contains shared ruby tests.

Available integration tests:

  • systemtap-static-probes-in-ruby - exercising ruby's systemtap api
  • bundler-unit-test - run bundler's unit tests
  • run-basic-rails-application - run a simple rails application

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 test 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$'