Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
9e8fffd0
Commit
9e8fffd0
authored
Jul 26, 2021
by
Jacques Erasmus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test Auxiliary viewers with refactor FF disabled
Adds test coverage with the refactor_blob_viewer FF disabled
parent
30671a90
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
452 additions
and
0 deletions
+452
-0
spec/features/projects/blobs/blob_show_spec.rb
spec/features/projects/blobs/blob_show_spec.rb
+452
-0
No files found.
spec/features/projects/blobs/blob_show_spec.rb
View file @
9e8fffd0
...
...
@@ -1050,6 +1050,458 @@ RSpec.describe 'File blob', :js do
end
end
end
context
'when refactor_blob_viewer is disabled'
do
before
do
stub_feature_flags
(
refactor_blob_viewer:
false
)
end
describe
'.gitlab-ci.yml'
do
before
do
project
.
add_maintainer
(
project
.
creator
)
Files
::
CreateService
.
new
(
project
,
project
.
creator
,
start_branch:
'master'
,
branch_name:
'master'
,
commit_message:
"Add .gitlab-ci.yml"
,
file_path:
'.gitlab-ci.yml'
,
file_content:
File
.
read
(
Rails
.
root
.
join
(
'spec/support/gitlab_stubs/gitlab_ci.yml'
))
).
execute
visit_blob
(
'.gitlab-ci.yml'
)
end
it
'displays an auxiliary viewer'
do
aggregate_failures
do
# shows that configuration is valid
expect
(
page
).
to
have_content
(
'This GitLab CI configuration is valid.'
)
# shows a learn more link
expect
(
page
).
to
have_link
(
'Learn more'
)
end
end
end
describe
'.gitlab/route-map.yml'
do
before
do
project
.
add_maintainer
(
project
.
creator
)
Files
::
CreateService
.
new
(
project
,
project
.
creator
,
start_branch:
'master'
,
branch_name:
'master'
,
commit_message:
"Add .gitlab/route-map.yml"
,
file_path:
'.gitlab/route-map.yml'
,
file_content:
<<-
MAP
.
strip_heredoc
# Team data
- source: 'data/team.yml'
public: 'team/'
MAP
).
execute
visit_blob
(
'.gitlab/route-map.yml'
)
end
it
'displays an auxiliary viewer'
do
aggregate_failures
do
# shows that map is valid
expect
(
page
).
to
have_content
(
'This Route Map is valid.'
)
# shows a learn more link
expect
(
page
).
to
have_link
(
'Learn more'
)
end
end
end
describe
'.gitlab/dashboards/custom-dashboard.yml'
do
before
do
project
.
add_maintainer
(
project
.
creator
)
Files
::
CreateService
.
new
(
project
,
project
.
creator
,
start_branch:
'master'
,
branch_name:
'master'
,
commit_message:
"Add .gitlab/dashboards/custom-dashboard.yml"
,
file_path:
'.gitlab/dashboards/custom-dashboard.yml'
,
file_content:
file_content
).
execute
end
context
'with metrics_dashboard_exhaustive_validations feature flag off'
do
before
do
stub_feature_flags
(
metrics_dashboard_exhaustive_validations:
false
)
visit_blob
(
'.gitlab/dashboards/custom-dashboard.yml'
)
end
context
'valid dashboard file'
do
let
(
:file_content
)
{
File
.
read
(
Rails
.
root
.
join
(
'config/prometheus/common_metrics.yml'
))
}
it
'displays an auxiliary viewer'
do
aggregate_failures
do
# shows that dashboard yaml is valid
expect
(
page
).
to
have_content
(
'Metrics Dashboard YAML definition is valid.'
)
# shows a learn more link
expect
(
page
).
to
have_link
(
'Learn more'
)
end
end
end
context
'invalid dashboard file'
do
let
(
:file_content
)
{
"dashboard: 'invalid'"
}
it
'displays an auxiliary viewer'
do
aggregate_failures
do
# shows that dashboard yaml is invalid
expect
(
page
).
to
have_content
(
'Metrics Dashboard YAML definition is invalid:'
)
expect
(
page
).
to
have_content
(
"panel_groups: should be an array of panel_groups objects"
)
# shows a learn more link
expect
(
page
).
to
have_link
(
'Learn more'
)
end
end
end
end
context
'with metrics_dashboard_exhaustive_validations feature flag on'
do
before
do
stub_feature_flags
(
metrics_dashboard_exhaustive_validations:
true
)
visit_blob
(
'.gitlab/dashboards/custom-dashboard.yml'
)
end
context
'valid dashboard file'
do
let
(
:file_content
)
{
File
.
read
(
Rails
.
root
.
join
(
'config/prometheus/common_metrics.yml'
))
}
it
'displays an auxiliary viewer'
do
aggregate_failures
do
# shows that dashboard yaml is valid
expect
(
page
).
to
have_content
(
'Metrics Dashboard YAML definition is valid.'
)
# shows a learn more link
expect
(
page
).
to
have_link
(
'Learn more'
)
end
end
end
context
'invalid dashboard file'
do
let
(
:file_content
)
{
"dashboard: 'invalid'"
}
it
'displays an auxiliary viewer'
do
aggregate_failures
do
# shows that dashboard yaml is invalid
expect
(
page
).
to
have_content
(
'Metrics Dashboard YAML definition is invalid:'
)
expect
(
page
).
to
have_content
(
"root is missing required keys: panel_groups"
)
# shows a learn more link
expect
(
page
).
to
have_link
(
'Learn more'
)
end
end
end
end
end
context
'LICENSE'
do
before
do
visit_blob
(
'LICENSE'
)
end
it
'displays an auxiliary viewer'
do
aggregate_failures
do
# shows license
expect
(
page
).
to
have_content
(
'This project is licensed under the MIT License.'
)
# shows a learn more link
expect
(
page
).
to
have_link
(
'Learn more'
,
href:
'http://choosealicense.com/licenses/mit/'
)
end
end
end
context
'*.gemspec'
do
before
do
project
.
add_maintainer
(
project
.
creator
)
Files
::
CreateService
.
new
(
project
,
project
.
creator
,
start_branch:
'master'
,
branch_name:
'master'
,
commit_message:
"Add activerecord.gemspec"
,
file_path:
'activerecord.gemspec'
,
file_content:
<<-
SPEC
.
strip_heredoc
Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.name = "activerecord"
end
SPEC
).
execute
visit_blob
(
'activerecord.gemspec'
)
end
it
'displays an auxiliary viewer'
do
aggregate_failures
do
# shows names of dependency manager and package
expect
(
page
).
to
have_content
(
'This project manages its dependencies using RubyGems.'
)
# shows a learn more link
expect
(
page
).
to
have_link
(
'Learn more'
,
href:
'https://rubygems.org/'
)
end
end
end
context
'CONTRIBUTING.md'
do
before
do
file_name
=
'CONTRIBUTING.md'
create_file
(
file_name
,
'## Contribution guidelines'
)
visit_blob
(
file_name
)
end
it
'displays an auxiliary viewer'
do
aggregate_failures
do
expect
(
page
).
to
have_content
(
"After you've reviewed these contribution guidelines, you'll be all set to contribute to this project."
)
end
end
end
context
'CHANGELOG.md'
do
before
do
file_name
=
'CHANGELOG.md'
create_file
(
file_name
,
'## Changelog for v1.0.0'
)
visit_blob
(
file_name
)
end
it
'displays an auxiliary viewer'
do
aggregate_failures
do
expect
(
page
).
to
have_content
(
"To find the state of this project's repository at the time of any of these versions, check out the tags."
)
end
end
end
context
'Cargo.toml'
do
before
do
file_name
=
'Cargo.toml'
create_file
(
file_name
,
'
[package]
name = "hello_world" # the name of the package
version = "0.1.0" # the current version, obeying semver
authors = ["Alice <a@example.com>", "Bob <b@example.com>"]
'
)
visit_blob
(
file_name
)
end
it
'displays an auxiliary viewer'
do
aggregate_failures
do
expect
(
page
).
to
have_content
(
"This project manages its dependencies using Cargo."
)
end
end
end
context
'Cartfile'
do
before
do
file_name
=
'Cartfile'
create_file
(
file_name
,
'
gitlab "Alamofire/Alamofire" == 4.9.0
gitlab "Alamofire/AlamofireImage" ~> 3.4
'
)
visit_blob
(
file_name
)
end
it
'displays an auxiliary viewer'
do
aggregate_failures
do
expect
(
page
).
to
have_content
(
"This project manages its dependencies using Carthage."
)
end
end
end
context
'composer.json'
do
before
do
file_name
=
'composer.json'
create_file
(
file_name
,
'
{
"license": "MIT"
}
'
)
visit_blob
(
file_name
)
end
it
'displays an auxiliary viewer'
do
aggregate_failures
do
expect
(
page
).
to
have_content
(
"This project manages its dependencies using Composer."
)
end
end
end
context
'Gemfile'
do
before
do
file_name
=
'Gemfile'
create_file
(
file_name
,
'
source "https://rubygems.org"
# Gems here
'
)
visit_blob
(
file_name
)
end
it
'displays an auxiliary viewer'
do
aggregate_failures
do
expect
(
page
).
to
have_content
(
"This project manages its dependencies using Bundler."
)
end
end
end
context
'Godeps.json'
do
before
do
file_name
=
'Godeps.json'
create_file
(
file_name
,
'
{
"GoVersion": "go1.6"
}
'
)
visit_blob
(
file_name
)
end
it
'displays an auxiliary viewer'
do
aggregate_failures
do
expect
(
page
).
to
have_content
(
"This project manages its dependencies using godep."
)
end
end
end
context
'go.mod'
do
before
do
file_name
=
'go.mod'
create_file
(
file_name
,
'
module example.com/mymodule
go 1.14
'
)
visit_blob
(
file_name
)
end
it
'displays an auxiliary viewer'
do
aggregate_failures
do
expect
(
page
).
to
have_content
(
"This project manages its dependencies using Go Modules."
)
end
end
end
context
'package.json'
do
before
do
file_name
=
'package.json'
create_file
(
file_name
,
'
{
"name": "my-awesome-package",
"version": "1.0.0"
}
'
)
visit_blob
(
file_name
)
end
it
'displays an auxiliary viewer'
do
aggregate_failures
do
expect
(
page
).
to
have_content
(
"This project manages its dependencies using npm."
)
end
end
end
context
'podfile'
do
before
do
file_name
=
'podfile'
create_file
(
file_name
,
'platform :ios, "8.0"'
)
visit_blob
(
file_name
)
end
it
'displays an auxiliary viewer'
do
aggregate_failures
do
expect
(
page
).
to
have_content
(
"This project manages its dependencies using CocoaPods."
)
end
end
end
context
'test.podspec'
do
before
do
file_name
=
'test.podspec'
create_file
(
file_name
,
'
Pod::Spec.new do |s|
s.name = "TensorFlowLiteC"
'
)
visit_blob
(
file_name
)
end
it
'displays an auxiliary viewer'
do
aggregate_failures
do
expect
(
page
).
to
have_content
(
"This project manages its dependencies using CocoaPods."
)
end
end
end
context
'JSON.podspec.json'
do
before
do
file_name
=
'JSON.podspec.json'
create_file
(
file_name
,
'
{
"name": "JSON"
}
'
)
visit_blob
(
file_name
)
end
it
'displays an auxiliary viewer'
do
aggregate_failures
do
expect
(
page
).
to
have_content
(
"This project manages its dependencies using CocoaPods."
)
end
end
end
context
'requirements.txt'
do
before
do
file_name
=
'requirements.txt'
create_file
(
file_name
,
'Project requirements'
)
visit_blob
(
file_name
)
end
it
'displays an auxiliary viewer'
do
aggregate_failures
do
expect
(
page
).
to
have_content
(
"This project manages its dependencies using pip."
)
end
end
end
context
'yarn.lock'
do
before
do
file_name
=
'yarn.lock'
create_file
(
file_name
,
'
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
'
)
visit_blob
(
file_name
)
end
it
'displays an auxiliary viewer'
do
aggregate_failures
do
expect
(
page
).
to
have_content
(
"This project manages its dependencies using Yarn."
)
end
end
end
end
end
context
'realtime pipelines'
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment