Skip to content
Snippets Groups Projects
Commit 039b34d0 authored by yliu uc1testing's avatar yliu uc1testing
Browse files

Merge branch 'cz-opensearch-support' into 'master'

Add OpenSearch version support to the nightly pipeline

Closes gitlab#340368

See merge request gitlab-org/gitlab-qa!928
parents 9c8dab1d a08a0729
No related branches found
No related tags found
No related merge requests found
ee:opensearch:
extends:
- .rules:ee-never-when-triggered-by-feature-flag-definition-change
- .test
- .high-capacity
- .ee-variables
- .rspec-report-opts
variables:
QA_SCENARIO: "Test::Integration::Opensearch"
ee:opensearch-quarantine:
extends:
- .rules:ee-never-when-triggered-by-feature-flag-definition-change
- .test
- .high-capacity
- .ee-variables
- .quarantine
- .rspec-report-opts
variables:
QA_SCENARIO: "Test::Integration::Opensearch"
# frozen_string_literal: true
module Gitlab
module QA
module Component
class Opensearch < Base
DOCKER_IMAGE = 'opensearchproject/opensearch'
def name
@name ||= "elastic68"
end
def tag
Runtime::Env.opensearch_version
end
def start
@docker.run(image: image, tag: tag) do |command|
command << "-d"
command << "--name #{name}"
command << "--net #{network}"
command << "--publish 9200:9200"
command << "--publish 9300:9300"
command.env("discovery.type", "single-node")
command.env("ES_JAVA_OPTS", "-Xms512m -Xmx512m")
command.env("plugins.security.disabled", "true")
end
end
end
end
end
end
Loading
Loading
@@ -232,6 +232,10 @@ module Gitlab
env_var_value_if_defined('ELASTIC_VERSION') || '8.2.0'
end
 
def opensearch_version
env_var_value_if_defined('OPENSEARCH_VERSION') || '2.0.1'
end
def require_license!
return if ENV.include?('EE_LICENSE')
 
Loading
Loading
# frozen_string_literal: true
module Gitlab
module QA
module Scenario
module Test
module Integration
class Opensearch < Scenario::Template
attr_reader :gitlab_name, :spec_suite
def initialize
@gitlab_name = 'gitlab-opensearch'
# Currently the test suite that tests Advanced Search features is called 'Elasticsearch' which we hope to abstract to 'Advancedsearch' in the future
@spec_suite = 'QA::EE::Scenario::Test::Integration::Elasticsearch'
end
def before_perform(release)
raise ArgumentError, 'OpenSearch is an EE only feature!' unless release.ee?
end
def perform(release, *rspec_args)
release = QA::Release.new(release)
before_perform(release)
Component::Gitlab.perform do |gitlab|
gitlab.release = release
setup_opensearch_on gitlab
Component::Opensearch.perform do |opensearch|
opensearch.network = 'test'
opensearch.instance do
gitlab.instance do
Runtime::Logger.info("Running #{spec_suite} specs!")
Component::Specs.perform do |specs|
specs.suite = spec_suite
specs.release = gitlab.release
specs.network = gitlab.network
specs.args = [gitlab.address, *rspec_args]
end
end
end
end
end
end
def empty_index
@empty_index ||= ["gitlab-rake gitlab:elastic:create_empty_index"]
end
def setup_opensearch_on(instance)
instance.name = gitlab_name
instance.network = 'test'
instance.elastic_url = "http://elastic68:9200"
instance.exec_commands = empty_index
end
end
end
end
end
end
end
Loading
Loading
@@ -37,6 +37,7 @@ class GenerateQAJobs
jobs.merge!(load_yml_contents('registry', should_automatically_run?('test_integration_registry')))
jobs.merge!(load_yml_contents('packages', should_automatically_run?('test_instance_all_packages')))
jobs.merge!(load_yml_contents('elasticsearch', should_automatically_run?('test_integration_elasticsearch')))
jobs.merge!(load_yml_contents('opensearch', should_automatically_run?('test_integration_opensearch')))
jobs.merge!(load_yml_contents('praefect', should_automatically_run?('test_instance_all')))
jobs.merge!(load_yml_contents('gitaly_cluster', should_automatically_run?('test_instance_all')))
jobs.merge!(load_yml_contents('mtls', should_automatically_run?('test_instance_all_mtls')))
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment