You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cartodb/spec/spec_helper_min.rb

65 lines
1.9 KiB

# This file provides a minimal Rails integration test environment with an empty database, without users.
require 'simplecov_helper'
require 'rspec_configuration'
require 'helpers/spec_helper_helpers'
require 'helpers/named_maps_helper'
4 years ago
require './spec/support/message_broker_stubs'
require './spec/support/redis'
require './spec/support/shared_entities_spec_helper'
ENV['RAILS_ENV'] ||= 'test'
# INFO: this is the only slow step of the test boot process
require File.expand_path('../../config/environment', __FILE__)
# Needed because load order changes in Ruby 2.3+, related to https://github.com/rspec/rspec-rails/pull/1372
# We can remove this if we upgrade to rspec 3+
ActiveRecord.send(:remove_const, :TestFixtures) if ActiveRecord.const_defined?(:TestFixtures)
require 'rspec/rails'
Resque.inline = true
# host_validation is set to support `example.com` emails in specs
# in production we do check for the existance of mx records associated to the domain
EmailAddress::Config.configure(local_format: :conventional, host_validation: :syntax)
RSpec.configure do |config|
config.include SpecHelperHelpers
config.include NamedMapsHelper
5 years ago
config.include Capybara::DSL
config.include FactoryGirl::Syntax::Methods
config.include SharedEntitiesSpecHelper
config.after(:each) do
Delorean.back_to_the_present
end
unless ENV['PARALLEL']
config.before(:suite) do
CartoDB::RedisTest.up
end
end
config.before(:all) do
unless ENV['PARALLEL']
clean_redis_databases
clean_metadata_database
close_pool_connections
drop_leaked_test_user_databases
end
end
config.after(:all) do
ci tests (#15378) * add google cloud build files for ci * add github workflow for NEWS.md check * update gitignore to ignore docker files and related files * adapt tests for the new ci environment on GCB * update config and ci script to run on the new ci environment * changing python requirements to work with pg11 * Commenting federated tables local commands * split big tests into smaller parts * remove disabled tests * adjust cloud build timeouts * Divide user tests by common concept(ish) * remove useless redis test code * add slack notification on master build failure * add cloudbuild file for postgres 12 tests * add new tests to makefile * split user migration tests * extract common logic to a module * refactor user specs * fix user migration tests * remove some silent errors and warnings in specs * update invalidation parameters for tests and development * reduce noise in logs * deleted spec that has been pending for ages * moar trash messages * avoid some race conditions * reorder tests * extract refactored behavior to a different spec file * remove likes specs * regroup tests * reorder tests * reset order from last run in CI * avoid repeat ports for file server * avoid race condition * avoid tests to fail due to dependent users * Remove .git from cartodb before starting compose * we don't need to start builder for the tests * reorganize test * no need to destroy account types * increase statement timeout for carto_db_test * Fix redirection and define TRASH_MESSAGES once * improve test tear down * avoid global tear down in CI * update cloudbuild for pg12 Co-authored-by: Alberto Hernández <albertoh@cartodb.com> Co-authored-by: Esther Lozano <esloho@gmail.com> Co-authored-by: Alberto Romeu <alrocar@users.noreply.github.com>
5 years ago
unless ENV['PARALLEL'] || ENV['BUILD_ID']
close_pool_connections
drop_leaked_test_user_databases
delete_database_test_users
end
end
ci tests (#15378) * add google cloud build files for ci * add github workflow for NEWS.md check * update gitignore to ignore docker files and related files * adapt tests for the new ci environment on GCB * update config and ci script to run on the new ci environment * changing python requirements to work with pg11 * Commenting federated tables local commands * split big tests into smaller parts * remove disabled tests * adjust cloud build timeouts * Divide user tests by common concept(ish) * remove useless redis test code * add slack notification on master build failure * add cloudbuild file for postgres 12 tests * add new tests to makefile * split user migration tests * extract common logic to a module * refactor user specs * fix user migration tests * remove some silent errors and warnings in specs * update invalidation parameters for tests and development * reduce noise in logs * deleted spec that has been pending for ages * moar trash messages * avoid some race conditions * reorder tests * extract refactored behavior to a different spec file * remove likes specs * regroup tests * reorder tests * reset order from last run in CI * avoid repeat ports for file server * avoid race condition * avoid tests to fail due to dependent users * Remove .git from cartodb before starting compose * we don't need to start builder for the tests * reorganize test * no need to destroy account types * increase statement timeout for carto_db_test * Fix redirection and define TRASH_MESSAGES once * improve test tear down * avoid global tear down in CI * update cloudbuild for pg12 Co-authored-by: Alberto Hernández <albertoh@cartodb.com> Co-authored-by: Esther Lozano <esloho@gmail.com> Co-authored-by: Alberto Romeu <alrocar@users.noreply.github.com>
5 years ago
unless ENV['PARALLEL'] || ENV['BUILD_ID']
config.after(:suite) do
CartoDB::RedisTest.down
end
end
end