GithubHelp home page GithubHelp logo

gerritssh's People

Contributors

kdopen avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

gerritssh's Issues

Unit tests are not sufficient

  • This library talks via ssh to remote systems.
  • Unit tests necessarily mock out that communication so that they have few dependencies
  • But the remote systems can change independently
  • And the mocking may not represent reality, anyway

The net result is that things can break, without unit tests catching them.

That means we need some end-to-end tests as well, and these probably can't be run on travis-ci because: it won't have ssh keys for any public gerrit instances; I don't want to include a private key in the repo - even for testing; and, if they have any sense, they will limit what the tests can actually do in terms of contacting external systems. Without the latter, running a 'test' on travis-ci.org could be an easy way to create spambots, or DDOS attacks on third party sites.

So, this needs a second set of tests which are run only on the developer's machine. Options include

  • Testing against a known, public, instance such as review.openstack.org
  • Setting up a local gerrit instance (either on localhost, or a VM)

However, tests would need to run under tox so that we can python-version-specific bugs (like #3)

Possibly the tests should be in a separate project.

Query command throws TypeError under Python2.7

Performing any query which returns results gives:

Traceback (most recent call last):
  File "./gsshcli.py", line 239, in <module>
    execute(args)
  File "./gsshcli.py", line 123, in execute
    cmds[args.operation](site, args)
  File "./gsshcli.py", line 91, in query_cmd
    qry.execute_on(site)
  File "/Users/keith/PyProjects/gerritssh/gerritssh/query.py", line 123, in execute_on
    partial = partial_query()
  File "/Users/keith/PyProjects/gerritssh/gerritssh/query.py", line 118, in partial_query
    lines = self.text_to_json(raw)
  File "/Users/keith/PyProjects/gerritssh/gerritssh/gerritsite.py", line 555, in text_to_json
    raise TypeError('Argument must be one or more strings')
TypeError: Argument must be one or more strings

The problem is related to unicode translation. Looks like paramiko returns unicode strings in python 2, so it needs to be decoded

gsshcli.py requires __version__ attribute

v0.1.1 moved the version string out of gerritssh/__init__.py into VERSION.py, but the example script requires it to set up the ArgumentParser object.

Hence it fails with an exception

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.