summaryrefslogtreecommitdiff
path: root/test/test.sh
blob: 40c29f0bcac442491e321f8dbe9b6cd101c71529 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash

set -e

project=$1
ref=$2
url="https://gitlab.com/gitlab-org/security-products/tests/$project.git"

# Clone the test repository.
echo "Cloning the test project $project from $url"
git clone "$url" "/code/$project"

# 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 .

# 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"

# Compare results with expected results.
diff -u "/code/$project/gl-license-management-report.json" "/test/results/$project.json"