feat: Add analyzer-test-downstreams script
Adds script for testing a given analyzer repository against all
downstream test projects mentioned within .gitlab-ci.yml
Testing
Syntax
❯ ruby -wc analyzer-test-downstreams
Syntax OK
Usage
❯ pwd
/Users/theoretick/code/gl/security-products/analyzers/pmd-apex
❯ ~/code/gl/gitlab-org/secure/tools/analyzer-scripts/analyzer-test-downstreams
********************************************************************************
*** docker run -it --rm --volume "$PWD"/test/fixtures/apex-salesforce:/tmp/app --env CI_PROJECT_DIR=/tmp/app pmd-apex:master
[INFO] [PMD.Apex] [2021-03-08T21:21:07Z] ▶ GitLab PMD.Apex analyzer v2.11.1
[INFO] [PMD.Apex] [2021-03-08T21:21:07Z] ▶ Detecting project
[INFO] [PMD.Apex] [2021-03-08T21:21:07Z] ▶ Found project in /tmp/app/src
[INFO] [PMD.Apex] [2021-03-08T21:21:07Z] ▶ Running analyzer
[INFO] [PMD.Apex] [2021-03-08T21:21:08Z] ▶ Creating report
done: ✅
********************************************************************************
*** ~/code/gl/security-products/ci-templates/scripts/compare_reports.sh sast test/fixtures/apex-salesforce/gl-sast-report.json qa/expect/apex-salesforce/gl-sast-report.json
Fetching Security Report Schema from 'https://gitlab.com/gitlab-org/security-products/security-report-schemas/-/raw/v3.0.0/dist/sast-report-format.json'
--2021-03-08 13:21:09-- https://gitlab.com/gitlab-org/security-products/security-report-schemas/-/raw/v3.0.0/dist/sast-report-format.json
Resolving gitlab.com (gitlab.com)... 172.65.251.78
Connecting to gitlab.com (gitlab.com)|172.65.251.78|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/plain]
Saving to: ‘/tmp/security_report_schemas/sast-report-format.json’
/tmp/security_report_schemas/sast-report-format.json [ <=> ] 12.13K --.-KB/s in 0.001s
2021-03-08 13:21:09 (19.1 MB/s) - ‘/tmp/security_report_schemas/sast-report-format.json’ saved [12426]
done: ✅
Edited by Lucas Charles