3eef0e18e0
Refactor Ci::Commit and Ci::Build to have all builds for same :sha on single page This makes Ci::Commit to have only :sha and simplifies routing to have only :sha in path. The :ref and :push_data is now parameter of Ci::Build. All commit related data (git author, message and .gitlab-ci.yml) is read directly from repository. All code related for creating builds is moved to CreateBuildsService. Status deduction is rewritten to make if more efficient and easier to integrate with Commit Status API. This is partially working, tests are not yet touched. This slightly changes view of Commit: ![Screen_Shot_2015-10-02_at_15.21.47](https://gitlab.com/gitlab-org/gitlab-ce/uploads/ad3f1ccdcc87659ea437d8db6c5b9f94/Screen_Shot_2015-10-02_at_15.21.47.png) @dzaporozhets What do you think? See merge request !1502
50 lines
1.3 KiB
Ruby
50 lines
1.3 KiB
Ruby
if ENV['SIMPLECOV']
|
|
require 'simplecov'
|
|
SimpleCov.start :rails
|
|
end
|
|
|
|
if ENV['COVERALLS']
|
|
require 'coveralls'
|
|
Coveralls.wear_merged!
|
|
end
|
|
|
|
ENV["RAILS_ENV"] ||= 'test'
|
|
|
|
require File.expand_path("../../config/environment", __FILE__)
|
|
require 'rspec/rails'
|
|
require 'shoulda/matchers'
|
|
require 'sidekiq/testing/inline'
|
|
require 'benchmark/ips'
|
|
|
|
# Requires supporting ruby files with custom matchers and macros, etc,
|
|
# in spec/support/ and its subdirectories.
|
|
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
|
|
|
|
RSpec.configure do |config|
|
|
config.use_transactional_fixtures = false
|
|
config.use_instantiated_fixtures = false
|
|
config.mock_with :rspec
|
|
|
|
config.include Devise::TestHelpers, type: :controller
|
|
config.include LoginHelpers, type: :feature
|
|
config.include LoginHelpers, type: :request
|
|
config.include StubConfiguration
|
|
config.include RelativeUrl, type: feature
|
|
config.include TestEnv
|
|
config.include StubGitlabCalls
|
|
config.include StubGitlabData
|
|
config.include BenchmarkMatchers, benchmark: true
|
|
|
|
config.infer_spec_type_from_file_location!
|
|
config.raise_errors_for_deprecations!
|
|
|
|
config.before(:suite) do
|
|
TestEnv.init
|
|
end
|
|
end
|
|
|
|
FactoryGirl::SyntaxRunner.class_eval do
|
|
include RSpec::Mocks::ExampleMethods
|
|
end
|
|
|
|
ActiveRecord::Migration.maintain_test_schema!
|