Skip to content

Conversation

@rishabhKalakoti
Copy link
Contributor

@rishabhKalakoti rishabhKalakoti commented May 23, 2019

I made a custom CI configuration, not sure if this one is correct. I had a few problems.

  • pytest had to be run in pipenv. Therefore I had to add the installation commands (which I added under scripts). I think they should not be added under scripts, I found another implementation on the web using make, but could not implement it (made a lot of commits during testing so had to fork again, 'coz I got it messed up).
  • The present format in which tests are written, we have to run server.py first and then pytest, I think this can be done better, I found an implementation with https://pypi.org/project/WebTest/ which looks better to me. So I commented the tests and make a demo test case with assert 1==1
  • travis-ci would have to be added to PyJaipur/PyJudge by someone with admin access.

Roadmap:

  • configure travis-ci properly
  • formatting check with black in CI
  • test the bottle framework correctly (using WebTest maybe)
  • add more tests

This can be done in separate PRs too, because tests might mess things up :)

fixes #125

@rishabhKalakoti
Copy link
Contributor Author

As of now, its working fine on my repository.
(installation also as tests)

@rishabhKalakoti
Copy link
Contributor Author

@theSage21 I need help in better configuration settings for travis. Also what tests should I add apart from testing that the web server is running well.

@theSage21
Copy link
Member

hmm. I'm in a fix here.

  1. I don't have any experience with travis so help with that is going to be delayed
  2. I've usually built API servers which don't render html. we simply do an api level testing in that case. Again I'm lost here.

so ... I'll say let's do 2 things:

  1. code formatting checks
  2. api level checks
    • (if I asked for a contest is there some question in it?)
    • if I'm not logged in make sure I can't submit

@rishabhKalakoti
Copy link
Contributor Author

How do i check if a user is logged in? I got no idea how to handle cookies (they are part of browser) in testing (i will try googling). One fix I can do (not sure if it will work), is check for a user in database and then send form queries one by one as we do in the browser.

@rishabhKalakoti
Copy link
Contributor Author

rishabhKalakoti commented May 24, 2019

(if I asked for a contest is there some question in it?)
Can I check the above directly in the database?

@rishabhKalakoti
Copy link
Contributor Author

@theSage21 let's wrap this one here. I am a little busy and we are also changing the question/contest framework, so API tests can be covered after that. This one would be enough to setup CI with format check and server check. An admin will need to activate this repository for travis-ci to complete this.

@theSage21
Copy link
Member

@rishabhKalakoti why don't you set up travis for this repo. I've added you as an admin. Once you're done you can de-escalate your privileges to prevent accidental admin actions on the repo.

@rishabhKalakoti
Copy link
Contributor Author

@theSage21 I will get it done on Saturday.

@rishabhKalakoti rishabhKalakoti merged commit bd2336d into PyJaipur:master Jun 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Continuous testing needs to be added

2 participants