Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Tests #7

Open
Fogapod opened this issue Sep 30, 2019 · 19 comments
Open

Tests #7

Fogapod opened this issue Sep 30, 2019 · 19 comments
Assignees
Labels
enhancement New feature or request tests Related to tests

Comments

@Fogapod
Copy link
Member

Fogapod commented Sep 30, 2019

Tests using mock, maybe tests involving real redis in travis, coverage

@Fogapod Fogapod added the enhancement New feature or request label Sep 30, 2019
@Fogapod Fogapod self-assigned this Sep 30, 2019
@Fogapod Fogapod added the tests Related to tests label Sep 30, 2019
@suv27
Copy link
Contributor

suv27 commented Oct 2, 2019

Can you assign this issue to me, I just started working on it and would like to contribute and start the unit tests and set up everything correctly

@Fogapod
Copy link
Member Author

Fogapod commented Oct 2, 2019

Alright, it would be very helpful if you could do this

@Fogapod Fogapod assigned suv27 and unassigned Fogapod Oct 2, 2019
@Fogapod
Copy link
Member Author

Fogapod commented Oct 2, 2019

I apoligize for the inconveniences, but several breaking changes had to be made. All changes are reflected in existing examples.
Changes:

  • Server.respond -> Request.reply
  • Removed Server argument in callbacks. It can be accessed using Request.server
  • Removed flatten method of responses. It was replaced with plain __await__
  • Client.run -> Client.start
  • Server.run -> Server.start

@suv27
Copy link
Contributor

suv27 commented Oct 2, 2019

Were these changes made already? are they made into the master branch, if they are I can definitely pull and it shouldn't be a problem.

I am currently working on getting everything set up, the coverage page for the test and all the .py files. and then starting to unit test one by one python file.

@Fogapod
Copy link
Member Author

Fogapod commented Oct 2, 2019

Yes, they are in master

@suv27
Copy link
Contributor

suv27 commented Oct 4, 2019

I am having some issue working with Travis CI since is my first time, I am getting an error for in the virtualenv for Travis that is not recognizing one of my import. Maybe you can provide me some help or guidelines if you have seen this before, if not I will keep debugging

___________ ERROR collecting tests/unit/enums_py/StatusCode_test.py ____________ ImportError while importing test module '/home/travis/build/IOMirea/yarpc/tests/unit/enums_py/StatusCode_test.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: tests/unit/enums_py/StatusCode_test.py:3: in <module> from iomirea_rpc import enums E ModuleNotFoundError: No module named 'iomirea_rpc'

@Fogapod
Copy link
Member Author

Fogapod commented Oct 4, 2019

Sorry for that, library was renamed to yarpc recently

@suv27
Copy link
Contributor

suv27 commented Oct 4, 2019

No worries I restarted and using pytests as you want it

suv27 added a commit to suv27/jarpc that referenced this issue Oct 4, 2019
suv27 added a commit to suv27/jarpc that referenced this issue Oct 4, 2019
suv27 added a commit to suv27/jarpc that referenced this issue Oct 5, 2019
suv27 added a commit to suv27/jarpc that referenced this issue Oct 5, 2019
suv27 added a commit to suv27/jarpc that referenced this issue Oct 5, 2019
suv27 added a commit to suv27/jarpc that referenced this issue Oct 5, 2019
suv27 added a commit to suv27/jarpc that referenced this issue Oct 5, 2019
suv27 added a commit to suv27/jarpc that referenced this issue Oct 5, 2019
suv27 added a commit to suv27/jarpc that referenced this issue Oct 5, 2019
suv27 added a commit to suv27/jarpc that referenced this issue Oct 5, 2019
suv27 added a commit to suv27/jarpc that referenced this issue Oct 5, 2019
suv27 added a commit to suv27/jarpc that referenced this issue Oct 5, 2019
@suv27
Copy link
Contributor

suv27 commented Oct 7, 2019

Hey @Fogapod, let me know if you feel this my PR #22 is missing anything to resolve thIS issue.

suv27 added a commit to suv27/jarpc that referenced this issue Oct 7, 2019
suv27 added a commit to suv27/jarpc that referenced this issue Oct 8, 2019
suv27 added a commit to suv27/jarpc that referenced this issue Oct 9, 2019
suv27 added a commit to suv27/jarpc that referenced this issue Oct 9, 2019
Fogapod pushed a commit that referenced this issue Oct 11, 2019
@Fogapod
Copy link
Member Author

Fogapod commented Oct 12, 2019

@Physsix27 are you going to write tests or you only wanted to configure make, Travis?

@suv27
Copy link
Contributor

suv27 commented Oct 12, 2019

Yes I want to continue writing tests but right now I am not going to be able to bring the project to 100% coverage, I can just write test for some python files. I can write tests for request.py, reponse.py and abc.py and bring those 3 files up to 100% coverage.
This is how they are currently looking:
image

@suv27
Copy link
Contributor

suv27 commented Oct 13, 2019

I will work on the tests later today for the files I mentioned above

@Gelbpunkt
Copy link
Collaborator

I'd suggest testing against a real redis install via docker in Travis.

@suv27
Copy link
Contributor

suv27 commented Oct 13, 2019

@Gelbpunkt Can I get a little more detail about that and what is that since I have never done that?

@Gelbpunkt
Copy link
Collaborator

@Fogapod does not like my idea, I think.
Docker is a container daemon that runs on almost all platforms. It runs stuff mostly isolated from your OS. You can for example run Ubuntu or Alpine Linux in a container on a Mac. Inside a container, you can have an image. Those can be a basic OS or even contain software, for example Redis.

https://hub.docker.com/_/redis

You'd run docker pull redis:5.0.6-alpine to pull the image to your PC (using Alpine Linux has smaller images usually).
Then you can run it and map the port inside the container to your PC.
docker run --rm -d --name redis -p 6739:6739 redis:5.0.6-alpine
This will start a container in the background which runs Redis on the container, mapping the port to your PC.

You can then use redis-cli on your machine to connect to the redis in the container.

Containers are platform-independent (mostly), usually very up to date, depending on the image, and extremely secure due to being mostly separate from the host.

Hope that helps ;)

@suv27
Copy link
Contributor

suv27 commented Oct 13, 2019

I don't understand what you want me to do, which looks like a different issue which I don't understand much and would have to do some research to learn more about that topic. I want it to do more python tests because that is the skill I am currently trying to improve. but what you are explaining seems a little different and does not specifies what is it that I need to test. Testing against a real redis I am not sure what that means. @Gelbpunkt

@Gelbpunkt
Copy link
Collaborator

I meant that we should maybe think about not using mocks but instead using a Redis with client and server to test them

@suv27
Copy link
Contributor

suv27 commented Oct 13, 2019

@Gelbpunkt I understand what you are trying to say but you still need to test the python code of the project as well no matter which path you take, that would be a decision of the project owner to take.
What would be its advantage and disadvantages with going with one or another

@Fogapod
Copy link
Member Author

Fogapod commented Nov 3, 2019

@Physsix27 Is there any more progress on this?
I should inform you that project was renamed from yarpc to jarpc. I hope this won't happen anymore

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request tests Related to tests
Projects
None yet
Development

No branches or pull requests

3 participants