PyJaipur / PyJudge

Simple Programming Contest hosting software
MIT License
17 stars 29 forks source link

WIP: Simple functional tests for the server #78

Closed theSage21 closed 5 years ago

theSage21 commented 5 years ago

This introduces simple functional testing for the service. Intentionally we keep testing to a minimal. Only enough so that we know nothing is broken.

To run

pipenv install --deploy --dev
pipenv shell
python server.py &
pytest test_server.py 
HeroicHitesh commented 5 years ago

got this error. Is it because I was using project from browser and not git bash? screenshot 382 Do I need to create a local copy of project?

theSage21 commented 5 years ago

You have to create a local copy. Easiest way is to git clone

On Thu 7 Feb, 2019, 19:00 HeroicHitesh <notifications@github.com wrote:

got this error. Is it because I was using project from browser and not git bash? [image: screenshot 382] https://user-images.githubusercontent.com/37622734/52414453-64a96080-2b0a-11e9-9a01-6d0f96dd8647.png Do I need to create a local copy of project?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/PyJaipur/PyJudge/pull/78#issuecomment-461419045, or mute the thread https://github.com/notifications/unsubscribe-auth/AHVj0TVCbs4HmfNd3QnNPxJw0sDtFhhDks5vLCpggaJpZM4agtoT .

HeroicHitesh commented 5 years ago

You have to create a local copy. Easiest way is to git clone On Thu 7 Feb, 2019, 19:00 HeroicHitesh @.*** wrote: got this error. Is it because I was using project from browser and not git bash? [image: screenshot 382] https://user-images.githubusercontent.com/37622734/52414453-64a96080-2b0a-11e9-9a01-6d0f96dd8647.png Do I need to create a local copy of project? — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#78 (comment)>, or mute the thread https://github.com/notifications/unsubscribe-auth/AHVj0TVCbs4HmfNd3QnNPxJw0sDtFhhDks5vLCpggaJpZM4agtoT .

Cloned the repo still not working can you explain exact process like after cloning what we need to do? screenshot 385

theSage21 commented 5 years ago

The error is saying that the Pipfile is not present. That's what you are doing wrong. I think dir is the command which lists files in the folder you are in.

HeroicHitesh commented 5 years ago

The error is saying that the Pipfile is not present. That's what you are doing wrong. I think dir is the command which lists files in the folder you are in.

My bad I didn't read Readme.md file. I was to install pipenv. Also I think installing Bottle can be added as a step in Readme.md file

HeroicHitesh commented 5 years ago

I did python server.py and nothing came up. Is there something else I need to do? screenshot 388

theSage21 commented 5 years ago

Hmm. Pipenv install should have installed bottle. I'm traveling right now. Will look once I have a chance

On Sat 9 Feb, 2019, 08:06 HeroicHitesh <notifications@github.com wrote:

I did python server.py and nothing came up. Is there something else I need to do? [image: screenshot 388] https://user-images.githubusercontent.com/37622734/52515423-5742c200-2c41-11e9-9d79-a3de8949c37b.png

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/PyJaipur/PyJudge/pull/78#issuecomment-462005992, or mute the thread https://github.com/notifications/unsubscribe-auth/AHVj0b6ADgfMkUwOCaZ59ycCl4Vm4J7uks5vLjQegaJpZM4agtoT .

theSage21 commented 5 years ago

From the photo it seems pipenv did not find your pipfile. If you read what it's printing it creates a new pipfile. That does not happen for me.

✔ ~/PyJudge [master|✔]
09:09 $ pipenv install
Installing dependencies from Pipfile.lock (b3eb75)...
  🐍   ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 1/1 — 00:00:02
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.
✔ ~/PyJudge [master|✔]
09:10 $ p
Launching subshell in virtual environment…
 . /home/arjoonn/.local/share/virtualenvs/PyJudge-DxLYSkEA/bin/activate
✔ ~/PyJudge [master|✔]
09:10 $  . /home/arjoonn/.local/share/virtualenvs/PyJudge-DxLYSkEA/bin/activate
(PyJudge-DxLYSkEA) ✔ ~/PyJudge [master|✔]
09:10 $ python server.py
Bottle v0.12.16 server starting up (using WSGIRefServer())...
Listening on http://localhost:8080/
Hit Ctrl-C to quit.

^C(PyJudge-DxLYSkEA) ✔ ~/PyJudge [master|✔]
09:10 $
(PyJudge-DxLYSkEA) ✔ ~/PyJudge [master|✔]
09:10 $