Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFE add option to print absolute paths to found tests #7

Closed
hegerj opened this issue Mar 6, 2018 · 5 comments
Closed

RFE add option to print absolute paths to found tests #7

hegerj opened this issue Mar 6, 2018 · 5 comments

Comments

@hegerj
Copy link

hegerj commented Mar 6, 2018

Currently when searching for tests fmf returns relative paths:

# fmf /root/tests/ --brief --key test --filter component:libselinux
tests/upstream-tests/selinux/libselinux/setenforce
tests/upstream-tests/selinux/libselinux/getsebool

What I would like to see would be absolute paths:

# fmf /root/tests/ --brief --key test --filter component:libselinux --absolute_path
/root/tests/upstream-tests/selinux/libselinux/setenforce
/root/tests/upstream-tests/selinux/libselinux/getsebool

@jscotka
Copy link
Collaborator

jscotka commented Apr 4, 2018

this has to be solved very carefully. as discussed with @psss , this is very connected with virtual testcases, what has another location of self itself and what test: key means,
for this purpose this is connected with beaker, that there is directory and you don't care that in test: key there is for examle ./runtest.sh or make run what will do the same.
but in case there should be something usefull than just non-emty string, close to true value

@jscotka
Copy link
Collaborator

jscotka commented Apr 13, 2018

partially solved by: #16

@psss
Copy link
Collaborator

psss commented Apr 18, 2018

Yes, we need to make very clear how the path will be detected and how tests will be executed. There's is an initial draft of the proposed attributes on the Fedora wiki:

https://fedoraproject.org/wiki/CI/Metadata

Anyway, I think the new --format feature should probably cover this use case. See examples:

http://fmf.readthedocs.io/en/devel/examples.html#format

What do you think, Jakub?

@jscotka
Copy link
Collaborator

jscotka commented Apr 19, 2018

the best solution could be: add this new prefix, what leads to ivoked test (dirname + basename) #19 with this format feature

@psss
Copy link
Collaborator

psss commented Apr 25, 2018

Using the new --format option together with the Tree.root attribute this can be done:

> fmf examples/wget/ --key test --format '{}/{}/{}\n' \
  --value 'root' --value 'data.get("path") or name' --value 'data["test"]'

Path can be used to specify directory if it differs from the object name:

description: Check recursive download options
tags: [Tier2]
test: runtest.sh
path: wget/recursion

The results looks like this:

/home/psss/git/fmf/examples/wget/download/test/runtest.sh
/home/psss/git/fmf/examples/wget/recursion/runtest.sh
/home/psss/git/fmf/examples/wget/recursion/runtest.sh
/home/psss/git/fmf/examples/wget/protocols/ftp/runtest.sh
/home/psss/git/fmf/examples/wget/protocols/http/runtest.sh
/home/psss/git/fmf/examples/wget/protocols/https/runtest.sh

Closing as this general solution should cover the requested use case.

@psss psss closed this as completed Apr 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants