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
pythonPackages.dodgy: init at 0.2.1 #77255
Conversation
# Tests are not passing: | ||
# $ git clone git@github.com:landscapeio/dodgy.git | ||
# $ tox | ||
doCheck = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tox just abstracts over python interpreter versions, taken from tox.ini:
checkInputs = [ nose mock ];
checkPhase = ''
nosetests -s
'';
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, that's true, however, for real the tests are not passing, (it's not nix related, it's related to the actual dodgy code), see:
test are broken from the very source code:
kamado:~/Documents/dodgy$ tox
GLOB sdist-make: /home/kamado/Documents/dodgy/setup.py
py34 create: /home/kamado/Documents/dodgy/.tox/py34
ERROR: InterpreterNotFound: python3.4
py35 create: /home/kamado/Documents/dodgy/.tox/py35
ERROR: InterpreterNotFound: python3.5
py36 create: /home/kamado/Documents/dodgy/.tox/py36
ERROR: InterpreterNotFound: python3.6
py37 inst-nodeps: /home/kamado/Documents/dodgy/.tox/.tmp/package/1/dodgy-0.2.2.zip
py37 installed: dodgy==0.2.2,mock==3.0.5,nose==1.3.7,six==1.13.0
py37 run-test-pre: PYTHONHASHSEED='1738575116'
py37 run-test: commands[0] | nosetests -s
......{
"warnings": [
"should-be-warning"
]
}
{
"warnings": []
}
EEE
======================================================================
ERROR: Failure: ModuleNotFoundError (No module named 'dodgy.configuration')
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/kamado/Documents/dodgy/.tox/py37/lib/python3.7/site-packages/nose/failure.py", line 39, in runTest
raise self.exc_val.with_traceback(self.tb)
File "/home/kamado/Documents/dodgy/.tox/py37/lib/python3.7/site-packages/nose/loader.py", line 418, in loadTestsFromName
addr.filename, addr.module)
File "/home/kamado/Documents/dodgy/.tox/py37/lib/python3.7/site-packages/nose/importer.py", line 47, in importFromPath
return self.importFromDir(dir_path, fqname)
File "/home/kamado/Documents/dodgy/.tox/py37/lib/python3.7/site-packages/nose/importer.py", line 94, in importFromDir
mod = load_module(part_fqname, fh, filename, desc)
File "/home/kamado/Documents/dodgy/.tox/py37/lib/python3.7/imp.py", line 234, in load_module
return load_source(name, filename, file)
File "/home/kamado/Documents/dodgy/.tox/py37/lib/python3.7/imp.py", line 171, in load_source
module = _load(spec)
File "<frozen importlib._bootstrap>", line 696, in _load
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/home/kamado/Documents/dodgy/tests/test_configuration.py", line 3, in <module>
from dodgy.configuration import get_options
ModuleNotFoundError: No module named 'dodgy.configuration'
======================================================================
ERROR: test_return_1_for_warnings (tests.test_run.TestRun)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/kamado/Documents/dodgy/.tox/py37/lib/python3.7/site-packages/mock/mock.py", line 1330, in patched
return func(*args, **keywargs)
File "/home/kamado/Documents/dodgy/tests/test_run.py", line 17, in test_return_1_for_warnings
self.assertEqual(run(), 1)
File "/home/kamado/Documents/dodgy/dodgy/run.py", line 73, in run
sys.exit(1 if warnings else 0)
SystemExit: 1
======================================================================
ERROR: test_return_zero_for_success (tests.test_run.TestRun)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/kamado/Documents/dodgy/.tox/py37/lib/python3.7/site-packages/mock/mock.py", line 1330, in patched
return func(*args, **keywargs)
File "/home/kamado/Documents/dodgy/tests/test_run.py", line 12, in test_return_zero_for_success
self.assertEqual(run(), 0)
File "/home/kamado/Documents/dodgy/dodgy/run.py", line 73, in run
sys.exit(1 if warnings else 0)
SystemExit: 0
----------------------------------------------------------------------
Ran 9 tests in 0.016s
FAILED (errors=3)
ERROR: InvocationError for command /home/kamado/Documents/dodgy/.tox/py37/bin/nosetests -s (exited with code 1)
py38 inst-nodeps: /home/kamado/Documents/dodgy/.tox/.tmp/package/1/dodgy-0.2.2.zip
py38 installed: dodgy==0.2.2,mock==3.0.5,nose==1.3.7,six==1.13.0
py38 run-test-pre: PYTHONHASHSEED='1738575116'
py38 run-test: commands[0] | nosetests -s
......{
"warnings": [
"should-be-warning"
]
}
{
"warnings": []
}
EEE
======================================================================
ERROR: Failure: ModuleNotFoundError (No module named 'dodgy.configuration')
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/kamado/Documents/dodgy/.tox/py38/lib/python3.8/site-packages/nose/failure.py", line 39, in runTest
raise self.exc_val.with_traceback(self.tb)
File "/home/kamado/Documents/dodgy/.tox/py38/lib/python3.8/site-packages/nose/loader.py", line 417, in loadTestsFromName
module = self.importer.importFromPath(
File "/home/kamado/Documents/dodgy/.tox/py38/lib/python3.8/site-packages/nose/importer.py", line 47, in importFromPath
return self.importFromDir(dir_path, fqname)
File "/home/kamado/Documents/dodgy/.tox/py38/lib/python3.8/site-packages/nose/importer.py", line 94, in importFromDir
mod = load_module(part_fqname, fh, filename, desc)
File "/home/kamado/Documents/dodgy/.tox/py38/lib/python3.8/imp.py", line 234, in load_module
return load_source(name, filename, file)
File "/home/kamado/Documents/dodgy/.tox/py38/lib/python3.8/imp.py", line 171, in load_source
module = _load(spec)
File "<frozen importlib._bootstrap>", line 702, in _load
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/home/kamado/Documents/dodgy/tests/test_configuration.py", line 3, in <module>
from dodgy.configuration import get_options
ModuleNotFoundError: No module named 'dodgy.configuration'
======================================================================
ERROR: test_return_1_for_warnings (tests.test_run.TestRun)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/kamado/Documents/dodgy/.tox/py38/lib/python3.8/site-packages/mock/mock.py", line 1330, in patched
return func(*args, **keywargs)
File "/home/kamado/Documents/dodgy/tests/test_run.py", line 17, in test_return_1_for_warnings
self.assertEqual(run(), 1)
File "/home/kamado/Documents/dodgy/dodgy/run.py", line 73, in run
sys.exit(1 if warnings else 0)
SystemExit: 1
======================================================================
ERROR: test_return_zero_for_success (tests.test_run.TestRun)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/kamado/Documents/dodgy/.tox/py38/lib/python3.8/site-packages/mock/mock.py", line 1330, in patched
return func(*args, **keywargs)
File "/home/kamado/Documents/dodgy/tests/test_run.py", line 12, in test_return_zero_for_success
self.assertEqual(run(), 0)
File "/home/kamado/Documents/dodgy/dodgy/run.py", line 73, in run
sys.exit(1 if warnings else 0)
SystemExit: 0
----------------------------------------------------------------------
Ran 9 tests in 0.016s
FAILED (errors=3)
ERROR: InvocationError for command /home/kamado/Documents/dodgy/.tox/py38/bin/nosetests -s (exited with code 1)
_______________________________________________________ summary _______________________________________________________
ERROR: py34: InterpreterNotFound: python3.4
ERROR: py35: InterpreterNotFound: python3.5
ERROR: py36: InterpreterNotFound: python3.6
ERROR: py37: commands failed
ERROR: py38: commands failed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
their tests are failing, however dodgy works fine, I suppose tests/source-code got un-syncrhonized at some point
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
checkInputs = [ nose mock ];
checkPhase = ''
nosetests tests/test_checks.py
'';
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like test_run.py and test_configuration.py require some external setup logic, just scope it to what runs locally
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice idea!
just force-pushed the branch with the changes
cc @peti you may want to look at this:
|
all suggestions have been applied:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
diff LGTM
has test 👍
[3 built, 6 copied (2.4 MiB), 0.6 MiB DL]
https://github.com/NixOS/nixpkgs/pull/77255
2 package were built:
dodgy python38Packages.dodgy
@GrahamcOfBorg build dodgy python38Packages.dodgy |
Motivation for this change
dodgy is a nice tool to check for secrets in source code
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)Notify maintainers
cc @
nix-review rev HEAD plus bynary test