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

Add new plugin: rust #579

Merged
merged 20 commits into from Jul 27, 2016
Merged

Add new plugin: rust #579

merged 20 commits into from Jul 27, 2016

Conversation

mariogrip
Copy link
Contributor

This adds plugin for rust (https://www.rust-lang.org/)

@snappy-m-o
Copy link

Can one of the admins verify this patch?

1 similar comment
@snappy-m-o
Copy link

Can one of the admins verify this patch?

@mmstick
Copy link

mmstick commented Jun 17, 2016

Would very much like to see this as I have a hard time packaging my Rust applications without it.


properties = schema['properties']
self.assertTrue('rust-channel' in properties,
'Expected "rust-verion" to be included in properties')

Choose a reason for hiding this comment

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

Looks like there are some typos here and in the self.assertTrue statements below: verion where I presume version is usually meant ... ?

Although in the specific line above, it looks like it should be Expected "rust-channel"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed with 05fb2a4

mock.call([plugin._cargo, 'install',
'-j{}'.format(plugin.project.parallel_build_count),
'--root', plugin.installdir])
])
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice work so far!

Coveralls points out that you are missing some tests here. In line 84 of that Coveralls page for example, shows that there is no test for an invalid Rust channel.

I don't have commit access and Coveralls could be totally wrong, but I thought I should point it out just in case Coveralls is right.

@sergiusens
Copy link
Collaborator

Hi there, thank you very much for this. I have little to no idea how rust works, but seems you have an integration test and everything so kudos!

I added a few comments here and there, but this looks really good already!

@sergiusens
Copy link
Collaborator

Also, no need to push your branch to see if things pass, I bet turnaround time would be faster for the smaller tests by running ./runtests.sh static and ./runtests.sh unit

@sergiusens
Copy link
Collaborator

ok to test

@snappy-m-o
Copy link

Can one of the admins verify this patch?

from snapcraft.plugins import rust


class MakePluginTestCase(tests.TestCase):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe update the test case class name?

@sergiusens
Copy link
Collaborator

A rebase or update/merge branch with master and updating that trivial comment would be good. Going to say

ok to test

just in case something else is missing

@mariogrip
Copy link
Contributor Author

@sergiusens ready to test

@sergiusens
Copy link
Collaborator

@mariogrip oh, this has conflicts now :-/

If it is list plugins I guess that needs to be mocked! (our problem, not yours)

@mariogrip
Copy link
Contributor Author

@sergiusens I fixed the conflict :)

@sergiusens
Copy link
Collaborator

El sábado, 25 de junio de 2016 10h'24:28 ART, Marius Gripsgard
notifications@github.com escribió:

@sergiusens I fixed the conflict :)

Tests still fail though
So close...


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#579 (comment)

Enviado con Dekko desde mi dispositivo Ubuntu

@come-maiz
Copy link
Contributor

Thanks a lot for the great contribution!

This is missing tests for revision and channel, and for the clean pull. Let us know here or on IRC if you need a hand with this.

pura vida.

@come-maiz
Copy link
Contributor

I'm trying to use your plugin to build https://github.com/rolandshoemaker/theca
This is the error I get: https://paste.ubuntu.com/18598513/
Do you know about it? Is there something wrong in the project or in the plugin?

Here's my yaml: https://paste.ubuntu.com/18598588/

@snappy-m-o
Copy link

Can one of the admins verify this patch?

1 similar comment
@snappy-m-o
Copy link

Can one of the admins verify this patch?

@bgdncz
Copy link

bgdncz commented Jul 12, 2016

@ElOpio You need nightly rust to build that, not stable AFAIU (just add rust-channel: nightly I guess)

@snappy-m-o
Copy link

Can one of the admins verify this patch?

1 similar comment
@snappy-m-o
Copy link

Can one of the admins verify this patch?

@dholbach
Copy link
Contributor

Can the failing tests be retried? There was some interest in this: https://twitter.com/boghison/status/753144022445723648?cn=cmVwbHk%3D&refsrc=email

@come-maiz
Copy link
Contributor

First the conflicts need to be resolved.

@bgdncz
Copy link

bgdncz commented Jul 16, 2016

Hi! I resolved the conflicts and squashed the commits in 427e3a6, but I have test fails in test_commands_list_plugins.py, how could that be fixed?

@josepht
Copy link
Contributor

josepht commented Jul 21, 2016

@boghison I'm not seeing any test failures in test_commands_list_plugins.py with your branch. I didn't see any test failures at all.

@bgdncz
Copy link

bgdncz commented Jul 22, 2016

@josepht


======================================================================
FAIL: test_list_plugins_large_terminal (snapcraft.tests.test_commands_list_plugins.ListPluginsCommandTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/bogdan/snapcraft/snapcraft/tests/test_commands_list_plugins.py", line 43, in test_list_plugins_large_terminal
    self.assertEqual(fake_terminal.getvalue(), self.default_plugin_output)
AssertionError: 'ant [82 chars]ake  scons      \nautotools  cmake   go    gul[72 chars]nt\n' != 'ant [82 chars]ake  tar-content\nautotools  cmake   go    gul[65 chars]st\n'
Diff is 823 characters long. Set self.maxDiff to None to see it.

======================================================================
FAIL: test_list_plugins_non_tty (snapcraft.tests.test_commands_list_plugins.ListPluginsCommandTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/bogdan/snapcraft/snapcraft/tests/test_commands_list_plugins.py", line 36, in test_list_plugins_non_tty
    self.assertEqual(fake_terminal.getvalue(), self.default_plugin_output)
AssertionError: 'ant [82 chars]ake  scons      \nautotools  cmake   go    gul[72 chars]nt\n' != 'ant [82 chars]ake  tar-content\nautotools  cmake   go    gul[65 chars]st\n'
Diff is 823 characters long. Set self.maxDiff to None to see it.

======================================================================
FAIL: test_list_plugins_small_terminal (snapcraft.tests.test_commands_list_plugins.ListPluginsCommandTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/bogdan/snapcraft/snapcraft/tests/test_commands_list_plugins.py", line 57, in test_list_plugins_small_terminal
    self.assertEqual(fake_terminal.getvalue(), expected_output)AssertionError: 'ant [37 chars]der  scons      \nautotools  gradle  make    p[165 chars]  \n' != 'ant [37 chars]der  tar-content\nautotools  gradle  make    p[152 chars]  \n'
Diff is 666 characters long. Set self.maxDiff to None to see it.

----------------------------------------------------------------------
Ran 633 tests in 398.398s

FAILED (failures=3)

@mariogrip
Copy link
Contributor Author

Sorry for the lack of updates on this, i have been a bit busy.

Ok, so now at least travis build returns success.

But autopkgtest return error:

ERROR: test_pull (snapcraft.tests.test_plugin_rust.RustPluginTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 137, in _new_conn
    (self.host, self.port), self.timeout, **extra_kw)
  File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 91, in create_connection
    raise err
  File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 81, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

Anyone know why?

@josepht
Copy link
Contributor

josepht commented Jul 22, 2016

@mariogrip I think this when it's trying to download the rustup.sh script. @ElOpio are the autopkgtests run behind a firewall that might be blocking access to https://static.rust-lang.org/rustup.sh.

FWIW, the test passes for me locally.

@come-maiz
Copy link
Contributor

Yes they are behind a firewall. Let me request the exception.

@come-maiz
Copy link
Contributor

retest this please

@sergiusens sergiusens merged commit 24f1def into canonical:master Jul 27, 2016
kalikiana pushed a commit to kalikiana/snapcraft that referenced this pull request Apr 6, 2017
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

10 participants