Skip to content

0.23.0: Mad Max: Fury Road

Compare
Choose a tag to compare
@lmr lmr released this 22 Apr 14:01
· 8603 commits to master since this release

Hello everyone! I'm here to announce the new Avocado 0.23.0 release! This time around, we have a few changes worth of note:

  • Now avocado looks more like nose and other unittest based test runners: You can define a number of test methods prefixed with test, and the runner will simply run them. Also, for compatibility with the base unittest class, now setup and cleanup are setUp and tearDown.

Let's see how an old avocado test looked like:

#!/usr/bin/python
from avocado import test
from avocado import job


class OldTest(test.Test):

    def setup(self):
    self.hello = "Hi there!"

    def action(self):
    self.assertEqual(self.hello, "Hi there!")

    def cleanup(self):
    self.log.debug('Cleanup')

if __name__ == '__main__':
    job.main()

The new avocado tests look like this:

#!/usr/bin/python
from avocado import test
from avocado import job


class MultipleTests(test.Test):

    def setUp(self):
    self.hello = "Hi there!"

    def test_hello(self):
    self.assertEqual(self.hello, "Hi there!")

    def testIdentity(self):
    self.assertTrue(1, 1)

    def tearDown(self):
    self.log.debug('Cleanup')

if __name__ == '__main__':
    job.main()
  • avocado run: Simplified command line options, cutting off a number of rarely used options and moving them to config file entries
  • avocado run: Added the --job-timeout option, that allows users to specify the maximum time an avocado test job might take.
  • avocado run: Consolidated the options --remote-timeout and --vm-timeout into --job-timeout.
  • Sysinfo feature: The sysinfo feature went through refactoring and simplification - Now it is possible to specify what information from the system is to be collected through config files

See how to configure your collectibles:

[sysinfo.collectibles]
# File with list of commands that will be executed and have their output collected
commands = /etc/avocado/sysinfo/commands
# File with list of files that will be collected verbatim
files = /etc/avocado/sysinfo/files
# File with list of commands that will run alongside the job/test
profilers = /etc/avocado/sysinfo/profilers

The default commands file looks like:

df -mP
dmesg -c
uname -a
lspci -vvnn
gcc --version
ld --version
mount
hostname
uptime
dmidecode
ifconfig -a
brctl show
ip link
numactl --hardware show
lscpu
fdisk -l
  • Multiplexer: A new params retrieval system is in place. Now, instead of self.params.key you must use the self.params.get(key, path, default) API. A compatibility layer with the old dict structure was made, but we encourage you to migrate your param retrieval calls from self.params.key or self.params['key'] toself.params.get('key').

The full list of commits can be seen here:

0.21.0...0.23.0

Happy testing!