Comments (15)
You can use the YAML test loader:
http://avocado-framework.readthedocs.io/en/latest/optional_plugins/yaml_loader.html
Long story short, there's a specific YAML key (test_reference
) that can be understood by the Avocado loader to be used as the test reference. The rest of the file is just a regular Avocado YAML parameters file, but the variants will be created per test_reference, meaning each test_reference
will have a different set of variants and parameters. Example:
!mux
testcase_01:
test_reference: passtest.py
!include : passtest.py.data/passtest.yaml
testcase_02:
test_reference: sleeptest.py
variants: !mux
slow:
timeout: 1
fast:
timeout: 1
testcase_03:
test_reference: failtest.py
variants: !mux
foo:
p1: 1
bar:
p1: 10
And then run with:
$ avocado run testcases.yaml
from avocado-misc-tests.
i think we can close this issue , feel free to open if discussion not helped
from avocado-misc-tests.
@fkromer Can you explain in detail please ?
from avocado-misc-tests.
@narasimhan-v Right now a user of the repository needs to fork it to being able to configure the tests specific to the users system in a lot of different configuration files. If one would be able to configure the overall set of test suites/tests the user could hold this information in one central "place" potentially separate from the repository. However this is no proposal but a question. If this is not possible to fork the repository is totally fine.
from avocado-misc-tests.
@fkromer Since the config (yaml) files are dependent on the test scripts, I guess having a separate repository for config will add a lot of maintenance overhead, and deviations. But having one single yaml file for more test / test suites is possible, and can be maintained as your fork downstream, as per the requirements.
from avocado-misc-tests.
Since the config (yaml) files are dependent on the test scripts, I guess having a separate repository for config will add a lot of maintenance overhead, and deviations.
That is true. It is not about to separate the tests and the config into separate repos. It is about to override the default config in the separate yaml files with user specific config values from one single yaml file. (This single yaml file could be kept separate from the repo more easily.)
But having one single yaml file for more test / test suites is possible, and can be maintained as your fork downstream, as per the requirements.
Where can I find info about how to configure several tests/test suites in one single yaml file?
from avocado-misc-tests.
It is about to override the default config in the separate yaml files with user specific config values from one single yaml file.
You can do that.
Where can I find info about how to configure several tests/test suites in one single yaml file?
@fkromer That is just to collate all yaml parameters of tests into one single yaml, though it is not as easy. You would need to take care of conflicting parameters
from avocado-misc-tests.
@narasimhan-v I just keep our fork of the repo with custom configuration. Makes maintenance a lot easier.
from avocado-misc-tests.
Of course, you have to make sure that both test_reference
s and !include
s are pointing to valid path locations.
from avocado-misc-tests.
For to the point reference: other YAML to mux loader examples.
from avocado-misc-tests.
@apahim I am using avocado
v56 with the plugin loader_yaml
from PyPi. The plugin seems to be installed:
$ avocado plugins | grep loader_yaml
loader_yaml YAML test loader options for the 'run' subcommand
I added a testcase.yaml
file in the root directory of the test repo with your content from above. I tried to run the tests but I get an error:
$ avocado run testcases.yaml
Unable to resolve reference(s) 'testcases.yaml' with plugins(s) 'file', 'yaml_testsuite', 'external', try running 'avocado list -V testcases.yaml' to see the details.
I don't know if this makes any difference: I have the plugin yaml_to_mux
from PyPi installed as well.
Executing the basic example with avocado run basic.yaml
works fine.
from avocado-misc-tests.
Is it possible to define a yaml
file in the root directory which loads other yaml
files from other directories? (That would allow directory based configuration and test selection.) Could e.g. alltests.yaml
(in the root directory) load cpu.yaml
(in /cpu
), fs.yaml
(in /fs
), and so on?
from avocado-misc-tests.
Works for me:
# cat yaml_test.yaml
!mux
softwareraid:
test_reference: tests/avocado-misc-tests/io/disk/softwareraid.py
!include : tests/avocado-misc-tests/io/disk/softwareraid.py.data/softwareraid.yaml
blkdiscard:
test_reference: tests/avocado-misc-tests/io/disk/ssd/blkdiscard.py
!include : tests/avocado-misc-tests/io/disk/ssd/blkdiscard.py.data/blkdiscard.yaml
# avocado run yaml_test.yaml
JOB ID : f3d4b65bc5494be91791e54c413436106d77cf31
JOB LOG : /root/avocado-korg/io/results/job-2017-12-08T10.23-f3d4b65/job.log
(1/7) tests/avocado-misc-tests/io/disk/softwareraid.py:SoftwareRaid.test_run;raidlinear-scenario-5e7c: FAIL (0.32 s)
(2/7) tests/avocado-misc-tests/io/disk/softwareraid.py:SoftwareRaid.test_run;raid0-scenario-4c2c: FAIL (0.32 s)
(3/7) tests/avocado-misc-tests/io/disk/softwareraid.py:SoftwareRaid.test_run;raid1-scenario-4dbc: FAIL (0.32 s)
(4/7) tests/avocado-misc-tests/io/disk/softwareraid.py:SoftwareRaid.test_run;raid5-scenario-2827: FAIL (0.32 s)
(5/7) tests/avocado-misc-tests/io/disk/softwareraid.py:SoftwareRaid.test_run;raid10-scenario-8715: FAIL (0.32 s)
(6/7) tests/avocado-misc-tests/io/disk/softwareraid.py:SoftwareRaid.test_run;raid6-scenario-86dc: FAIL (0.32 s)
(7/7) tests/avocado-misc-tests/io/disk/ssd/blkdiscard.py:Blkdiscard.test;scenario-f897: PASS (16.45 s)
RESULTS : PASS 1 | ERROR 0 | FAIL 6 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
JOB TIME : 19.71 s
JOB HTML : /root/avocado-korg/io/results/job-2017-12-08T10.23-f3d4b65/results.html
#
from avocado-misc-tests.
Yep, my example was not intended to work, considering the paths and the files are not real. If you provide accurate paths, it should work.
from avocado-misc-tests.
@apahim Ah, was not clear to me.
from avocado-misc-tests.
Related Issues (20)
- When using rdma_tests.py of Avocado (version: 90.0) to test MLNX Network-Card in Rhel8.4, it shows “FAIL: Client cmd: ib_atomic_bw -F”. HOT 1
- After running perf_fuzzer.py in Rhel8.4 with Avocado (version: 93.0), it shows “RuntimeError: Test interrupted by SIGTERM”. HOT 3
- While running ndctl.py with Avocado 92.0, traceback messages are seen [(most recent call last):File "/usr/lib64/python3.6/multiprocessing/process.py"..] HOT 1
- After running avago9361_vd.py in Rhel8.4 with Avocado (version: 93.0), it shows “FAIL: Failed to set drive to online state”. HOT 1
- After running xfstests.py in Rhel8.4 OS with Avocado (version: 93.0), Rhel8.4 OS will automatically reboot and can't complete the test of xfstests.py. HOT 3
- When using disk_info.py to test NVMe-SSD in Rhel8.2 with Avocado (version: 94.0), it shows "\nGiven disk nvme11n1 is not present in lshw -c disk | grep -i nvme11n1\nGiven disk nvme11n1 not having uuid". HOT 1
- When using module_unload_load.py to test NVMe-SSD in Rhel8.3 with Avocado (version: 94.0), it shows "FAIL: Failed Modules: ['nvme']". HOT 1
- When using nvme_cli_selftests.py to test NVMe-SSD in Rhel8.3 with Avocado (version: 94.0), nvme_compare_test and nvme_smart_log_test are FAIL, but Manual-Test are PASS. HOT 1
- When using nvmetest.py to test NVMe-SSD in Rhel8.3 with Avocado (version: 94.0), it shows "ERROR: Command 'make' failed" and "CANCEL: /dev/nvme11n1 does not exist". HOT 1
- bonding.py : bonding tests fails for active-backup tests HOT 1
- multipath_test.py: Need proper clean up of paths after each tests run HOT 1
- After running nvme_cli_selftests.py in Rhel8.4, “run-test-nvme_compare_test-1521” & “run-test-nvme_get_features_test-0994” are FAIL HOT 1
- After running nvmetest.py in Rhel8.4, it shows “No such file or directory: './NVME-VERSION-GEN'” HOT 1
- pread fail case in random test code while running in multiple threads HOT 7
- perf_uprobe error handling HOT 1
- Stress-ng Failing HOT 5
- fio-pmem test failing HOT 2
- Run failed: xfstests - iommu (cba565f) HOT 6
- fio: Move pmem create code out of fio test HOT 3
- Need for Basic sanity check for yaml files in Travis CI HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from avocado-misc-tests.