Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
BioHPC
clair-singularity
Commits
d137b850
Commit
d137b850
authored
Aug 24, 2017
by
David Trudgian
Browse files
Coveralls/test tweaks
parent
21e88886
Changes
4
Hide whitespace changes
Inline
Side-by-side
.travis.yml
View file @
d137b850
...
@@ -4,8 +4,6 @@ language: python
...
@@ -4,8 +4,6 @@ language: python
python
:
python
:
-
"
2.7"
-
"
2.7"
-
"
3.4"
-
"
3.4"
-
"
3.5"
-
"
3.6"
before_install
:
before_install
:
-
wget -O- http://neuro.debian.net/lists/trusty.us-nh.full | sudo tee /etc/apt/sources.list.d/neurodebian.sources.list
-
wget -O- http://neuro.debian.net/lists/trusty.us-nh.full | sudo tee /etc/apt/sources.list.d/neurodebian.sources.list
-
sudo apt-key adv --recv-keys --keyserver hkp://pool.sks-keyservers.net:80 0xA5D32F012649A5A9
-
sudo apt-key adv --recv-keys --keyserver hkp://pool.sks-keyservers.net:80 0xA5D32F012649A5A9
...
@@ -14,5 +12,10 @@ before_install:
...
@@ -14,5 +12,10 @@ before_install:
install
:
install
:
-
pip install --only-binary=numpy,scipy,scikit-learn,pandas numpy scipy scikit-learn pandas
-
pip install --only-binary=numpy,scipy,scikit-learn,pandas numpy scipy scikit-learn pandas
-
pip install flake8 pytest pytest-cov pytest-flake8
-
pip install flake8 pytest pytest-cov pytest-flake8
-
pip install python-coveralls
-
python setup.py install
-
python setup.py install
script
:
pytest --cov --flake8 clair_singularity/
script
:
-
pytest tests/ --cov clair_singularity --cov-report term-missing
after_success
:
-
coveralls
README.md
View file @
d137b850
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
<a
href=
"https://codeclimate.com/github/dctrud/clair-singularity"
><img
src=
"https://codeclimate.com/github/dctrud/clair-singularity/badges/gpa.svg"
/></a>
<a
href=
"https://codeclimate.com/github/dctrud/clair-singularity"
><img
src=
"https://codeclimate.com/github/dctrud/clair-singularity/badges/gpa.svg"
/></a>
<a
href=
"https://travis-ci.org/dctrud/clair-singularity"
><img
src=
"https://travis-ci.org/dctrud/clair-singularity.svg?branch=master"
></a>
<a
href=
"https://travis-ci.org/dctrud/clair-singularity"
><img
src=
"https://travis-ci.org/dctrud/clair-singularity.svg?branch=master"
></a>
[

](https://coveralls.io/github/dctrud/clair-singularity?branch=master)
__
Scan
[
Singularity
](
http://singularity.lbl.gov/
)
container images for security vulnerabilities
__
Scan
[
Singularity
](
http://singularity.lbl.gov/
)
container images for security vulnerabilities
using
[
CoreOS Clair
](
https://github.com/coreos/clai
)
.__
using
[
CoreOS Clair
](
https://github.com/coreos/clai
)
.__
...
...
tests/test_image.py
View file @
d137b850
import
multiprocessing
import
multiprocessing
import
os
import
os
import
subprocess
import
subprocess
import
sys
import
time
import
time
import
pytest
import
pytest
...
@@ -22,7 +21,7 @@ def testimage(tmpdir):
...
@@ -22,7 +21,7 @@ def testimage(tmpdir):
return
os
.
path
.
join
(
tmpdir
.
strpath
,
'vsoch-singularity-hello-world-master.img'
)
return
os
.
path
.
join
(
tmpdir
.
strpath
,
'vsoch-singularity-hello-world-master.img'
)
def
check_image
(
testimage
):
def
test_
check_image
(
testimage
):
# Valid image return True
# Valid image return True
assert
check_image
(
testimage
)
assert
check_image
(
testimage
)
# Sys exit for invalid image
# Sys exit for invalid image
...
@@ -64,4 +63,5 @@ def test_http_server(testimage, tmpdir):
...
@@ -64,4 +63,5 @@ def test_http_server(testimage, tmpdir):
httpd
.
terminate
()
httpd
.
terminate
()
assert
r
.
status_code
==
requests
.
codes
.
ok
assert
r
.
status_code
==
requests
.
codes
.
ok
assert
sha256
(
tmpfile
)
==
'4dba283867ee8bd6178cb6f58778bf8b59e14833468fab58c4e52d9eeae7759f'
assert
sha256
(
tmpfile
)
==
\
'4dba283867ee8bd6178cb6f58778bf8b59e14833468fab58c4e52d9eeae7759f'
tests/test_util.py
View file @
d137b850
import
pytest
from
clair_singularity.util
import
sha256
from
clair_singularity.util
import
sha256
def
test_sha256
():
def
test_sha256
():
"""Check we can get a sha256 on something that won't change often"""
"""Check we can get a sha256 on something that won't change often"""
assert
sha256
(
'.gitignore'
)
==
'da04d844bb8a1fd051cfc7cb8bba1437f3f237f48d2974d72f749ad7fbfd1d96'
assert
sha256
(
'.gitignore'
)
==
\
\ No newline at end of file
'da04d844bb8a1fd051cfc7cb8bba1437f3f237f48d2974d72f749ad7fbfd1d96'
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment