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

Tests for /explain API #3806

Closed
marionschleifer opened this issue Jan 31, 2020 · 11 comments
Closed

Tests for /explain API #3806

marionschleifer opened this issue Jan 31, 2020 · 11 comments
Labels
c/server Related to server good first issue Good for newcomers help wanted Good candidate for contribution. Community help wanted!

Comments

@marionschleifer
Copy link
Contributor

marionschleifer commented Jan 31, 2020

We need to add tests for the /explain API.

Docs for explain API: https://hasura.io/docs/1.0/graphql/manual/api-reference/explain.html

The point of this issue is that we currently have a test suite, in the server/tests-py/ directory, for the backend, which tests input-output behavior for a variety of queries including many GraphQL queries. However, the v1/graphql/explain API, which is used to run the Analyze feature in the console, is not tested at the moment. This can be fixed by writing a handful of tests that call the Explain API, and compare received output with expected output. The above documentation can be used for some inspiration for sample queries which should certainly work (i.e. should be tested).

@marionschleifer marionschleifer added help wanted Good candidate for contribution. Community help wanted! good first issue Good for newcomers c/server Related to server labels Jan 31, 2020
@marionschleifer marionschleifer changed the title Tests for `/explain' API Tests for /explain API Jan 31, 2020
@jmakhack
Copy link

@marionschleifer, I'd like work on this issue. Can you assign it to me?

@marionschleifer
Copy link
Contributor Author

@jmakhack as explained in our Hacktoberfest blogpost, we don't assign issues. However, it doesn't seem that anyone else is working on this, so feel free to take it up and link a PR to this issue 🙂

@jmakhack
Copy link

jmakhack commented Nov 1, 2020

I've been hitting many issues with cabal no being able to resolve dependencies for this project so just want to update that I am currently not actively looking into this issue and it is up for grabs for anyone else to take on.

@harshxtanwar
Copy link

@Stefmore02 can I get assigned to this issue ? I'd love to work on it.

@marionschleifer
Copy link
Contributor Author

@harshxtanwar feel free to pick this up. We don't assign issues. The PR that is submitted first will also be the one to be reviewed first 🙂 so far, nobody has raised a PR on this.

@chaiwattsw
Copy link

chaiwattsw commented Oct 31, 2022

@marionschleifer Do you have test that I can reference to write explain api ?

@marionschleifer
Copy link
Contributor Author

@chaiwattsw unfortunately not. Writing tests for the Explain API is another Hacktoberfest issue.

@JoelleNdiriraMusangie
Copy link

Bonjour, Hello, does any body do the test or I can do it? thank you.

@JoelleNdiriraMusangie
Copy link

Good morning @marionschleifer ,

I started implementing the tests with pytest.
I installed all the requirements from the requierements.txt file. But dependence sqlalchemy
gives me an error despite updating the version even installing sqlacodegen. Do you have any idea of ​​the source of these errors that i have?
here is an excerpt of the error , thank you.

================================================== test teardown duration top ===================================================
total name num avg min
0:00:00 grand total 4 0:00:00 0:00:00
==================================================== short test summary info ====================================================
ERROR test_explain_api.py::test_successful_query - sqlalchemy.exc.NoSuchModuleError: Can't load plugin: sqlalchemy.dialects:pos...
ERROR test_explain_api.py::test_invalid_query - sqlalchemy.exc.NoSuchModuleError: Can't load plugin: sqlalchemy.dialects:postgres
ERROR test_explain_api.py::test_missing_operation_name - sqlalchemy.exc.NoSuchModuleError: Can't load plugin: sqlalchemy.dialec...
ERROR test_explain_api.py::test_unauthorized_access - sqlalchemy.exc.NoSuchModuleError: Can't load plugin: sqlalchemy.dialects:...
======================================================= 4 errors in 2.06s =======================================================

@marionschleifer
Copy link
Contributor Author

Thank you for your efforts @JoelleNdiriraMusangie. This issue is actually not relevant anymore since tests for the /explain API have already been added 🙂

@JoelleNdiriraMusangie
Copy link

Okay, thank you for closing this issue in this case because otherwise many will have had the pleasure of working there like me :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c/server Related to server good first issue Good for newcomers help wanted Good candidate for contribution. Community help wanted!
Projects
None yet
Development

No branches or pull requests

8 participants