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

Test cases not executed #16

Closed
aronmolnar opened this issue Jul 19, 2023 · 4 comments
Closed

Test cases not executed #16

aronmolnar opened this issue Jul 19, 2023 · 4 comments
Assignees
Milestone

Comments

@aronmolnar
Copy link
Contributor

Test cases are currently not executed in the GitHub CI pipeline:

Run python -m unittest discover -v

----------------------------------------------------------------------
Ran 0 tests in 0.000s

OK

python -m unittest discover -v was replaced by make.
However, the Makefile specifies the tests-directory explicitly. This means that tests cases of modules are no longer executed.

The test cases currently also fail due to failed imports (at least for my locally): ImportError: cannot import name 'Finding' from 'reptor.api.models'.

Adding __init__.py-files obviously fixes the problem.

During troubleshooting, I also realized that TypeAlias is available from python 3.10 and not compatible with 3.8.

/cc @richardschwabe

@aronmolnar aronmolnar self-assigned this Jul 19, 2023
@aronmolnar
Copy link
Contributor Author

I created a pull request that should now run 11 tests.

#17
https://github.com/Syslifters/reptor/actions/runs/5595542710/jobs/10231525038?pr=17

However, I was not able to fix the TypeAlias issue.

@richardschwabe
Copy link
Contributor

However, I was not able to fix the TypeAlias issue.
What is the exact case to reproduce the error?

I checked the fix-tests branch with python 3.8 - I had no issues running all unit tests.

❯ make test
python -m unittest discover -v
test_nikto_scan (reptor.plugins.community.Nikto.tests.test_nikto.TestXMLParseMethods) ... ok
test_format_nmap (reptor.plugins.core.Nmap.tests.test_nmap.NmapTests) ... ok
test_grepable_parse (reptor.plugins.core.Nmap.tests.test_nmap.NmapTests) ... ok
test_true (reptor.templates.Toolbase.tests.test_me.TestMyPlugin) ... ok
test_finding_data_extended (reptor.tests.test_api_models.TestModelsParsing) ... ok
test_finding_parsing (reptor.tests.test_api_models.TestModelsParsing) ... ok
test_finding_template_parsing (reptor.tests.test_api_models.TestModelsParsing) ... ok
test_project_design_parsing (reptor.tests.test_api_models.TestModelsParsing) ... ok
test_project_parsing (reptor.tests.test_api_models.TestModelsParsing) ... ok
test_user_parsing (reptor.tests.test_api_models.TestModelsParsing) ... ok
test_perfect_docs (reptor.tests.test_docparser.TestModelsParsing) ... ok

----------------------------------------------------------------------
Ran 11 tests in 0.024s

OK

❯ which python
/home/bs/.pyenv/shims/python

❯ pyenv local
3.8

@richardschwabe richardschwabe added this to the Alpha Release milestone Jul 19, 2023
@aronmolnar
Copy link
Contributor Author

richardschwabe pushed a commit that referenced this issue Jul 19, 2023
@richardschwabe
Copy link
Contributor

Agreed on working with typing.Any for now due to complications with Python < 3.10 and the TypeAlias and typing support in general.

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

2 participants