nikitastupin / clairvoyance

Obtain GraphQL API schema even if the introspection is disabled
Apache License 2.0
1.02k stars 92 forks source link

Errors running tests #18

Closed Regala closed 3 years ago

Regala commented 3 years ago

Hi! Awesome project 🙏

Was trying to do python3 -m unittest tests/*_test.py using main branch and am getting:

======================================================================
ERROR: graphql_test (unittest.loader._FailedTest)
----------------------------------------------------------------------
ImportError: Failed to import test module: graphql_test
Traceback (most recent call last):
  File "/usr/local/Cellar/python@3.9/3.9.4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/unittest/loader.py", line 154, in loadTestsFromName
    module = __import__(module_name)
ModuleNotFoundError: No module named 'tests.graphql_test'

======================================================================
ERROR: oracle_test (unittest.loader._FailedTest)
----------------------------------------------------------------------
ImportError: Failed to import test module: oracle_test
Traceback (most recent call last):
  File "/usr/local/Cellar/python@3.9/3.9.4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/unittest/loader.py", line 154, in loadTestsFromName
    module = __import__(module_name)
ModuleNotFoundError: No module named 'tests.oracle_test'

----------------------------------------------------------------------
Ran 2 tests in 0.000s

FAILED (errors=2)

unittest package is included by default so no problem there:

fisher@Fishers-MBP clairvoyance % python -m unittest

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

OK

On Python 3.9.4

Any idea?

Also since I haven't been able to actually play around with the tool, can we use the generated file (-o) as input in subsequent runs?

Thanks!

nikitastupin commented 3 years ago

Hey @Regala! Thanks for your feedback!

Was trying to do python3 -m unittest tests/*_test.py using main branch and am getting:

I'm not sure why you're getting this error. It works fine for me.

clairvoyance $ python3 -m unittest tests/*_test.py
./Users/nikitastupin/Library/Python/3.9/lib/python/site-packages/urllib3/util/retry.py:252: DeprecationWarning: Using 'method_whitelist' with Retry is deprecated and will be removed in v2.0. Use 'allowed_methods' instead
  warnings.warn(
...................../Users/nikitastupin/Library/Python/3.9/lib/python/site-packages/urllib3/util/retry.py:252: DeprecationWarning: Using 'method_whitelist' with Retry is deprecated and will be removed in v2.0. Use 'allowed_methods' instead
  warnings.warn(
..
----------------------------------------------------------------------
Ran 24 tests in 2.057s

OK
clairvoyance $ python3 --version
Python 3.9.4

Did you run above command from clairvoynace directory?

Also since I haven't been able to actually play around with the tool, can we use the generated file (-o) as input in subsequent runs?

Yes, it should be possible 😃 Just use -i parameter.

Regala commented 3 years ago

OK! So I just tried on Kali and it works.. might be a problem with python versions? Kali -> Python 3.8.6 ✅ Mac -> Python 3.9.4 ❌ Debian -> Python 3.6.0

Anyway it's enough for me to play with! Do you recommend any vulnerable server to play with, or should I just try with one of the tests bundled 🤔 I saw https://github.com/nikitastupin/clairvoyance/issues/16 and not sure if it's completely working on that example.

Cheers!

nikitastupin commented 3 years ago

The first one that pops up in my mind is https://github.com/graphql/swapi-graphql. The second one is https://hackerone.com/semrush, unfortunately I can't remember the exact endpoint.

nikitastupin commented 3 years ago

Mac -> Python 3.9.4

That's strange. The test I've showed above was performed on Mac with Python 3.9.4 and it worked fine 🤔

nikitastupin commented 3 years ago

Closing this one because I can't reproduce the bug. Feel free to reopen the issue or ping me in case if the bug is still present!