【avocado】avocado基本概念与使用

1.安装

  • core functionality
    Installing from PyPI (推荐安装方式,其他安装方式请查看Install)
	pip3 install --user avocado-framework       (core functionality)

	python3 -m pip  install "avocado-framework<94"
  • Plugins安装(other features)详细
	python3 -m pip  install "avocado-framework-plugin-result-html<94"
	python3 -m pip  install "avocado-framework-plugin-varianter-yaml-to-mux<94"

注:请安装自己需要的plugins

2.基本概念

  • Job ID
    The Job ID is a random SHA1 string that uniquely identifies a given job.
    在这里插入图片描述
  • Conventions约定
    It’s common for a single file to contain multiple tests. In that case, information about the specific test to reference can be added after the filesystem location and a colon, that is, for the reference:
	./examples/tests/sleeptest.py:SleepTest.test
  • Variant IDs
    The varianter component creates different sets of variables (known as “variants”), to allow tests to be run individually in each of them.
  • Test ID
	Syntax: <unique-id>-<test-name>[;<variant-id>]
  • Test types
    Avocado at its simplest configuration can run three different types of tests:
	Executable tests (exec-test)
	python unittest
	instrumented
	You can mix and match those in a single job.
	Avocado plugins can also introduce additional test types.
  • Instrumented

    These are tests written in Python or BASH with the Avocado helpers that use the Avocado test API.

    To be more precise, the Python file must contain a class derived from avocado.test.Test. This means that an executable written in Python is not always an instrumented test, but may work as an executable test.

    The instrumented tests allows the writer finer control over the process including logging, test result status and other more sophisticated test APIs.

    Test statuses PASS, WARN and SKIP are considered successful. The ERROR, FAIL and INTERRUPTED signal failures.

3.基本使用

  • Job Replay

    To run a new job with the configuration used by the previously executed job, it’s possible to simply execute:
    $ avocado replay latest/jobids
    在这里插入图片描述

  • Job Diff
    在这里插入图片描述

  • Listing tests
    在这里插入图片描述

  • Job show
    在这里插入图片描述

  • 日志查看

    On a machine that executed Avocado, job results are available under [job-results]/job-[timestamp]-[short job ID]
    在这里插入图片描述

  • Filtering tests by tags

    Avocado allows tests to be given tags, which can be used to create test categories. With tags set, users can select a subset of the tests found by the test resolver.

    Usually, listing and executing tests with the Avocado test runner would reveal all three tests:
    在这里插入图片描述

  • 配置文件
    在这里插入图片描述

  • 20
    点赞
  • 20
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值