From 738801c4253c0076183153ebba1f33dd0d2a576f Mon Sep 17 00:00:00 2001 From: Fabien Catteau Date: Wed, 12 Jun 2019 15:27:49 +0000 Subject: Add Python 3 project to QA --- .gitlab-ci.yml | 12 ++- run.sh | 6 +- test/results/python3-pip.json | 212 ++++++++++++++++++++++++++++++++++++++++++ test/test.sh | 5 +- 4 files changed, 229 insertions(+), 6 deletions(-) create mode 100644 test/results/python3-pip.json diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 41583fd..f867d1c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -48,12 +48,14 @@ container_scanning: .QA: image: docker:stable stage: test + variables: + LM_PYTHON_VERSION: 2 script: - docker info - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY - docker pull $TMP_IMAGE - mkdir results - - docker run --volume `pwd`/results:/results $TMP_IMAGE test $QA_PROJECT $QA_REF + - docker run --env LM_PYTHON_VERSION --volume `pwd`/results:/results $TMP_IMAGE test $QA_PROJECT ${QA_RESULTS:-$QA_PROJECT} $QA_REF artifacts: paths: - results/ @@ -71,6 +73,14 @@ QA:python-pip: QA_PROJECT: python-pip QA_REF: 04dce91b +QA:python3-pip: + extends: .QA + variables: + LM_PYTHON_VERSION: 3 + QA_RESULTS: python3-pip + QA_PROJECT: python-pip + QA_REF: 48e250a1 + QA:ruby-bundler: extends: .QA variables: diff --git a/run.sh b/run.sh index 7adf439..0ce0266 100755 --- a/run.sh +++ b/run.sh @@ -7,7 +7,7 @@ $(basename "$0") [-h] $(basename "$0") analyze PROJECT_PATH -$(basename "$0") test PROJECT_NAME PROJECT_REF +$(basename "$0") test PROJECT_NAME RESULTS_NAME PROJECT_REF where: -h show this help text @@ -60,7 +60,7 @@ if [ "$COMMAND" = "analyze" -a $# -ne 1 ] ; then exit 1 fi -if [ "$COMMAND" = "test" -a $# -ne 2 ] ; then +if [ "$COMMAND" = "test" -a $# -ne 3 ] ; then echo "$usage" exit 1 fi @@ -89,7 +89,7 @@ esac case "$COMMAND" in test) # Run integration tests. - exec /test/test.sh $1 $2 + exec /test/test.sh $1 $2 $3 ;; analyze) diff --git a/test/results/python3-pip.json b/test/results/python3-pip.json new file mode 100644 index 0000000..d98669d --- /dev/null +++ b/test/results/python3-pip.json @@ -0,0 +1,212 @@ +{ + "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" + }, + { + "count": 1, + "name": "http://www.apache.org/licenses/LICENSE-2.0" + } + ], + "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": [ + "." + ] + } + }, + { + "license": { + "name": "http://www.apache.org/licenses/LICENSE-2.0" + }, + "dependency": { + "name": "tornado", + "url": "http://www.tornadoweb.org/", + "description": "Tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed.", + "pathes": [ + "." + ] + } + } + ] +} diff --git a/test/test.sh b/test/test.sh index ed4d8e9..042adc3 100755 --- a/test/test.sh +++ b/test/test.sh @@ -3,7 +3,8 @@ set -e project=$1 -ref=$2 +results=$2 +ref=$3 url="https://gitlab.com/gitlab-org/security-products/tests/$project.git" # Clone the test repository. @@ -21,4 +22,4 @@ mkdir -p /results/ cp "/code/$project/gl-license-management-report.json" "/results/$project-gl-license-management-report.json" # Compare results with expected results. -diff -u "/code/$project/gl-license-management-report.json" "/test/results/$project.json" +diff -u "/code/$project/gl-license-management-report.json" "/test/results/$results.json" -- cgit v1.2.3