Skip to content

Feature request: Tests dependant on other tests #6131

@verdog

Description

@verdog

Is your feature request related to a problem? Please describe.
I am using avocado to test software that interfaces with 3rd party software. The 3rd party software sometimes comes with optional features implemented and sometimes without. I would like to write avocado tests that are smart enough to notice when the 3rd party software is missing a feature and skip tests for my software.

It's simple enough to write a function to check for the 3rd party feature and e.g. run it in setUp, but it starts to break down when you have multiple requirements. e.g. in addition to checking that the 3rd party software implements a feature, I would also like to sometimes check for an internet connection, the status of a dependent system daemon, filesystem, etc.

So I would like a solution that's more composable than a list of function in setUp. I would like to model the check as a test itself, and have dependent tests that only run if the first test passes, and have a build-system style solver that solves the test execution order for me (e.g. how you write dependencies in a Makefile and it schedules the build for you).

Describe the solution you'd like
I would like a way to mark a test (or function) as a dependency and a way to annotate a test as being dependent on it. In order for the test to run, the test needs to pass or the function needs to return true. I'd like to compose these requirements as needed for each test and have avocado figure out the test execution order for me. I run my tests in parallel whenever possible and would like to tell avocado "run the suite with a maximum parallelism of n tests, respecting dependencies".

Describe alternatives you've considered
The functions in setUp mentioned above.

I have searched the avocado documentations for this and see there is some notion of dependencies already, but they seem to only be about external packages.

Additional information
I did a brief search of the currently open issues for something like this but didn't find anything. If there's a duplicate issue, feel free to close this one and link it.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Long Term (Next Q) Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions