Autotools plugin: Set autogen.sh executable. #206

Merged
merged 1 commit into from Jan 7, 2016

Conversation

Projects
None yet
2 participants
Member

kyrofa commented Jan 6, 2016

This PR fixes LP: #1530995 by setting autogen.sh to be executable (if necessary). It also adds tests for the autotools plugin.

It will need to be backported to 1.x when approved.

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

sergiusens Jan 7, 2016

Collaborator

2016

snapcraft/tests/test_plugin_autotools.py
+ def test_schema(self):
+ schema = autotools.AutotoolsPlugin.schema()
+
+ # Check rosdistro property
@sergiusens

sergiusens Jan 7, 2016

Collaborator

this comment seems out of place 😉

snapcraft/tests/test_plugin_autotools.py
+ 'DESTDIR={}'.format(plugin.installdir)])
+ ])
+
+ @mock.patch('os.chmod')
@sergiusens

sergiusens Jan 7, 2016

Collaborator

why are you mocking os.chmod but actually creating the file?

It seems less error prone to not mock os.chmod and os.stat it

@kyrofa

kyrofa Jan 7, 2016

Member

Actually I think I found something even better-- test exactly what I'm trying to do: make autogen.sh runnable.

Member

kyrofa commented Jan 7, 2016

@sergiusens Alright I believe I've addressed your concerns here.

snapcraft/tests/test_plugin_autotools.py
+ patcher.start()
+ return output
+
+ return None
@sergiusens

sergiusens Jan 7, 2016

Collaborator

maybe remove this statement

In [1]: def a():
   ...:     pass
   ...: 

In [2]: a() is None
Out[2]: True

or return '' so it is consistent with what I believe output is (str)

@kyrofa

kyrofa Jan 7, 2016

Member

Ah, good catch. Fixed.

Autotools plugin: Set autogen.sh executable.
LP: #1530995

Signed-off-by: Kyle Fazzari <kyle@canonical.com>
Collaborator

sergiusens commented Jan 7, 2016

👍 feel free to merge once the tools are in; also, the commit message is missing the (Closes LP: #XXXXX) comment.

sergiusens added a commit that referenced this pull request Jan 7, 2016

Merge pull request #206 from kyrofa/bugfix/1530995/executable_autogen
Autotools plugin: Set autogen.sh executable.

@sergiusens sergiusens merged commit 209a587 into snapcore:master Jan 7, 2016

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.6%) to 89.756%
Details

@kyrofa kyrofa deleted the kyrofa:bugfix/1530995/executable_autogen branch Jan 7, 2016

smoser pushed a commit to smoser/snapcraft that referenced this pull request Sep 14, 2016

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

Merge pull request #206 from kyrofa/bugfix/1530995/executable_autogen
Autotools plugin: Set autogen.sh executable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment