Skip to content
This repository has been archived by the owner on Jan 26, 2021. It is now read-only.

Create Base module for Tests #681

Merged
merged 1 commit into from
May 18, 2018

Conversation

Monal5031
Copy link
Contributor

Description

This PR aims to create a base module for Tests in root of project where all the tests will be written.

Fixes #674

Type of Change:

  • Code
  • Quality Assurance

Code/Quality Assurance Only

  • This change requires a documentation update (software upgrade on readme file)
  • New feature (non-breaking change which adds functionality pre-approved by mentors)

How Has This Been Tested?

Run the following command in root of project

python vms/manage.py test Tests/

Checklist:

Delete irrelevant options.

  • My PR follows the style guidelines of this project
  • I have performed a self-review of my own code or materials
  • I have commented my code or provided relevant documentation, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • Any dependent changes have been merged

Code/Quality Assurance Only

  • My changes generate no new warnings
  • My PR currently breaks something (fix or feature that would cause existing functionality to not work as expected)
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been published in downstream modules

@coveralls
Copy link

coveralls commented May 16, 2018

Coverage Status

Coverage remained the same at 42.435% when pulling fb302bd on Monal5031:relocate-tests into 39285b6 on systers:gsoc18-infra.

@Monal5031 Monal5031 added Priority: HIGH Program: GSOC Related to work completed during the Google Summer of Code Program. labels May 16, 2018
element.clear()
element.send_keys('pycon')
element.send_keys(Keys.RETURN)
self.assertNotIn('No results found.', self.driver.page_source)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No new line at the end in all the files.

Copy link
Contributor Author

@Monal5031 Monal5031 May 17, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Pycharm it shows those newline in all files, otherwise pep8 integrated in pycharm and codacy must've raised the same issue. 😕

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it's recommended by pep8, due to consistency in every line being terminated by '\n'.

Copy link
Contributor Author

@Monal5031 Monal5031 May 17, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I follow that rule, here is the screenshot of the file in pycharm which shows that there is a newline at end.
newline

I don't know why it isn't being shown here 😕

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you check if some other IDE/editor shows the newline too? Something like Sublime, VSCode, etc.?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay I'll check it, Thanks.

@naman1901
Copy link
Contributor

I'd like to merge this pull request on a priority basis, as another PR is blocked due to this. Can someone in the VMS team review or should I go ahead and merge? @ayushgarg1804

Copy link

@ayushgarg1804 ayushgarg1804 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since these are just basic tests to test the framework, my comments are regarding cosmetics only. Also please change to directory to "tests" all small.

@@ -0,0 +1,42 @@
# Third Party Imports

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find these comments redundant and making below imports harder to read. Are they even required?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can remove them, but it is a good practice to separate the type of imports namely (third-party, local-project, django)

# Django imports
from django.contrib.staticfiles.testing import LiveServerTestCase


Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra line

Copy link

@ayushgarg1804 ayushgarg1804 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems okay, merging now :)

@ayushgarg1804 ayushgarg1804 merged commit 4ebd3f5 into anitab-org:gsoc18-infra May 18, 2018
@Monal5031 Monal5031 deleted the relocate-tests branch May 18, 2018 16:41
@tapaswenipathak
Copy link
Contributor

Hey you all, I'm not able to keep up to VMS PR's and issue queue, but this should never have been merged.

What is the use of adding base test? In future this would further require cleanup and lowering the percentage and confusion for contributors. What does these tests test? Can anyone please link me to the use of having such test in a project like VMS. It is great to have thoughts from people having different level of understanding of Django, Tests, but PR's should be merged after getting a review from someone who is a bit more known to all these.

cc @systers/maintainers-vms @systers/admins.

@tonythomas01
Copy link
Contributor

python vms/manage.py test Tests/ seems like an out of the ordinary idea. Is the specific reasons to do this documented somewhere ?

@Monal5031
Copy link
Contributor Author

@tapasweni-pathak This was in my gsoc proposal (infrastructure/automation for web) that I'll start by creating a separate dir for Tests where in only tests corresponding to project will be maintained not a different repo itself.
Yes it will lower the coverage for sometime but its part of my gsoc to enhance it. This creation of structure followed by integrating selenium on travis (which it currently fails) will allow @anjali-dhanuka to write tests for her enhancements from start of gsoc itself.
Also for now to check if the new structure is working I have added dummy tests and did not move the original tests yet but I will as I progress through my gsoc and Sure I agree it'd great o have review from the maintainers on PRs like this.

@tonythomas01 since I'm relocating tests so the original command to run test wont work we have to give the new path where they are located and I have documented this in the next PR like how to run tests for this new structure.

@tonythomas01
Copy link
Contributor

tbh if this move is not critical to your GSoC project, I would recommend leaving it where it is though (and inside apps/tests/), rather than ending up in some issues later.

@Monal5031
Copy link
Contributor Author

@tonythomas01 @tapasweni-pathak Its not much needed change so I've reverted this change in my selenium integration PR.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Program: GSOC Related to work completed during the Google Summer of Code Program.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants