diff options
| author | Lukas Eipert <leipert@gitlab.com> | 2018-06-14 18:36:22 +0000 |
|---|---|---|
| committer | Fabien Catteau <fcatteau@gitlab.com> | 2018-06-14 18:36:22 +0000 |
| commit | 2bf9bc8145a881b7b6e17423ab8dfccbfd138fc7 (patch) | |
| tree | cb42f99f76906d6ae652dc0b0dfc1ad5256cbf59 /test | |
| parent | ae265f62905777bd9df4c6397399413794afb15e (diff) | |
Ensure that license name order is consistent
Diffstat (limited to 'test')
| -rw-r--r-- | test/results/java-maven.json | 245 | ||||
| -rwxr-xr-x | test/test.sh | 36 |
2 files changed, 264 insertions, 17 deletions
diff --git a/test/results/java-maven.json b/test/results/java-maven.json new file mode 100644 index 0000000..fa7bf74 --- /dev/null +++ b/test/results/java-maven.json @@ -0,0 +1,245 @@ +{ + "licenses": [ + { + "count": 13, + "name": "Apache 2.0" + }, + { + "count": 1, + "name": "BSD style" + }, + { + "count": 1, + "name": "Common Public License Version 1.0" + }, + { + "count": 1, + "name": "MIT" + }, + { + "count": 1, + "name": "MPL 1.1, LGPL 2.1, Apache 2.0" + } + ], + "dependencies": [ + { + "license": { + "name": "Apache 2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0.txt" + }, + "dependency": { + "name": "commons-lang3", + "description": "", + "pathes": [ + "." + ] + } + }, + { + "license": { + "name": "BSD style" + }, + "dependency": { + "name": "hamcrest-core", + "description": "", + "pathes": [ + "." + ] + } + }, + { + "license": { + "name": "Apache 2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0.txt" + }, + "dependency": { + "name": "jackson-annotations", + "description": "", + "pathes": [ + "." + ] + } + }, + { + "license": { + "name": "Apache 2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0.txt" + }, + "dependency": { + "name": "jackson-core", + "description": "", + "pathes": [ + "." + ] + } + }, + { + "license": { + "name": "Apache 2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0.txt" + }, + "dependency": { + "name": "jackson-databind", + "description": "", + "pathes": [ + "." + ] + } + }, + { + "license": { + "name": "MPL 1.1, LGPL 2.1, Apache 2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0.txt" + }, + "dependency": { + "name": "javassist", + "description": "", + "pathes": [ + "." + ] + } + }, + { + "license": { + "name": "Common Public License Version 1.0" + }, + "dependency": { + "name": "junit", + "description": "", + "pathes": [ + "." + ] + } + }, + { + "license": { + "name": "Apache 2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0.txt" + }, + "dependency": { + "name": "maven-artifact", + "description": "", + "pathes": [ + "." + ] + } + }, + { + "license": { + "name": "MIT", + "url": "http://opensource.org/licenses/mit-license" + }, + "dependency": { + "name": "mockito-core", + "description": "", + "pathes": [ + "." + ] + } + }, + { + "license": { + "name": "Apache 2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0.txt" + }, + "dependency": { + "name": "netty", + "description": "", + "pathes": [ + "." + ] + } + }, + { + "license": { + "name": "Apache 2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0.txt" + }, + "dependency": { + "name": "objenesis", + "description": "", + "pathes": [ + "." + ] + } + }, + { + "license": { + "name": "Apache 2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0.txt" + }, + "dependency": { + "name": "plexus-utils", + "description": "", + "pathes": [ + "." + ] + } + }, + { + "license": { + "name": "Apache 2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0.txt" + }, + "dependency": { + "name": "powermock-api-mockito", + "description": "", + "pathes": [ + "." + ] + } + }, + { + "license": { + "name": "Apache 2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0.txt" + }, + "dependency": { + "name": "powermock-api-mockito-common", + "description": "", + "pathes": [ + "." + ] + } + }, + { + "license": { + "name": "Apache 2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0.txt" + }, + "dependency": { + "name": "powermock-api-support", + "description": "", + "pathes": [ + "." + ] + } + }, + { + "license": { + "name": "Apache 2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0.txt" + }, + "dependency": { + "name": "powermock-core", + "description": "", + "pathes": [ + "." + ] + } + }, + { + "license": { + "name": "Apache 2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0.txt" + }, + "dependency": { + "name": "powermock-reflect", + "description": "", + "pathes": [ + "." + ] + } + } + ] +} diff --git a/test/test.sh b/test/test.sh index c77ec1d..0130492 100755 --- a/test/test.sh +++ b/test/test.sh @@ -2,24 +2,26 @@ set -e -# Clone the Ruby Bundler test repository. -echo "Cloning the test repository https://gitlab.com/gitlab-org/security-products/tests/ruby-bundler.git" -git clone https://gitlab.com/gitlab-org/security-products/tests/ruby-bundler.git /code +for project in ruby-bundler 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" -# Run license management on it. -echo "Running license management on the cloned repository" -cd /code -/run.sh analyze . + # Run license management on it. + echo "Running license management on the $project" + cd "/code/$project" + /run.sh analyze . -# Compare results with expected results. -set +e -diff /code/gl-license-management-report.json /test/results/ruby-bundler.json > /diff.txt + # Compare results with expected results. + set +e + diff "/code/$project/gl-license-management-report.json" "/test/results/$project.json" > /diff.txt + set -e -if [ -s /diff.txt ] ; then - echo "Unexpected result. Here is the diff between actual results and those expected :" - cat /diff.txt - exit 1 -else - echo "All tests are OK." -fi + 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 +echo "All tests are OK." |
