Skip to content
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.

Provide ability to skip a test based on the runtime being used #59

Closed
jodh-intel opened this issue Jan 30, 2018 · 2 comments
Closed

Provide ability to skip a test based on the runtime being used #59

jodh-intel opened this issue Jan 30, 2018 · 2 comments
Labels
stale Issue or PR was not updated in a timely fashion

Comments

@jodh-intel
Copy link
Contributor

Currently, some of the tests make use of Skip() (ginkgo). At some future point they will also be using skip (bats) too. These calls skip the tests unconditionally. However, we are likely to need ways to skip a test but only for particular runtime(s) [1]:

Something like:

if kata.Runtime("cc") {
    Skip("Issue: ...")
}

We should also support any:

if kata.Runtime("any") {
    Skip("Issue: ...")
}

... and maybe a regex like:

if kata.Runtime("cc|runv") {
    Skip("Issue: ...")
}

We'll need kata.Runtime(name string) to check to see which runtime the kata-runtime symlink actually points to. If the link name ends in -cc [2], it's a Clear Containers-based runtime, else runv.

We can then compare the fully resolved value of the Runtime path with the runtime type the test is requesting be skipped and return true/false as appropriate.


[1] - runtime names should be specified using the same syntax as used for the build. Namely cc or runv (or all). See kata-containers/runtime#16.
[2] - Or, run the runtime and check for a known string such as:

$ kata-runtime --help | grep -q clearcontainers
@grahamwhaley
Copy link
Contributor

Just a thought, not sure if we can use it here - but, I have seen another project using the golang build constraints to mark which test files are runnable dependant on which variant is being built:
https://golang.org/pkg/go/build/#hdr-Build_Constraints

Just putting that out there as a potential slightly higher level option for if we get any tests that fall into that sort of build dependent category.

@egernst
Copy link
Member

egernst commented Jul 17, 2019

we only have kata-runtime now -- let's close this. No need to add this complexity.

@egernst egernst added the stale Issue or PR was not updated in a timely fashion label Jul 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
stale Issue or PR was not updated in a timely fashion
Projects
None yet
Development

No branches or pull requests

3 participants