Commit ba04974a authored by Bob Van Landuyt's avatar Bob Van Landuyt

Merge branch 'mobsf-test' into 'master'

Add more specs to cover more cases for MobSF

See merge request gitlab-org/gitlab!46078
parents 49cd1f80 b1e9f846
......@@ -31,12 +31,26 @@ RSpec.describe 'SAST.gitlab-ci.yml' do
end
end
context 'when SAST_EXPERIMENTAL_FEATURES is disabled for iOS projects' do
let(:files) { { 'a.xcodeproj/x.pbxproj' => '' } }
before do
create(:ci_variable, project: project, key: 'SAST_EXPERIMENTAL_FEATURES', value: 'false')
end
it 'includes no jobs' do
expect { pipeline }.to raise_error(Ci::CreatePipelineService::CreateError)
end
end
context 'by default' do
describe 'language detection' do
using RSpec::Parameterized::TableSyntax
where(:case_name, :files, :variables, :include_build_names) do
'Android' | { 'AndroidManifest.xml' => '', 'a.java' => '' } | { 'SAST_EXPERIMENTAL_FEATURES' => 'true' } | %w(mobsf-android-sast)
'Android' | { 'app/src/main/AndroidManifest.xml' => '' } | { 'SAST_EXPERIMENTAL_FEATURES' => 'true' } | %w(mobsf-android-sast)
'Android' | { 'a/b/AndroidManifest.xml' => '' } | { 'SAST_EXPERIMENTAL_FEATURES' => 'true' } | %w(mobsf-android-sast)
'Apex' | { 'app.cls' => '' } | {} | %w(pmd-apex-sast)
'C' | { 'app.c' => '' } | {} | %w(flawfinder-sast)
'C++' | { 'app.cpp' => '' } | {} | %w(flawfinder-sast)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment