Unify python plugin #793

Merged
merged 2 commits into from Sep 14, 2016

Conversation

Projects
None yet
3 participants
Contributor

SamYaple commented Sep 12, 2016

No description provided.

snapcraft/plugins/python.py
@@ -45,14 +45,15 @@
The python version to use. Valid options are: python2 and python3
@SamYaple

SamYaple Sep 12, 2016

Contributor

ignore this whole commit, its only here to allow me to work on, and test, this change without an ugly rebase when this patch merges

Contributor

SamYaple commented Sep 12, 2016

I think it is funny and want to point this out: https://coveralls.io/builds/7852962

All edited files are 100% coveraged covered, but the overall percentage of coverage has fallen. This check would pass if snapcraft was 100% coveraged. thats pretty funny to me

Collaborator

sergiusens commented Sep 13, 2016

It is funny, I am not a fan and we can ask @elopio (and he will say its to find dead test code most likely). But the fact that you unified tests means the total lines of code covered has reduced making the 100% mark harder to reach while still having the same amount of untested code.

Contributor

SamYaple commented Sep 13, 2016

Eh, I could always add in some filler code to make up some more lines...... :)

I am going to be working on a few more tests for the plugin in the future. Do proper unit tests against each function and mock all the rest. As it is right now, we are doing ok with the unit tests, but I feel they are more busy work to get coveralls to pass rather than useful.

I don't plan on doing that for this commit though.

Once #785 merges, I will rebase this and we can discuss what to do here.

Deprecate python2 and python3 plugins
* Test the python plugin directly, not through a versioned plugin
* Add deprecation messages to the python2 and python3 plugins
* Add tests for the stub python2 and python3 plugins

Can one of the admins verify this patch?

Can one of the admins verify this patch?

Contributor

SamYaple commented Sep 13, 2016

@elopio Over all coverage percentage has dropped due to the deduplication of the test suites, while code coverage has actually risen (in this case, they python plugins are now 100% coveraged). I believe that means we need to force merge this and ignore coveralls.

Thoughts?

Collaborator

sergiusens commented Sep 13, 2016

oh, I intend to ignore it indeed!

snapcraft/tests/test_plugin_python.py
@@ -0,0 +1,249 @@
+# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
+#
+# Copyright (C) 2015 Canonical Ltd
@sergiusens

sergiusens Sep 13, 2016

Collaborator

date needs fixing here

@SamYaple

SamYaple Sep 13, 2016

Contributor

how do you want it fixed? 2015-2016, or 2015, 2016

@sergiusens

sergiusens Sep 14, 2016

Collaborator

I personally prefer 2015-2016 as then it is just a one digit change to maintain, but I don't mind either.

@SamYaple

SamYaple Sep 14, 2016

Contributor

i do as well. it shall be so

Contributor

SamYaple commented Sep 13, 2016

Heh. ok.

Well the plugin is coming along quite nicely I think. It has (i believe) every feature I want now. I am goign to iron out the test suite a bit more and refactor a few sections, but functionally its solid for me now.

Collaborator

sergiusens commented Sep 14, 2016

Is there a bug for this?

Contributor

SamYaple commented Sep 14, 2016

Not that I know of. Is that a hard requirement?

Collaborator

sergiusens commented Sep 14, 2016

LP: #1623289

Contributor

SamYaple commented Sep 14, 2016

thanks

@sergiusens sergiusens merged commit 7b84dd8 into snapcore:master Sep 14, 2016

1 of 2 checks passed

coverage/coveralls Coverage decreased (-0.01%) to 98.018%
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@SamYaple SamYaple deleted the SamYaple:unify_python_plugin branch Sep 14, 2016

kalikiana pushed a commit to kalikiana/snapcraft that referenced this pull request Apr 6, 2017

Unify python plugin test (#793)
* Deprecate python2 and python3 plugins
* Test the python plugin directly, not through a versioned plugin
* Add deprecation messages to the python2 and python3 plugins
* Add tests for the stub python2 and python3 plugins

LP: #1623289
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment