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

Program exit successfully if path doesn't contain any test #21

Open
jlausuch opened this issue Mar 20, 2019 · 2 comments
Open

Program exit successfully if path doesn't contain any test #21

jlausuch opened this issue Mar 20, 2019 · 2 comments
Labels
bug Something isn't working

Comments

@jlausuch
Copy link
Owner

jlausuch commented Mar 20, 2019

When the path given by the parameter --test or -t exists but it doesn't contain any .py, the program exits with success message:

mkdir /tmp/somedir
qatrfm -t /tmp/somedir --tfvar image=$image     
INFO     qatrfm.cli  : All tests passed

It should actually exit with "No test files found" or similar with exit code !=0

@jlausuch jlausuch added the bug Something isn't working label Mar 20, 2019
@jlausuch
Copy link
Owner Author

I also noticed, that if you give a directory which contains any .py file, it will try to execute it. So we should really make sure that the Class we load and execute has inheritance from TrfmTestCase

@asmorodskyi
Copy link
Collaborator

execution of qatrfm --test s
will produce following output :

 File "/usr/bin/qatrfm", line 10, in <module>
    sys.exit(cli())
  File "/usr/lib/python3.6/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3.6/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/asmorodskyi/source/team/qatrfm-lib/qatrfm/cli.py", line 153, in cli
    testcases = find_testcases(Path(test))
  File "/home/asmorodskyi/source/team/qatrfm-lib/qatrfm/cli.py", line 90, in find_testcases
    return load_testcases(basedir, files)
  File "/home/asmorodskyi/source/team/qatrfm-lib/qatrfm/cli.py", line 67, in load_testcases
    tf_file = find_corresponding_tf_file(i)
  File "/home/asmorodskyi/source/team/qatrfm-lib/qatrfm/cli.py", line 40, in find_corresponding_tf_file
    assert(f.is_file())
AssertionError

the problem here that with --test param we somehow getting into failure related to tf file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants