diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/results/python-pip.json | 195 | ||||
| -rwxr-xr-x | test/test.sh | 35 |
2 files changed, 211 insertions, 19 deletions
diff --git a/test/results/python-pip.json b/test/results/python-pip.json new file mode 100644 index 0000000..b5e724a --- /dev/null +++ b/test/results/python-pip.json @@ -0,0 +1,195 @@ +{ + "licenses": [ + { + "count": 4, + "name": "BSD" + }, + { + "count": 4, + "name": "MIT" + }, + { + "count": 1, + "name": "Copyright (c) 2015, Julien Fache" + }, + { + "count": 1, + "name": "New BSD License" + }, + { + "count": 1, + "name": "Python Software Foundation License" + }, + { + "count": 1, + "name": "Standard PIL License" + } + ], + "dependencies": [ + { + "license": { + "name": "BSD", + "url": "http://en.wikipedia.org/wiki/BSD_licenses#4-clause_license_.28original_.22BSD_License.22.29" + }, + "dependency": { + "name": "Django", + "url": "https://www.djangoproject.com/", + "description": "A high-level Python Web framework that encourages rapid development and clean, pragmatic design.", + "pathes": [ + "." + ] + } + }, + { + "license": { + "name": "Standard PIL License" + }, + "dependency": { + "name": "Pillow", + "url": "https://python-pillow.org", + "description": "Python Imaging Library (Fork)", + "pathes": [ + "." + ] + } + }, + { + "license": { + "name": "MIT", + "url": "http://opensource.org/licenses/mit-license" + }, + "dependency": { + "name": "beautifulsoup4", + "url": "http://www.crummy.com/software/BeautifulSoup/bs4/", + "description": "Screen-scraping library", + "pathes": [ + "." + ] + } + }, + { + "license": { + "name": "BSD", + "url": "http://en.wikipedia.org/wiki/BSD_licenses#4-clause_license_.28original_.22BSD_License.22.29" + }, + "dependency": { + "name": "django-contrib-comments", + "url": "https://github.com/django/django-contrib-comments", + "description": "The code formerly known as django.contrib.comments.", + "pathes": [ + "." + ] + } + }, + { + "license": { + "name": "BSD", + "url": "http://en.wikipedia.org/wiki/BSD_licenses#4-clause_license_.28original_.22BSD_License.22.29" + }, + "dependency": { + "name": "django-js-asset", + "url": "https://github.com/matthiask/django-js-asset/", + "description": "script tag with additional attributes for django.forms.Media", + "pathes": [ + "." + ] + } + }, + { + "license": { + "name": "MIT", + "url": "http://opensource.org/licenses/mit-license" + }, + "dependency": { + "name": "django-mptt", + "url": "http://github.com/django-mptt/django-mptt", + "description": "Utilities for implementing Modified Preorder Tree Traversal with your Django Models and working with trees of Model instances.", + "pathes": [ + "." + ] + } + }, + { + "license": { + "name": "BSD", + "url": "http://en.wikipedia.org/wiki/BSD_licenses#4-clause_license_.28original_.22BSD_License.22.29" + }, + "dependency": { + "name": "django-tagging", + "url": "https://github.com/Fantomas42/django-tagging", + "description": "Generic tagging application for Django", + "pathes": [ + "." + ] + } + }, + { + "license": { + "name": "New BSD License" + }, + "dependency": { + "name": "django-xmlrpc", + "url": "https://github.com/Fantomas42/django-xmlrpc", + "description": "XML-RPC Server App for the Django framework.", + "pathes": [ + "." + ] + } + }, + { + "license": { + "name": "Copyright (c) 2015, Julien Fache" + }, + "dependency": { + "name": "mots-vides", + "url": "https://github.com/Fantomas42/mots-vides", + "description": "Python library for managing stop words in many languages.", + "pathes": [ + "." + ] + } + }, + { + "license": { + "name": "MIT", + "url": "http://opensource.org/licenses/mit-license" + }, + "dependency": { + "name": "pyparsing", + "url": "http://pyparsing.wikispaces.com/", + "description": "Python parsing module", + "pathes": [ + "." + ] + } + }, + { + "license": { + "name": "MIT", + "url": "http://opensource.org/licenses/mit-license" + }, + "dependency": { + "name": "pytz", + "url": "http://pythonhosted.org/pytz", + "description": "World timezone definitions, modern and historical", + "pathes": [ + "." + ] + } + }, + { + "license": { + "name": "Python Software Foundation License", + "url": "http://hg.python.org/cpython/raw-file/89ce323357db/LICENSE" + }, + "dependency": { + "name": "regex", + "url": "https://bitbucket.org/mrabarnett/mrab-regex", + "description": "Alternative regular expression module, to replace re.", + "pathes": [ + "." + ] + } + } + ] +} diff --git a/test/test.sh b/test/test.sh index 53c1805..40c29f0 100755 --- a/test/test.sh +++ b/test/test.sh @@ -2,26 +2,23 @@ set -e -for project in ruby-bundler-rails java-maven; do - # Clone the test repository. - echo "Cloning the test repository https://gitlab.com/gitlab-org/security-products/tests/$project.git" - git clone "https://gitlab.com/gitlab-org/security-products/tests/$project.git" "/code/$project" +project=$1 +ref=$2 +url="https://gitlab.com/gitlab-org/security-products/tests/$project.git" - # Run license management on it. - echo "Running license management on the $project" - cd "/code/$project" - /run.sh analyze . +# Clone the test repository. +echo "Cloning the test project $project from $url" +git clone "$url" "/code/$project" - # Compare results with expected results. - set +e - diff "/code/$project/gl-license-management-report.json" "/test/results/$project.json" > /diff.txt - set -e +# Run license management on it. +echo "Running license management on the $project with ref $ref" +cd "/code/$project" +git checkout "$ref" 2> /dev/null +/run.sh analyze . - if [ -s /diff.txt ] ; then - echo "Unexpected result. Here is the diff between actual results and those expected :" - cat /diff.txt - exit 1 - fi -done +# In order to upload the artifact to check it manually +mkdir -p /results/ +cp "/code/$project/gl-license-management-report.json" "/results/$project-gl-license-management-report.json" -echo "All tests are OK." +# Compare results with expected results. +diff -u "/code/$project/gl-license-management-report.json" "/test/results/$project.json" |
