Code Monkey home page Code Monkey logo

stash's People

Contributors

bbooxx avatar bennr01 avatar briarfox avatar dgelessus avatar dutcho avatar glider-gun avatar glyph avatar jsbain avatar oefe avatar sdushantha avatar seanld avatar synack3 avatar ywang-bom avatar ywangd avatar zed avatar zrzka avatar

stash's Issues

Establish unittests/code coverage for bin files

Leveraging the CI test command in the travis.yml file and adding code coverage with python 2, the following results are returned:

---------- coverage: platform linux2, python 2.7.12-final-0 ----------
Name                           Stmts   Miss  Cover
--------------------------------------------------
__init__                           0      0   100%
bin/alias                         28      5    82%
bin/cat                           23      3    87%
bin/cd                            24      6    75%
bin/clear                          1      0   100%
bin/echo                          25     10    60%
bin/grep                          34      5    85%
bin/pwd                           25      5    80%
bin/sort                          27      1    96%
bin/source                        19      4    79%
bin/totd                          21      2    90%
getstash                          74     74     0%
launch_stash                      33     33     0%
lib/libcompleter                  43     11    74%
lib/libcore                       46     40    13%
lib/librunner                     63     49    22%
stash                            156     25    84%
system/__init__                    0      0   100%
system/dummyconsole                6      6     0%
system/dummyobjc_util             46      8    83%
system/dummyui                    60     18    70%
system/shcommon                  194     73    62%
system/shio                       99     63    36%
system/shiowrapper                34      9    74%
system/shparsers                 549    126    77%
system/shruntime                 394    147    63%
system/shscreens                 354    156    56%
system/shstreams                 198    118    40%
system/shterminal                258    173    33%
system/shthreads                 193     65    66%
system/shui                      263     66    75%
system/shuseractionproxy          64     27    58%
system/tests/__init__              0      0   100%
system/tests/data/test05          11      0   100%
system/tests/data/test_101_1       4      0   100%
system/tests/data/test_102_1       5      0   100%
system/tests/data/test_102_2       5      0   100%
system/tests/data/test_12          7      0   100%
system/tests/data/test_12_1        2      0   100%
system/tests/data/test_12_2        2      0   100%
system/tests/data/test_201         1      0   100%
system/tests/data/test_202         1      0   100%
system/tests/data/test_203         1      0   100%
system/tests/data/test_204         1      0   100%
system/tests/test_completer       53      0   100%
system/tests/test_expander        71      0   100%
system/tests/test_runtime         50      1    98%
system/tests/test_termemu         28      0   100%
system/tests/test_threads         36      0   100%
--------------------------------------------------
TOTAL                           3632   1329    63%

There are 66 files in bin/ which do not appear to be tested presently:

  • cowsay.py
  • cp.py
  • crypt.py
  • curl.py
  • cut.py
  • dropbox_setup.py
  • du.py
  • easy_config.py
  • edit.py
  • exit.py
  • fg.py
  • find.py
  • ftpserver.py
  • gci.py
  • gh.py
  • git.py
  • head.py
  • httpserver.py
  • jobs.py
  • kill.py
  • latte.py
  • ls.py
  • mail.py
  • man.py
  • mc.py
  • md5sum.py
  • mkdir.py
  • monkeylord.py
  • more.py
  • mount.py
  • mv.py
  • openin.py
  • pbcopy.py
  • pbpaste.py
  • ping.py
  • pip.py
  • printenv.py
  • printhex.py
  • python.py
  • quicklook.py
  • rmdir.py
  • rm.py
  • scp.py
  • selfupdate.py
  • sha1sum.py
  • sha256sum.py
  • sqlite.py
  • ssh-keygen.py
  • ssh.py
  • stashconf.py
  • tail.py
  • tar.py
  • telnet.py
  • touch.py
  • umount.py
  • uniq.py
  • unzip.py
  • version.py
  • wc.py
  • webviewer.py
  • wget.py
  • whatis.py
  • which.py
  • wol.py
  • xargs.py
  • zip.py

git add fails to recognize relative paths

Git add seems to have an inconsistent behavior for finding a requested file to add. In the following example, trying to add a locally referenced returns a path relative to git root, but trying the same add from git root seems to want the full path:

[bin]$ git status
STAGED
UNSTAGED LOCAL MODS
['bin/git.py']
[bin]$ git add git.py
bin/git.py does not exist. skipping
[bin]$ cd ..
[stash-dev]$ git add git.py
git.py does not exist. skipping

The expected behavior should be to check/add the local file in the first case (not the second).

Cleanup git branch output

Currently, git branch outputs in the form of:

branchnameshort_commit

Add a space to the output as:

branchname short_commit

test_102 intermittent failures

Both in local dev and Travis, I am intermittently seeing the following failures:

=================================== FAILURES ===================================
____________________________ ThreadsTests.test_102 _____________________________
self = <stash.system.tests.test_threads.ThreadsTests testMethod=test_102>
    def test_102(self):
        """
            Two parallel threads with same stdout should interleave
            """
        outs = StringIO()
        self.stash('test_102_1.py &', final_outs=outs)
        self.stash('test_102_2.py &', final_outs=outs)
        time.sleep(7)
        s = outs.getvalue()
>       assert 0 < s.find('test_102_2.py') < len(s)/2, 'Output do not interleave'
E       AssertionError: Output do not interleave
E       assert 0 < 0
E        +  where 0 = <built-in method find of str object at 0x7f5ac5b5f3c8>('test_102_2.py')
E        +    where <built-in method find of str object at 0x7f5ac5b5f3c8> = 'test_102_2.py\ntest_102_1.py\ntest_102_2.py\ntest_102_1.py\ntest_102_2.py\ntest_102_1.py\ntest_102_2.py\ntest_102_1.py\ntest_102_2.py\ntest_102_1.py\n'.find
../system/tests/test_threads.py:42: AssertionError
===================== 1 failed, 35 passed in 20.33 seconds =====================
The command "py.test system/tests --ignore=system/tests/data" exited with 1.

stash.py: Imports failing on python3

Attempting to launch stash w/python3 is currently resulting in the following error:

stash.py: line 12: No module named ‘ConfigParser’

Pythonista 3.1 (301016)
iOS 11.2.1 (64-bit iPad6,3)
stash.py: 2017-12-30 03:52:24

test_11 intermittent failures

**=============================================================== FAILURES ================================================================
___________________________________________________ CompleterTests.test_completion_11 ___________________________________________________

self = <stash.system.tests.test_completer.CompleterTests testMethod=test_completion_11>

    def test_completion_11(self):
        newline, possibilities = self.complete('ls $STASH_ROOT/bi')
>       assert newline.replace('\\', '/') == 'ls $STASH_ROOT/bin/'
E       AssertionError: assert 'ls $STASH_ROOT/bin' == 'ls $STASH_ROOT/bin/'
E         - ls $STASH_ROOT/bin
E         + ls $STASH_ROOT/bin/
E         ?                   +

system/tests/test_completer.py:65: AssertionError
================================================= 1 failed, 34 passed in 23.88 seconds ==================================================

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.