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

Add MessagePack support to the test client #1026

Open
kgriffs opened this issue Apr 25, 2017 · 15 comments · May be fixed by #2394
Open

Add MessagePack support to the test client #1026

kgriffs opened this issue Apr 25, 2017 · 15 comments · May be fixed by #2394
Labels
enhancement good first issue Comment on this issue if you'd like to volunteer to work on this. Thanks!

Comments

@kgriffs
Copy link
Member

kgriffs commented Apr 25, 2017

Note: When doing this, msgpack-python must be added as an extra dependency (see also #333) so that those who don't want to bring it in are not forced to do so.

@kgriffs kgriffs added this to the Version 1.3 milestone Apr 25, 2017
@kgriffs kgriffs added the needs contributor Comment on this issue if you'd like to volunteer to work on this. Thanks! label Apr 26, 2017
@kgriffs kgriffs removed the needs contributor Comment on this issue if you'd like to volunteer to work on this. Thanks! label May 19, 2017
@vytas7 vytas7 added good first issue Comment on this issue if you'd like to volunteer to work on this. Thanks! Hacktoberfest labels Oct 7, 2021
@vytas7 vytas7 added the needs contributor Comment on this issue if you'd like to volunteer to work on this. Thanks! label Apr 1, 2022
@codeofhk
Copy link

@vytas7 I Would like to contribute , can you explain a bit the problem ?

@vytas7
Copy link
Member

vytas7 commented Jun 3, 2023

Hi @hk-madhu!
At the time of writing, you can pass an object as json parameter to the test client's simulate_request() & friends, and it would be automatically serialized, Content-Type set up for you, etc, before passing the payload to the app.

I assume this issue aims to deliver that same functionality for testing APIs that leverage Msgpack instead of (or in addition to) JSON.

@arthurprioli
Copy link

arthurprioli commented Oct 9, 2024

Hi, after checking some issues, I would like to take this one, is there somebody contributing?

@CaselIT
Copy link
Member

CaselIT commented Oct 9, 2024

I don't think so. Feel free to work on it!

@CaselIT CaselIT removed the needs contributor Comment on this issue if you'd like to volunteer to work on this. Thanks! label Oct 9, 2024
@arthurprioli
Copy link

Ok, is there any extra information I need to know to start working on it?

@CaselIT
Copy link
Member

CaselIT commented Oct 9, 2024

I don't think so. Feel free to ask if you have questions

@arthurprioli
Copy link

How do I start tackling this problem? Should I do it on tox setup? Sorry if the questions seem simple, but this is my first time contributing on an open source project.

@vytas7
Copy link
Member

vytas7 commented Oct 9, 2024

Hi @arthurprioli, no worries, these are valid questions!
First, you could just try to write a simple (hello-world like) Falcon app, and try running it, just to get a feeling of how to glue things together. Then, you can try writing a simple test using our test client, and running it with pytest.

For development of the framework itself, it is probably easiest to use an "editable" install so that you can run isolated tests even outside of tox:

$ FALCON_DISABLE_CYTHON=Y pip install -e .

Then, when you are comfortable with the very basics, check our contributor's guide: Contribute to Falcon.

Let us know if you have any other further questions!

@arthurprioli
Copy link

Hey guys, sorry I took long to answer, we had a small holiday here in Brazil and I had a small travel. I'm currently finishing the get started tutorial on Falcon's official documentation, so I made some tests with pytest. I also read on how to contribute to Falcon. My question is: how should I start this issue? In order to add MessagePack support to the TestClient?

@arthurprioli
Copy link

Hello guys, I took a bigger look on the source code and searched the web a bit about how to add dependencies as extra. Also read #333. What is setuptools? And what files should I take a look in order to add msgpack-python as an extra dependencie?

@vytas7
Copy link
Member

vytas7 commented Oct 18, 2024

Hi again @arthurprioli, no, we don't want to add any hard dependencies on any 3rd party libraries.
Could you check how MessagePackHandler is currently implemented for inspiration?

@arthurprioli
Copy link

Hello @vytas7, just took a look at it and also read how simulate_request() works. Should I create an additional msgpack parameter there and serialize with MessagePackHandler in other correlated functions?

@arthurprioli
Copy link

Hey guys, i've tried something here, in simulate_requests, I added a new parameter msgpack and did a treatment similar to json, but instead of using the msgpack-python directly I used MessagePackHandler.

image

@arthurprioli
Copy link

Hey guys, sorry if I'm sending a lot of messages, I documented the parameter msgpack added yesterdar and was running a few tox tests, but I'm not sure how to interpret the results showed on my terminal and how should I create some test to that new funcionality. Here follows a picture of the tox tests return.
image

@vytas7
Copy link
Member

vytas7 commented Oct 19, 2024

Hi @arthurprioli, it is okay that you share information and ask questions, but please don't send text blocks as images, that's something I really don't like 👿

As to your issues, so ruff and pep8 are just formatting. Please read the contributor's guide on how to resolve these.

coverage probably means that your newly added code is not fully covered by the tests. There should be concrete lines and branches in the report table that you get.

Maybe you could join us on Gitter (falconry/dev) to discuss these issues more in realtime?

@arthurprioli arthurprioli linked a pull request Oct 28, 2024 that will close this issue
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement good first issue Comment on this issue if you'd like to volunteer to work on this. Thanks!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants