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

Fix tests for django-filter 1.0.0 #122

Merged
merged 3 commits into from Nov 22, 2016

Conversation

blueyed
Copy link
Contributor

@blueyed blueyed commented Nov 22, 2016

Fixes #120.

@coveralls
Copy link

coveralls commented Nov 22, 2016

Coverage Status

Coverage remained the same at 99.63% when pulling d4c3aa5 on blueyed:fix-filter-tests into 7c92536 on djangonauts:master.

@@ -2,5 +2,5 @@ psycopg2
djangorestframework>=3.3
coverage==3.7.1 # rq.filter: >=3,<4
coveralls
django-filter>=0.15,<1.0
django-filter
Copy link
Member

Choose a reason for hiding this comment

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

with experience I've learnt that restricting the versions in use is good, especially when the dependencies introduce backward incompatible changes.
This line doesn't affect the library during installation but only in travis builds, this will avoid our builds to break if a new (unsupported yet) version of django-filter intrdocues backward incompatible changes.

Therefore I would put django-filter>=0.15,<1.1

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 think it's good to be notified in case of issues with new upstream versions.

Copy link
Member

Choose a reason for hiding this comment

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

immagine the case in which we receive a bug free pull request and the build fails because of a new incompatible version of django-filter: that's annoying, because the pull request works and can be merged but the CI build would fail.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I know.. but it helps with being notified.
I can see your point though, so feel free to pin it.
(As for myself as a PR submitter, in case I notice that it fails because of something minor, I often just create another PR to fix it, too)

As for pytest-django we also test against Django master, but that job is allowed to fail: when there are several jobs you can see what the cause of the failure is more easily.
So an option might also be to test against pinned and unpinned versions of django-filter (possibly via #123).

@@ -132,10 +132,12 @@ class GeojsonLocationNoIdDetails(generics.RetrieveUpdateDestroyAPIView):


class LocationFilter(GeoFilterSet):
contains_properly = GeometryFilter(name='geometry', lookup_type='contains_properly')
Copy link
Member

Choose a reason for hiding this comment

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

Are you sure removing lookup_type='contains_properly doesn't break compatibility with older django-filter versions?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is only for the test.
So as long as you do not want test against older django-filter versions this should be fine.

Copy link
Member

Choose a reason for hiding this comment

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

Right

@@ -429,10 +429,6 @@ Example result response (cut to one element only instead of 10):
Filters
-------

**note**: this feature is compatible with django-filter up to version 0.15.
Copy link
Member

Choose a reason for hiding this comment

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

I would leave something like: "this feature has been tested up to django-filter 1.0".

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 would not mention that explicitly: it needs updating later etc.

Copy link
Member

Choose a reason for hiding this comment

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

The library (documentation, tests, changelog) needs to be updated anyway at each release. If django-filter becomes stable and won't introduce backward incompatible changes I wouldn't mind deleting the note, but this dependency has caused quite a few issues recently and I prefer to do it this way.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Heh.. the reason for 1.0.0 is exactly to become stable - all the deprecations have been dropped.

Copy link
Member

Choose a reason for hiding this comment

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

That's right, in theory. Let's see if it also translates into practice.

@nemesifier
Copy link
Member

thx @blueyed, I left some inline comments to lines I think may be improved. Let me know what you think.

Avoid build breakage by eventual backward incompatible
changes introduced in django-filter future versions.
@@ -429,10 +429,6 @@ Example result response (cut to one element only instead of 10):
Filters
-------

**note**: this feature is compatible with django-filter up to version 0.15.
Copy link
Member

Choose a reason for hiding this comment

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

The library (documentation, tests, changelog) needs to be updated anyway at each release. If django-filter becomes stable and won't introduce backward incompatible changes I wouldn't mind deleting the note, but this dependency has caused quite a few issues recently and I prefer to do it this way.

@coveralls
Copy link

coveralls commented Nov 22, 2016

Coverage Status

Coverage remained the same at 99.63% when pulling fa4d902 on blueyed:fix-filter-tests into 7c92536 on djangonauts:master.

@coveralls
Copy link

coveralls commented Nov 22, 2016

Coverage Status

Coverage remained the same at 99.63% when pulling bd75b1d on blueyed:fix-filter-tests into 7c92536 on djangonauts:master.

4 similar comments
@coveralls
Copy link

Coverage Status

Coverage remained the same at 99.63% when pulling bd75b1d on blueyed:fix-filter-tests into 7c92536 on djangonauts:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 99.63% when pulling bd75b1d on blueyed:fix-filter-tests into 7c92536 on djangonauts:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 99.63% when pulling bd75b1d on blueyed:fix-filter-tests into 7c92536 on djangonauts:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 99.63% when pulling bd75b1d on blueyed:fix-filter-tests into 7c92536 on djangonauts:master.

@nemesifier nemesifier merged commit 6c986b0 into openwisp:master Nov 22, 2016
@nemesifier
Copy link
Member

Merged, thx @blueyed!

@blueyed
Copy link
Contributor Author

blueyed commented Nov 22, 2016

@nemesisdesign
Thank you, too!

@blueyed blueyed deleted the fix-filter-tests branch November 22, 2016 17:47
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.

None yet

3 participants