Commit e43d10bd authored by Erick Bajao's avatar Erick Bajao

Add vendored template for Browser Performance

Provides basic job definition for running sitespeed.io
performance test.

We also provided the users a way to override sitespeed
options through job variables.
parent 5e21cc09
---
title: Add vendored template for Browser Performance Testing
merge_request: 17319
author:
type: added
......@@ -18,7 +18,8 @@ module EE
def categories_ee
{
'Security' => 'Security'
'Security' => 'Security',
'Verify' => 'Verify'
}
end
end
......
......@@ -3,17 +3,19 @@
require 'spec_helper'
describe Gitlab::Template::GitlabCiYmlTemplate do
subject { described_class }
describe '.all' do
let(:templates) { described_class.all.map(&:name) }
it 'finds the Security Products templates' do
all = subject.all.map(&:name)
expect(templates).to include('Container-Scanning')
expect(templates).to include('DAST')
expect(templates).to include('Dependency-Scanning')
expect(templates).to include('License-Management')
expect(templates).to include('SAST')
end
expect(all).to include('Container-Scanning')
expect(all).to include('DAST')
expect(all).to include('Dependency-Scanning')
expect(all).to include('License-Management')
expect(all).to include('SAST')
it 'finds the Verify templates' do
expect(templates).to include('Browser-Performance')
end
end
end
# Read more about the feature here: https://docs.gitlab.com/ee/user/project/merge_requests/browser_performance_testing.html
stages:
- build
- test
- deploy
- performance
performance:
stage: performance
image: docker:git
variables:
URL: https://example.com
SITESPEED_VERSION: 6.3.1
SITESPEED_OPTIONS: ''
services:
- docker:stable-dind
script:
- mkdir gitlab-exporter
- wget -O ./gitlab-exporter/index.js https://gitlab.com/gitlab-org/gl-performance/raw/master/index.js
- mkdir sitespeed-results
- docker run --shm-size=1g --rm -v "$(pwd)":/sitespeed.io sitespeedio/sitespeed.io:$SITESPEED_VERSION --plugins.add ./gitlab-exporter --outputFolder sitespeed-results $URL $SITESPEED_OPTIONS
- mv sitespeed-results/data/performance.json performance.json
artifacts:
paths:
- sitespeed-results/
reports:
performance: performance.json
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