Project

General

Profile

Actions

action #133112

open

Switch unit tests to Test2-Suite

Added by tinita 10 months ago. Updated 2 months ago.

Status:
New
Priority:
Low
Assignee:
-
Category:
Feature requests
Target version:
Start date:
2023-07-20
Due date:
% Done:

0%

Estimated time:

Description

Motivation

We are using a lot of different test modules in different distributions.

  • Test::Most
  • Test::Warnings
  • Test::Fatal
  • Test::MockModule
  • Test::MockObject
  • OpenQA::Test::TimeLimit

The new Test2 suite comes with a lot of builtin stuff:
https://metacpan.org/pod/Test2::V0

The yath tool (alternative to prove) has a builtin timeout functionality: https://metacpan.org/pod/App::Yath#HARNESS-NO-TIMEOUT

https://metacpan.org/pod/Test2::Mock has some interesting features like call tracing. 18-backend-qemu.t is an example where we would get the tracking for free instead of creating our own hash. in another example we use the %called hash even differently, so this is inconsistent.

https://metacpan.org/pod/Test2::Tools::AsyncSubtest / https://metacpan.org/pod/Test2::AsyncSubtest makes it easy to run tests asynchronously or in a fork.

Also the is function already handles deep comparison and even lists all top level mismatches instead of just reporting the first mismatch and then stop.

We might want to try out if we can switch to Test2 in one of our tests and see if it makes sense.
No need to switch all tests at once.

Only downside: The version in Leap 15.5 is quite old (2017!), so we would have to link it in devel:openQA

Actions

Also available in: Atom PDF